com.togethersoft.openapi.vcs
Interface VcsProviderType


public interface VcsProviderType

This class defines a Version Control System provider and acts as a factory for VcsProvider instances. An implementation of VcsProviderType must register itself with VcsManager. VcsProviderType and VcsProvider are uniquely identified with ID.

Author:
TogetherSoft
Stereotype factory

Method Summary
 StringgetID()
           Returns a string which is a unique identifier of VcsProvider.
 StringgetProviderName()
           Returns descriptive name of the provider, for example: SCC provider: SourceSafe.
 StringgetValidProjectName(String rootProject, File rootWorkingDir, File workingDir)
           Returns project name valid for this provider which corresponds to working directory workingDir, given that project rootProject corresponds to root working directory rootWorkingDir.
 voidinitialize()
           Performs initialization of version control system.
 voidinvalidateAllProviders()
           Makes all so far created providers invalid.
 voidinvalidateProvider(VcsProvider provider)
           Invalidates specified provider.
 booleanisCommandSupportedForProject(String command)
           Returns tru if command is supported by this provider.
 booleanisCommandSupportsAdvancedOptions(String command)
           Returns true if this provider supports advanced options for command.
 booleanisInitialized()
           Returns true if this provider type is initialized.
 booleanisProjectNameValid(String project)
           Returns true if project is valid in context of this provider, that is doesn't contain illegal characters and has correct structure.
 booleanisProviderValid(VcsProvider provider)
           Returns true if this provider instance is valid with the provider type.
 VcsProvidernewVcsProvider()
           Creates new instance of VcsProvider.
 String[]supportedCommands()
           Returns the array of all commands supported by the provider.
 voidunInitialize()
           Uninitilizes version control.

Method Detail

getID

public String getID()
Returns a string which is a unique identifier of VcsProvider.
Returns: unique identifier for VcsProvider

getProviderName

public String getProviderName()
Returns descriptive name of the provider, for example: SCC provider: SourceSafe.
Returns: descriptive name of the provider

getValidProjectName

public String getValidProjectName(String rootProject, File rootWorkingDir, File workingDir)
throws VcsProviderException
Returns project name valid for this provider which corresponds to working directory workingDir, given that project rootProject corresponds to root working directory rootWorkingDir.
Parameters:
rootProject - project valid for this VcsProviderType corresponding to root working directory
rootWorkingDir - root working directory
workingDir - working directory to calculate valid project name for
Returns: true if project name project is valid

initialize

public void initialize()
throws VcsProviderException
Performs initialization of version control system. The version control should do all necessary initialization, such as finding and loading the DLL, logging on to the server and so on.
Parameters:
client - client for callback link to the calling system
offline - default offline mode
Returns: true of successful, false otherwise
throw VcsException in case of fatal error, such as script not found, etc

invalidateAllProviders

public void invalidateAllProviders()
Makes all so far created providers invalid.

invalidateProvider

public void invalidateProvider(VcsProvider provider)
Invalidates specified provider. An invalidated provider is not functional, its behaviour is not determined. The invalidated instance of VcsProvider must free all allocated resources and be prepared to garbage collection.
Parameters:
provider - provider instance to invalidate

isCommandSupportedForProject

public boolean isCommandSupportedForProject(String command)
Returns tru if command is supported by this provider.
Returns: true if command is supported for project operations, false otherwise

isCommandSupportsAdvancedOptions

public boolean isCommandSupportsAdvancedOptions(String command)
Returns true if this provider supports advanced options for command.
Returns: true if command supports advanced options, that is a call to VcsProvider.showAdvancedOptions with this command as parameter will not be ignored

isInitialized

public boolean isInitialized()
Returns true if this provider type is initialized.
Returns: true if the provider is initialized, false othrewise

isProjectNameValid

public boolean isProjectNameValid(String project)
Returns true if project is valid in context of this provider, that is doesn't contain illegal characters and has correct structure.
Returns: true if project name project is valid

isProviderValid

public boolean isProviderValid(VcsProvider provider)
Returns true if this provider instance is valid with the provider type.
Returns: true if provider instance is valid with the provider type

newVcsProvider

public VcsProvider newVcsProvider()
throws VcsProviderException
Creates new instance of VcsProvider.
Returns: new instance of VcsProvider interface

supportedCommands

public String[] supportedCommands()
Returns the array of all commands supported by the provider.
Returns: array of commands supported by the provider

unInitialize

public void unInitialize()
Uninitilizes version control. The version control should free all allocated resources, unload DLL, etc. A call to unInitiallize also invalidates all created instances of VcsProvider with same ID.