com.starbase.starteam
Class StatusMethod

java.lang.Object
  |
  +--com.starbase.starteam.StatusMethod

public final class StatusMethod
extends java.lang.Object

This class provides information about how file status is managed for the client. Prior to StarTeam 5.2 all file status information was stored on the StarTeam Server. In 5.2 this staus information moved to the client. There are two ways in which that status information can be stored. These are refered to as "Per folder" and "Central"

"Per folder" status information is stored as close to the source file as possible. Assuming a file under revision control is stored in C:/project/foo.txt then the status information for that file will be stored in C:/project/.sbas/SyncDB. In fact, the status information for all files under C:/project will be stored in the file. There are a number of advantages of storing it in this location. For example, whole local folder structures may be moved or copied to new locations and all the status information will go along with it. The downside to this scheme is that in some cases users will not want the .sbas folders mixed in with the source files they are managing with StarTeam.

"Central" status information is all stored under a single user specified directory on the client's machine. This keeps the status information away from the user's source files. The downside to this approach is that you cannot easily move or copy source directories and have status information go along with it.

Users may specify which of these two methods to use by default along with the location of the central status information. Additionaly, users may override this on a per-View basis.

See Also:
View.getStatusMethodOverride(), View.setStatusMethodOverride(com.starbase.starteam.StatusMethod)

Field Summary
static StatusMethod CENTRAL
          Identifies the "Central" status management method.
static StatusMethod DEFAULT
          Used for specifying a View's status method.
static StatusMethod PER_FOLDER
          Identifies the "Per folder" status management method.
 
Method Summary
static void deleteSyncDB(java.io.File syncDirRoot, java.lang.String key)
          Deletes all the status information for the specified directory path.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
static java.lang.String getCentralStatusDirectory()
          Returns the location of the central status repository.
static FileBasedStatusManager getCentralStatusManager()
          Gets a FileBasedStatusManager for managing status in the central location for this workstation.
static FileBasedStatusManager getDefaultStatusManager()
          Gets the default FileBasedStatusManager for this workstation.
static StatusMethod getDefaultStatusMethod()
          Returns the client's default method for storing status information.
 java.lang.String getDisplayName()
           
 java.lang.String getName()
           
static FileBasedStatusManager getPerFolderStatusManager()
          Gets a FileBasedStatusManager for managing status on a per-folder basis.
static java.util.Enumeration getSourceDirs(java.io.File syncDirRoot)
          Given a root directory which contains centrally managed status data, this method will return an enumeration of all the local directory paths for which there is status data.
static int getSourceDirsCount(java.io.File syncDirRoot)
          Returns the number of local directories that the specified centrally managed status directory is maintaining.
static FileBasedStatusManager getStatusManagerForView(View view)
          Gets the FileBasedStatusManager that manages file status information for the given View.
static FileBasedStatusManager getStatusManagerForViewId(int viewID, java.lang.String serverGUID)
          Gets the FileBasedStatusManager that manages file status information for the given View ID and Server ID.
 int hashCode()
          returns a unique hash for all instances of this type
static void setCentralStatusDirectory(java.lang.String path)
          Change the location of the central status directory.
static void setDefaultStatusMethod(StatusMethod method)
          Sets the client's default method for storing status information.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final StatusMethod DEFAULT
Used for specifying a View's status method. This value indicates to use the global default method.


CENTRAL

public static final StatusMethod CENTRAL
Identifies the "Central" status management method.


PER_FOLDER

public static final StatusMethod PER_FOLDER
Identifies the "Per folder" status management method.

Method Detail

getDisplayName

public java.lang.String getDisplayName()
Returns:
A display name for this StatusMethod.

getName

public java.lang.String getName()
Returns:
The internal name of this StatusMethod.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable name for this status method.

getDefaultStatusMethod

public static StatusMethod getDefaultStatusMethod()
Returns the client's default method for storing status information. Only possible return values are PER_FOLDER and CENTRAL.


setDefaultStatusMethod

public static void setDefaultStatusMethod(StatusMethod method)
Sets the client's default method for storing status information.

Parameters:
method - the status method to use. Only possible values are PER_FOLDER and CENTRAL. May not be null.

setCentralStatusDirectory

public static void setCentralStatusDirectory(java.lang.String path)
                                      throws java.io.IOException
Change the location of the central status directory.

Parameters:
path - the new directory path for central storage of status data
java.io.IOException

getCentralStatusDirectory

public static java.lang.String getCentralStatusDirectory()
Returns the location of the central status repository.


getDefaultStatusManager

public static FileBasedStatusManager getDefaultStatusManager()
Gets the default FileBasedStatusManager for this workstation.

Returns:
The default FileBasedStatusManager for this workstation.
See Also:
StatusMethod.DEFAULT, FileBasedStatusManager

getCentralStatusManager

public static FileBasedStatusManager getCentralStatusManager()
Gets a FileBasedStatusManager for managing status in the central location for this workstation.

Returns:
A FileBasedStatusManager for managing status in the central location for this workstation.
See Also:
StatusMethod.CENTRAL, FileBasedStatusManager

getPerFolderStatusManager

public static FileBasedStatusManager getPerFolderStatusManager()
Gets a FileBasedStatusManager for managing status on a per-folder basis.

Returns:
A FileBasedStatusManager for managing status in the central location for this workstation.
See Also:
StatusMethod.PER_FOLDER, FileBasedStatusManager

getStatusManagerForView

public static FileBasedStatusManager getStatusManagerForView(View view)
Gets the FileBasedStatusManager that manages file status information for the given View. The corresponding StarTeam Server must support client-managed status.

Returns:
The FileBasedStatusManager for the given View.
See Also:
SupportedFeatures.hasClientManagedFileStatus(), View.getFileStatusManager(), FileBasedStatusManager

getStatusManagerForViewId

public static FileBasedStatusManager getStatusManagerForViewId(int viewID,
                                                               java.lang.String serverGUID)
                                                        throws java.io.IOException
Gets the FileBasedStatusManager that manages file status information for the given View ID and Server ID.

Parameters:
viewID - the view's ID.
serverGUID - server's repository id (which is a GUID) in string form.
Returns:
The FileBasedStatusManager for the given View.
java.io.IOException
See Also:
View.getFileStatusManager(), FileBasedStatusManager

getSourceDirs

public static java.util.Enumeration getSourceDirs(java.io.File syncDirRoot)
                                           throws java.io.IOException
Given a root directory which contains centrally managed status data, this method will return an enumeration of all the local directory paths for which there is status data. The values in the enumeration will be String objects which are paths to local folders. The paths are in a platform independent format in which all directory delimiters are specified using the backslash (\) character.

Parameters:
syncDirRoot - the root of the centrally managed status directory
Returns:
an enumeration of all the local directory paths that have status information
java.io.IOException

deleteSyncDB

public static void deleteSyncDB(java.io.File syncDirRoot,
                                java.lang.String key)
Deletes all the status information for the specified directory path. The value for the "key" parameter must be a path in the proper format, one that would be returned from the getSourceDirs method.

Parameters:
syncDirRoot - the root of the centrally managed status directory
key - the platform independent directory path whose status will be deleted.

getSourceDirsCount

public static int getSourceDirsCount(java.io.File syncDirRoot)
Returns the number of local directories that the specified centrally managed status directory is maintaining.

Parameters:
syncDirRoot - the root of the centrally managed status directory
Returns:
the total number of local dirs that have status information

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class java.lang.Object
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class java.lang.Object
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.