com.ibm.ram.rich.core.scm
Class TeamContributor

java.lang.Object
  extended by com.ibm.ram.rich.core.scm.TeamContributor

public abstract class TeamContributor
extends java.lang.Object


Nested Class Summary
static interface TeamContributor.ReferenceProperties
           
 
Constructor Summary
TeamContributor()
           
 
Method Summary
 IResource[] checkinResources(IResource[] resourcesToCheckin, IProgressMonitor monitor)
          Checks-in provided resources and returns ones which were not able to be checked-in.
 TeamContributor.ReferenceProperties[] createArtifactReferences(IResource[] artifactResources, IResource assetModelResource, AssetInformation asset, IProgressMonitor monitor)
          Creates and returns the reference for the passed in asset.
 java.lang.String getReferenceKindName()
          Returns the reference kind name that a particular contributor uses.
 IResource[] getResourcesToCheckIn(IResource[] rootParentResources, IResource assetFileResource)
          Returns all the resources which are required to be checked in for the asset to be successfully submitted.
 TeamContributor.ReferenceProperties[] getSCMInfo(IResource[] resource, IProgressMonitor monitor)
          Return the SCM info for the given resources.
 IProject[] importAsProjects(boolean useCurrentBranch, boolean useOtherExistingBranch, boolean createNewBranch, java.lang.String branchName, Artifact[] scmArtifacts, boolean overwrite, Asset asset, IProgressMonitor monitor)
          Imports the given artifact as a project into the workspace.
 void removeExistingProject(IProject project, IProgressMonitor monitor)
          Removes the given project from the workspace.
 boolean supportsBranchCreation()
           
 boolean supportsBranchSelection()
           
 IStatus validateBranchName(java.lang.String branchName)
          Validates the given branch name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeamContributor

public TeamContributor()
Method Detail

removeExistingProject

public void removeExistingProject(IProject project,
                                  IProgressMonitor monitor)
                           throws SCMException
Removes the given project from the workspace. Each SCM contributor should delete the project if it is a SCM provider for that project. If not it should not delete it. If all contributors could not delete it, the default manager will try to delete it forcefully, and if not without force.

Parameters:
project -
monitor -
Throws:
SCMException

validateBranchName

public IStatus validateBranchName(java.lang.String branchName)
Validates the given branch name. Validation should be performed only if the contributor handles the reference kind of the artifacts. An IStatus#ERROR is returned if there is any problem. null should be returned if there are no validation problems.

Parameters:
scmArtifacts -
branchName -
Returns:

checkinResources

public IResource[] checkinResources(IResource[] resourcesToCheckin,
                                    IProgressMonitor monitor)
                             throws SCMException
Checks-in provided resources and returns ones which were not able to be checked-in.

Parameters:
resourcesToCheckin -
monitor -
part -
Throws:
SCMException

createArtifactReferences

public TeamContributor.ReferenceProperties[] createArtifactReferences(IResource[] artifactResources,
                                                                      IResource assetModelResource,
                                                                      AssetInformation asset,
                                                                      IProgressMonitor monitor)
                                                               throws SCMException
Creates and returns the reference for the passed in asset. The asset should not be modified. This should be done only when the asset is to be published

Parameters:
artifactResources -
assetModelResource -
asset -
monitor -
Returns:
Throws:
SCMException
See Also:
#canPublish(Artifact)

getSCMInfo

public TeamContributor.ReferenceProperties[] getSCMInfo(IResource[] resource,
                                                        IProgressMonitor monitor)
                                                 throws SCMException
Return the SCM info for the given resources. The core properties returned should always include three values defined:
  1. TEAM_SERVER: for the location of the SCM server
  2. TEAM_AREA: for the name of the high level project (not eclipse project) in the SCM. An example from Rational Team Concert might be a project name of "Rational Asset Manager"
  3. TEAM_TYPE: an identifier for the type of SCM. Recommended to use getReferenceKindName.

Parameters:
resource - the set of IResources to get SCM info for
monitor -
Returns:
the properties, or an empty array if the provider does not apply for these resources
Throws:
SCMException
Since:
7.1.1

getResourcesToCheckIn

public IResource[] getResourcesToCheckIn(IResource[] rootParentResources,
                                         IResource assetFileResource)
                                  throws SCMException
Returns all the resources which are required to be checked in for the asset to be successfully submitted.

Parameters:
rootParentResources -
assetFileResource -
Returns:
Throws:
SCMException

importAsProjects

public IProject[] importAsProjects(boolean useCurrentBranch,
                                   boolean useOtherExistingBranch,
                                   boolean createNewBranch,
                                   java.lang.String branchName,
                                   Artifact[] scmArtifacts,
                                   boolean overwrite,
                                   Asset asset,
                                   IProgressMonitor monitor)
                            throws SCMException
Imports the given artifact as a project into the workspace. This must be called after #canHandleReferenceKind(com.ibm.ram.defaultprofile.ReferenceKind) is valid. The contributor is responsibe for updating the reference of the artifact and children artifacts to point to to workspace relative locations.

Parameters:
useCurrentBranch -
createNewBranch -
useOtherExistingBranch -
branchName -
scmArtifacts -
overwrite -
asset - manifest provided for read-only information
monitor -
Throws:
SCMException

getReferenceKindName

public java.lang.String getReferenceKindName()
Returns the reference kind name that a particular contributor uses.

Returns:

supportsBranchCreation

public boolean supportsBranchCreation()
Returns:
true if the SCM contributor supports creation of branches, false otherwise.

supportsBranchSelection

public boolean supportsBranchSelection()
Returns:
true if the SCM contributor supports selection of branches. Contributors that have no concept of branching will return false.