com.starteam
Class StatusMethod

java.lang.Object
  extended by com.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 status information moved to the client. There are two ways in which that status information can be stored. These are referred 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 down side 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 down side 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. Additionally, users may override this on a per-View basis.

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

Nested Class Summary
static class StatusMethod.FileStatus
          A FileStatus represents a combination of a file name and its status information from the status database (syncdb) on disk.
 
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.
static StatusMethod WORKSPACE
          Identifies a "Custom" central 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.
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()
          Gets the display name for this StatusMethod.
 java.lang.String getName()
          Gets the internal name for this StatusMethod.
static FileBasedStatusManager getPerFolderStatusManager()
          Gets a FileBasedStatusManager for managing status on a per-folder basis.
static java.lang.String[] 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 StatusMethod.FileStatus[] getStatusInformation(java.lang.String path)
          Given a directory path for which there is centrally managed status data, return the collection of all FileStatuses representing cached status data for files in this path
static FileBasedStatusManager getStatusManager(View view)
          Gets the FileBasedStatusManager that manages file status information for the given View.
static FileBasedStatusManager getStatusManager(View view, GUID serverGUID)
          Gets the FileBasedStatusManager that manages file status information for the given View and Server ID.
static FileBasedStatusManager getWorkspaceStatusManager(java.lang.String path)
          Gets a FileBasedStatusManager for managing status on a workspace basis.
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()
          Returns the string representation for this status method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, 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.


WORKSPACE

public static final StatusMethod WORKSPACE
Identifies a "Custom" central status management method. The user specifies the location of the underlying status manager

Method Detail

getDisplayName

public java.lang.String getDisplayName()
Gets the display name for this StatusMethod.

Returns:
A display name for this StatusMethod.

getName

public java.lang.String getName()
Gets the internal name for this StatusMethod.

Returns:
The internal name of this StatusMethod.

toString

public java.lang.String toString()
Returns the string representation for this status method

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
Throws:
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 on a per-folder basis for this workstation.
See Also:
StatusMethod.PER_FOLDER, FileBasedStatusManager

getWorkspaceStatusManager

public static FileBasedStatusManager getWorkspaceStatusManager(java.lang.String path)
Gets a FileBasedStatusManager for managing status on a workspace basis.

Parameters:
path - the fully qualified path to the workspace
Returns:
A FileBasedStatusManager for managing status in a workspace location on this workstation.
See Also:
StatusMethod.WORKSPACE, FileBasedStatusManager

getStatusManager

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

Parameters:
view - the view whose status manager is requested
Returns:
The FileBasedStatusManager for the given View.
See Also:
View.getFileStatusManager(), FileBasedStatusManager

getStatusManager

public static FileBasedStatusManager getStatusManager(View view,
                                                      GUID serverGUID)
                                               throws java.io.IOException
Gets the FileBasedStatusManager that manages file status information for the given View and Server ID.

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

getSourceDirs

public static java.lang.String[] 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
Throws:
java.io.IOException
See Also:
StatusMethod.getSourceDirsCount(java.io.File)

getStatusInformation

public static StatusMethod.FileStatus[] getStatusInformation(java.lang.String path)
                                                      throws java.io.IOException
Given a directory path for which there is centrally managed status data, return the collection of all FileStatuses representing cached status data for files in this path

Parameters:
path - a directory path for which there is status data
Returns:
a collection of all FileStatuses representing cached status data
Throws:
java.io.IOException
See Also:
StatusMethod.getSourceDirs(java.io.File)

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. This method is optimized to walk just the directory lists so that the algorithm takes a fraction of the time taken by a call to StatusMethod.getSourceDirs(java.io.File)

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


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.