wt.vc
Class StandardVersionControlService

java.lang.Object
  extended by wt.services.StandardManager
      extended by wt.vc.StandardVersionControlService
All Implemented Interfaces:
Serializable, NetFactor, wt.services.Manager, VersionControlService

public class StandardVersionControlService
extends StandardManager
implements VersionControlService, Serializable

Provides the standard implementation of server-side functionality as defined by the VersionControlService interface. This class is the one intended to be extended to enhance functionality.

As defined by the standard versioning service's access control rules, there are no constraints placed on the access of iterated/versioned objects. Furthermore, there are no constraints placed on the access of either mastered objects. Warning: direct manipulation or deletion of masters is currently unsupported. All functions should be carried out on iterated/versioned objects.

Event-based processing is performed on business objects asserted as being Iterated/Versioned during database storing, deletions, and full restorations. After a successful store, the versioning service listens to a dispatched event indicating that the store has completed and signals all other interested services that a new iteration exists. When a business object is being deleted from the database, the versioning service listens to a dispatched event indicating that the deletion is about to commence and vetos the deletion if the version is not the latest one (i.e., has no successor). Otherwise, it passes on vetoing the deletion. After a successful deletion, the versioning service listens to a dispatched event indicating that the delete has completed and deletes all of the version's iterations. If it turns out that the deleted version is the only one remaining related to a master then it gets deleted as well. When a business object is being fully restored from the database, the versioning service listens to a dispatched event indicating that the full restoration is beginning and restores the version cookie's predecessor reference, and restores the iteration cookie's creator, prececessor, and master references.

If the standard implementation is not desired then a custom implementation can extend from VersionControlService alongside the standard implementation, and be specified as a property to be used as the default versioning service.

Use the newStandardVersionControlService static factory method(s), not the StandardVersionControlService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
StandardManager, VersionControlServiceEvent, wt.fc.PersistenceManagerEvent.POST_STORE, wt.fc.PersistenceManagerEvent.PRE_DELETE, wt.fc.PersistenceManagerEvent.POST_DELETE, wt.fc.PersistenceManagerEvent.FULL_RESTORE, Serialized Form

Method Summary
 QueryResult allIterationsFrom(Iterated iteration)
          Finds all of the iterations to the very first one created from the given one.
 QueryResult allIterationsFrom(Iterated iteration, boolean includeDerivedFroms)
          Finds all of the iterations to the very first one created from the given one.
 QueryResult allIterationsFrom(Iterated iteration, boolean includeDerivedFroms, boolean filterTerminals)
          Finds all of the iterations to the very first one created from the given one.
 QueryResult allIterationsOf(Mastered master)
          Finds all of the iterations to the very first one created associated with the given master.
 QueryResult allIterationsOf(Mastered master, boolean filterTerminals)
          Finds all of the iterations to the very first one created associated with the given master.
 QueryResult allVersionsFrom(Versioned version)
          Finds all of the versions to the very first one created from the given version.
 QueryResult allVersionsOf(Mastered master)
          Finds all of the versions to the very first one created associated with the given master.
 QueryResult allVersionsOf(Versioned version)
          Finds all of the versions to the very first one created associated [via its master] with the given version.
 QueryResult allVersionsOf(WTCollection masters, Class versionClass)
          Finds all of the versions to the very first one created associated with the given collection of masters.
 void deleteIterations(Iterated beginIteration, Iterated endIteration)
          Deletes all iterations between beginIteration and endIteration of same version.
 void deleteIterations(WTCollection iterations, ConflictResolution[] resolvers)
          This is for deletion of selective iterations.
 void deleteIterations(WTCollection iterations, ConflictResolution[] resolvers, boolean changeModifyStamp)
          This is for deletion of selective iterations.
 String[] getAvailableVersionLabels(ObjectReference master, String versionLabel, ViewReference view, boolean onlySuccessors, int n)
          Return versions that are available to create new versions.
 Iterated getLatestIteration(Iterated iteration, boolean includeMarkedForDelete)
          Get the "latest" iteration in the same branch as the given one.
 WTValuedMap getLatestIterations(WTCollection iterations, boolean includeMarkedForDelete)
          Get the "latest" iteration in the same branch as the ones passed in the collection.
 String[] getNextCommonLabels(WTCollection version, int n)
          Given a collection of Versioned objects return the next n version labels that are valid for all versions.
 String[] getNextVersionLabels(Versioned version, int n)
          Get the series for the input version and return the next n valid version labels.
 String[] getNextVersionLabels(Versioned version, wt.lifecycle.LifeCycleTemplateReference lct, int n)
          Gets the next n version labels.
 boolean isFirstIteration(Iterated iteration)
          Tests if the given iteration is the first one in the version branch.
 QueryResult iterationsOf(Iterated iteration)
          Finds only the iterations directly associated with the given one.
 QueryResult iterationsOf(long branch, Class iteratedClass)
          Finds only the iterations directly associated with the given branch id.
 QueryResult iterationsOf(WTCollection iterations, Class iteratedClass, boolean includeLatest)
          Finds only the iterations directly associated with the given colletion of iterated objects.
 Versioned merge(Versioned srcVersion, Versioned destVersion, String note)
          Creates a new iteration of srcVersion and re-parents it as the latest iteration of destVersion.
 WTValuedMap merge(WTValuedMap sourceToDestinationsMap, String note)
          Multi-object form of merge operation.
 AdHocStringVersioned newAdHocStringVersion(AdHocStringVersioned version, String adHocVersionId)
          Creates a new in-line version with the given adHocVersionId assigned.
 Versioned newBranch(Versioned version)
          Makes a new branched version from the given one using it as a branch point, which may or may not be the "latest" iteration.
 Iterated newIteration(Iterated iteration, boolean copyAttributes)
          Makes a new iteration/version as a copy from the given one, and does not increment its identifiier.
 OneOffVersioned newOneOffVersion(OneOffVersioned version)
          Creates a new in-line version from the given version.
 Versioned newUncontrolledVersion(Versioned version)
          Makes a new version from the given version.
 Versioned newVersion(Versioned version)
          Makes a new in-lined version from the given version.
 Versioned newVersion(Versioned version, VersionIdentifier version_id, IterationIdentifier iteration_id)
          Makes a new in-lined version from the given version.
 Versionable newVersionable(Versionable version)
          API intended to be called internally by any API that intends to create a new version.
 WTList newVersionables(WTList versions)
          API intended to be called internally by any API that intends to create a new version.
 WTValuedMap newVersions(WTCollection versions)
          Makes a new in-lined version from the given version.
 WTValuedMap newVersions(WTKeyedMap versionMap)
          Makes a new in-lined version from the given version.
 Iterated predecessorOf(Iterated iteration)
          Finds the predecessor of the iteration.
 Iterated refresh(wt.vc.VersionForeignKey key)
          Retrieves a Iterated object given its VersionForeignKey.
 Iterated rollback(Iterated iteration, Iterated reversion)
          Deletes all iterations starting at the latest iteration in a version back to, but not including, a specified iteration in the same version.
 Iterated rollup(Iterated iteration, Iterated culmination)
          Deletes all iterations starting at the first iteration in a version up to, but not including, a specified iteration in the same version.
 Iterated supersede(Iterated iteration, Iterated replacement)
          Supersedes the first iteration with the other iteration.
 WTValuedMap supersede(WTValuedMap iterationReplacementMap)
          Supersedes each iteration passed as the key in the WTValuedMap with the corresponding iteration value in the WTValuedMap.
 
Methods inherited from class wt.services.StandardManager
getManagerService, getManagerStatus, getName, getStartupType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newBranch

public Versioned newBranch(Versioned version)
                    throws WTException,
                           VersionControlException,
                           WTPropertyVetoException
Makes a new branched version from the given one using it as a branch point, which may or may not be the "latest" iteration. The newly branched version's identifier is moved to the next level to the right and reset. This method may only be called for objects that are Versioned and ViewManageable.

Supported API: true

Specified by:
newBranch in interface VersionControlService
Parameters:
version -
Returns:
Versioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersion

public Versioned newVersion(Versioned version)
                     throws WTException,
                            VersionControlException,
                            WTPropertyVetoException
Makes a new in-lined version from the given version. The newly in-lined version's identifier is incremented.

Supported API: true

Specified by:
newVersion in interface VersionControlService
Parameters:
version -
Returns:
Versioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersion

public Versioned newVersion(Versioned version,
                            VersionIdentifier version_id,
                            IterationIdentifier iteration_id)
                     throws WTException,
                            VersionControlException,
                            WTPropertyVetoException
Makes a new in-lined version from the given version. The newly in-lined version's version and iteration identifiers are set to the values passed in to this method..

Supported API: true

Specified by:
newVersion in interface VersionControlService
Parameters:
version -
version_id -
iteration_id -
Returns:
Versioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

newUncontrolledVersion

public Versioned newUncontrolledVersion(Versioned version)
                                 throws WTException,
                                        VersionControlException,
                                        WTPropertyVetoException
Makes a new version from the given version. The new version will not be placed into the version tree (i.e. the predecessor will not be set) nor will it's version and iteration identifiers be set. The expected use for this api is to build a version tree out of order via data loading, replication or other direct data creation means.

Supported API: true

Specified by:
newUncontrolledVersion in interface VersionControlService
Parameters:
version -
Returns:
Versioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

newAdHocStringVersion

public AdHocStringVersioned newAdHocStringVersion(AdHocStringVersioned version,
                                                  String adHocVersionId)
                                           throws WTException,
                                                  VersionControlException,
                                                  WTPropertyVetoException
Creates a new in-line version with the given adHocVersionId assigned.

Supported API: true

Specified by:
newAdHocStringVersion in interface VersionControlService
Parameters:
version -
adHocVersionId -
Returns:
AdHocStringVersioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

getNextCommonLabels

public String[] getNextCommonLabels(WTCollection version,
                                    int n)
                             throws VersionControlException,
                                    WTException
Given a collection of Versioned objects return the next n version labels that are valid for all versions.

Supported API: true

Specified by:
getNextCommonLabels in interface VersionControlService
Parameters:
version -
n -
Returns:
String[]
Throws:
VersionControlException
WTException

newOneOffVersion

public OneOffVersioned newOneOffVersion(OneOffVersioned version)
                                 throws WTException,
                                        VersionControlException,
                                        WTPropertyVetoException
Creates a new in-line version from the given version. When persisted, a one-off version identifier will be assigned to the object.

Supported API: true

Specified by:
newOneOffVersion in interface VersionControlService
Parameters:
version -
Returns:
OneOffVersioned
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersionable

public Versionable newVersionable(Versionable version)
                           throws WTException,
                                  VersionControlException,
                                  WTPropertyVetoException
API intended to be called internally by any API that intends to create a new version. It creates a new in-line version (with a new branch identifier), resets the iteration identifier, and assigns the version creator.

Supported API: true

Specified by:
newVersionable in interface VersionControlService
Parameters:
version -
Returns:
Versionable
Throws:
WTException
VersionControlException
WTPropertyVetoException

supersede

public Iterated supersede(Iterated iteration,
                          Iterated replacement)
                   throws WTException,
                          VersionControlException,
                          WTPropertyVetoException
Supersedes the first iteration with the other iteration. Also, the superseding iteration's identifier is incremented.

Supported API: true

Specified by:
supersede in interface VersionControlService
Parameters:
iteration -
replacement -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

rollback

public Iterated rollback(Iterated iteration,
                         Iterated reversion)
                  throws WTException,
                         VersionControlException,
                         WTPropertyVetoException
Deletes all iterations starting at the latest iteration in a version back to, but not including, a specified iteration in the same version. The iteration that is rolled back to (reversion) becomes the latest iteration. Returns the reversion if the operation is successful. If the two iterations involved in the rollback are identical null is returned.

Note: Since R3.0 rollback has changed its implementation from allowing a rollback between any two iterations, potentially from different versions, to the one described above.

It will throw conflict exception for branch point deletion if there exist iterations on successor branches.

Supported API: true

Specified by:
rollback in interface VersionControlService
Parameters:
iteration -
reversion -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

rollup

public Iterated rollup(Iterated iteration,
                       Iterated culmination)
                throws WTException,
                       VersionControlException,
                       WTPropertyVetoException
Deletes all iterations starting at the first iteration in a version up to, but not including, a specified iteration in the same version. The iteration that is rolled up to (culmination) becomes the first iteration. Returns the culmination if the operation is successful. If the two iterations involved in the rollup are identical null is returned.

Note: Since R3.0 rollup has changed its implementation from allowing a rollup between any two iterations, potentially from different versions, to the one described above.

It will throw conflict exception for branch point deletion if there exists iterations on successor branches.

Supported API: true

Specified by:
rollup in interface VersionControlService
Parameters:
iteration -
culmination -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

predecessorOf

public Iterated predecessorOf(Iterated iteration)
                       throws WTException,
                              VersionControlException,
                              PersistenceException
Finds the predecessor of the iteration.

Supported API: true

Specified by:
predecessorOf in interface VersionControlService
Parameters:
iteration -
Returns:
Iterated
Throws:
WTException
VersionControlException
PersistenceException

iterationsOf

public QueryResult iterationsOf(Iterated iteration)
                         throws WTException,
                                PersistenceException
Finds only the iterations directly associated with the given one. The result is an ordered list of iterations from the most recent one to the first one created for that version.

Supported API: true

Specified by:
iterationsOf in interface VersionControlService
Parameters:
iteration -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allIterationsOf

public QueryResult allIterationsOf(Mastered master)
                            throws WTException,
                                   PersistenceException
Finds all of the iterations to the very first one created associated with the given master. The result is an ordered list of iterations from the most recent one to the first one created for that version.

Supported API: true

Specified by:
allIterationsOf in interface VersionControlService
Parameters:
master -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allIterationsFrom

public QueryResult allIterationsFrom(Iterated iteration)
                              throws WTException,
                                     PersistenceException
Finds all of the iterations to the very first one created from the given one. The result is an ordered list of iterations from the given iteration to the first one created.

Supported API: true

Specified by:
allIterationsFrom in interface VersionControlService
Parameters:
iteration -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allVersionsOf

public QueryResult allVersionsOf(Versioned version)
                          throws WTException,
                                 PersistenceException
Finds all of the versions to the very first one created associated [via its master] with the given version. The result is an ordered list of versions (i.e., latest iterations) from the most recent one to the first one created.

Supported API: true

Specified by:
allVersionsOf in interface VersionControlService
Parameters:
version -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allVersionsOf

public QueryResult allVersionsOf(Mastered master)
                          throws WTException,
                                 PersistenceException
Finds all of the versions to the very first one created associated with the given master. The result is an ordered list of versions (i.e., latest iterations) from the most recent one to the first one created.

Supported API: true

Specified by:
allVersionsOf in interface VersionControlService
Parameters:
master -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allVersionsOf

public QueryResult allVersionsOf(WTCollection masters,
                                 Class versionClass)
                          throws WTException,
                                 PersistenceException
Finds all of the versions to the very first one created associated with the given collection of masters. The result is not an ordered list of versions.

Supported API: true

Specified by:
allVersionsOf in interface VersionControlService
Parameters:
masters -
versionClass -
Returns:
QueryResult
Throws:
WTException
PersistenceException

allVersionsFrom

public QueryResult allVersionsFrom(Versioned version)
                            throws WTException,
                                   PersistenceException
Finds all of the versions to the very first one created from the given version. The result is an ordered list of versions (i.e., latest iterations) from the given iteration to the first one created.

Supported API: true

Specified by:
allVersionsFrom in interface VersionControlService
Parameters:
version -
Returns:
QueryResult
Throws:
WTException
PersistenceException

isFirstIteration

public boolean isFirstIteration(Iterated iteration)
                         throws WTException,
                                VersionControlException
Tests if the given iteration is the first one in the version branch.

Supported API: true

Specified by:
isFirstIteration in interface VersionControlService
Parameters:
iteration -
Returns:
boolean
Throws:
WTException
VersionControlException

iterationsOf

public QueryResult iterationsOf(long branch,
                                Class iteratedClass)
                         throws WTException,
                                PersistenceException
Finds only the iterations directly associated with the given branch id. The result is an ordered list of iterations from the most recent one to the first one created for that version.

The branch id can uniquely identify a branch in a system based on its property of being unique since it's generated from the OID pool.



Supported API: true

Specified by:
iterationsOf in interface VersionControlService
Parameters:
branch -
iteratedClass -
Returns:
QueryResult
Throws:
WTException
PersistenceException

iterationsOf

public QueryResult iterationsOf(WTCollection iterations,
                                Class iteratedClass,
                                boolean includeLatest)
                         throws WTException,
                                PersistenceException
Finds only the iterations directly associated with the given colletion of iterated objects. The result is not an ordered list.

If the flag includeLatest is false then the latest iteration is not included in the resulted list of iterations.

Supported API: true

Specified by:
iterationsOf in interface VersionControlService
Parameters:
iterations -
iteratedClass -
includeLatest -
Returns:
QueryResult
Throws:
WTException
PersistenceException

merge

public Versioned merge(Versioned srcVersion,
                       Versioned destVersion,
                       String note)
                throws WTException,
                       WTPropertyVetoException
Creates a new iteration of srcVersion and re-parents it as the latest iteration of destVersion. The new iteration essentially has the business attributes of srcVersion and the administrative (and version label) attributes of destVersion. A MergeInfoLink is created between the new iteration and srcVersion.

Note that this class provides a multi-object equivalent of this method as well.

Supported API: true

Specified by:
merge in interface VersionControlService
Parameters:
srcVersion - the version to be merged from
destVersion - the version to be merged to
note - the iteration note to be assigned to the new iteration
Returns:
Versioned
Throws:
WTException
WTPropertyVetoException

merge

public WTValuedMap merge(WTValuedMap sourceToDestinationsMap,
                         String note)
                  throws WTException,
                         WTPropertyVetoException
Multi-object form of merge operation.

Returns map from source objects to newly formed "merged" iterations.

See comments on single-object merge operation for more details.

Supported API: true

Specified by:
merge in interface VersionControlService
Parameters:
sourceToDestinationsMap - map from merge sources to merge destinations
note - the iteration note to be assigned to the new iterations
Returns:
WTValuedMap
Throws:
WTException
WTPropertyVetoException

newIteration

public Iterated newIteration(Iterated iteration,
                             boolean copyAttributes)
                      throws WTException,
                             VersionControlException,
                             WTPropertyVetoException
Makes a new iteration/version as a copy from the given one, and does not increment its identifiier. Based on the boolean copyAttributes value, determines whether
are to be copied to the new object.

Supported API: true

Specified by:
newIteration in interface VersionControlService
Parameters:
iteration -
copyAttributes -
Returns:
Iterated
Throws:
WTException
VersionControlException
WTPropertyVetoException

getLatestIteration

public Iterated getLatestIteration(Iterated iteration,
                                   boolean includeMarkedForDelete)
                            throws WTException,
                                   VersionControlException
Get the "latest" iteration in the same branch as the given one. A check to see if the given iteration is the latest one is not made since it could be stale. Passing true for includeMarkedForDelete will attempt getting the latest iteratation even if marked for delete.

Supported API: true

Specified by:
getLatestIteration in interface VersionControlService
Parameters:
iteration -
includeMarkedForDelete -
Returns:
Iterated
Throws:
WTException
VersionControlException

deleteIterations

public void deleteIterations(Iterated beginIteration,
                             Iterated endIteration)
                      throws WTException,
                             VersionControlException,
                             WTPropertyVetoException
Deletes all iterations between beginIteration and endIteration of same version. Both beginIteration and endIteration will also get deleted. beginIteration should be chronologically smaller than endIteration. Also it will not delete all iterations in version, i.e., beginIteration can't be first of version and endIteration can't be latest of version simaltaneously.

Supported API: true

Specified by:
deleteIterations in interface VersionControlService
Parameters:
beginIteration -
endIteration -
Throws:
WTException
VersionControlException
WTPropertyVetoException

deleteIterations

public void deleteIterations(WTCollection iterations,
                             ConflictResolution[] resolvers)
                      throws WTException,
                             VersionControlException,
                             WTPropertyVetoException
This is for deletion of selective iterations. List of iterations can include iterations from different versions and different masters. It can throw conflict exception for branch point deletion if all iterations on successor branches are not selected for deletion. Also, conflict exception is thrown during deletion of latest iteration and decision for deletion of latest iteration is taken on basis of resolutions provided.

Supported API: true

Specified by:
deleteIterations in interface VersionControlService
Parameters:
iterations - WTCollection of all iterations to be deleted.
resolvers - Resolutions provided to resove oevrridable conflicts.
Throws:
WTException
VersionControlException
WTPropertyVetoException

getAvailableVersionLabels

public String[] getAvailableVersionLabels(ObjectReference master,
                                          String versionLabel,
                                          ViewReference view,
                                          boolean onlySuccessors,
                                          int n)
                                   throws VersionControlException,
                                          WTException
Return versions that are available to create new versions.

Supported API: true

Specified by:
getAvailableVersionLabels in interface VersionControlService
Parameters:
master -
versionLabel - If not null will use this as a starting point for returning version labels. I.e., if n=3 and versionLabel="E" input then { F, G, H } will be returned if they are not already used.
view -
onlySuccessors - If true will only return labels that are successors to the input versionLabel value.
n -
Returns:
String[]
Throws:
VersionControlException
WTException

supersede

public WTValuedMap supersede(WTValuedMap iterationReplacementMap)
                      throws WTException,
                             VersionControlException,
                             WTPropertyVetoException
Supersedes each iteration passed as the key in the WTValuedMap with the corresponding iteration value in the WTValuedMap. Also, each superseding iteration's identifier is incremented.

Supported API: true

Specified by:
supersede in interface VersionControlService
Parameters:
iterationReplacementMap -
Returns:
WTValuedMap
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersions

public WTValuedMap newVersions(WTCollection versions)
                        throws WTException,
                               VersionControlException,
                               WTPropertyVetoException
Makes a new in-lined version from the given version. The newly in-lined version's identifier is incremented.

Supported API: true

Specified by:
newVersions in interface VersionControlService
Parameters:
versions -
Returns:
WTValuedMap
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersions

public WTValuedMap newVersions(WTKeyedMap versionMap)
                        throws WTException,
                               VersionControlException,
                               WTPropertyVetoException
Makes a new in-lined version from the given version. The newly in-lined version's version and iteration identifiers are set to the values passed in to this method..

Supported API: true

Specified by:
newVersions in interface VersionControlService
Parameters:
versionMap -
Returns:
WTValuedMap
Throws:
WTException
VersionControlException
WTPropertyVetoException

newVersionables

public WTList newVersionables(WTList versions)
                       throws WTException,
                              VersionControlException,
                              WTPropertyVetoException
API intended to be called internally by any API that intends to create a new version. It creates a new in-line version (with a new branch identifier), resets the iteration identifier, and assigns the version creator.

Supported API: true

Specified by:
newVersionables in interface VersionControlService
Parameters:
versions -
Returns:
WTList
Throws:
WTException
VersionControlException
WTPropertyVetoException

refresh

public Iterated refresh(wt.vc.VersionForeignKey key)
                 throws WTException
Retrieves a Iterated object given its VersionForeignKey.

Supported API: true

Specified by:
refresh in interface VersionControlService
Parameters:
key -
Returns:
Iterated
Throws:
WTException

getLatestIterations

public WTValuedMap getLatestIterations(WTCollection iterations,
                                       boolean includeMarkedForDelete)
                                throws WTException,
                                       VersionControlException
Get the "latest" iteration in the same branch as the ones passed in the collection. A check to see if the given iteration is the latest one is not made since it could be stale. Passing true for includeMarkedForDelete will attempt getting the latest iteratation even if marked for delete. The WTValuedMap that is returned gives a mapping from the iterations passed to the latest iterations found, a null value is returned for any non-persistent iterations passed, and for any working copies passed the same working copy will be the value.

Supported API: true

Specified by:
getLatestIterations in interface VersionControlService
Parameters:
iterations -
includeMarkedForDelete -
Returns:
WTValuedMap
Throws:
WTException
VersionControlException

deleteIterations

public void deleteIterations(WTCollection iterations,
                             ConflictResolution[] resolvers,
                             boolean changeModifyStamp)
                      throws VersionControlException,
                             WTException,
                             WTPropertyVetoException
This is for deletion of selective iterations. List of iterations can include iterations from different versions and different masters. It can throw conflict exception for branch point deletion if all iterations on successor branches are not selected for deletion. Also, conflict exception is thrown during deletion of latest iteration and decision for deletion of latest iteration is taken on basis of resolutions provided.

Supported API: true

Specified by:
deleteIterations in interface VersionControlService
Parameters:
iterations - WTCollection of all iterations to be deleted.
resolvers - Resolutions provided to resove oevrridable conflicts.
changeModifyStamp - If true update modifyStamp when re-chaining iterations.
Throws:
VersionControlException
WTException
WTPropertyVetoException

getNextVersionLabels

public String[] getNextVersionLabels(Versioned version,
                                     wt.lifecycle.LifeCycleTemplateReference lct,
                                     int n)
                              throws VersionControlException,
                                     WTException
Gets the next n version labels. Looks up the version labels based on the specified LifeCycleTemplate and will not use the lifecycle template defined for version's container.

Supported API: true

Specified by:
getNextVersionLabels in interface VersionControlService
Parameters:
version - If a container is set will look up series for that container. If no container set will return zero length array.
lct - Assumes that the series to be defined will be the one defined for the first State in the LifeCycleTemplate. If null returns zero length array.
n -
Returns:
String[]
Throws:
VersionControlException
WTException

getNextVersionLabels

public String[] getNextVersionLabels(Versioned version,
                                     int n)
                              throws VersionControlException,
                                     WTException
Get the series for the input version and return the next n valid version labels. If the input version is persistent it will use the information on the version and return the next n labels from the version's current version label. If it's not persistent then the series will be looked up based on the container and lifecycle information on the object.

Supported API: true

Specified by:
getNextVersionLabels in interface VersionControlService
Parameters:
version -
n - number of labels to return
Returns:
String[]
Throws:
VersionControlException
WTException

allIterationsFrom

public QueryResult allIterationsFrom(Iterated iteration,
                                     boolean includeDerivedFroms)
                              throws VersionControlException,
                                     WTException
Finds all of the iterations to the very first one created from the given one. The result is an ordered list of iterations from the given iteration to the first one created that optionally includes information about derivedFrom values resulting from non-latest checkout/in operations.

Supported API: true

Specified by:
allIterationsFrom in interface VersionControlService
Parameters:
iteration -
includeDerivedFroms - If true then return a QueryResult where each element is a two-element array where element[0] = the previous iteration's predecessor element[1] = the previous iteration's derivedFrom if it is different than previous iteration's predecessor. If they are the same element[1] = null. If false then return a QueryResult containing the iterations ordered by predecessors.
Returns:
QueryResult
Throws:
VersionControlException
WTException

allIterationsFrom

public QueryResult allIterationsFrom(Iterated iteration,
                                     boolean includeDerivedFroms,
                                     boolean filterTerminals)
                              throws VersionControlException,
                                     WTException
Finds all of the iterations to the very first one created from the given one. The result is an ordered list of iterations from the given iteration to the first one created that optionally includes information about derivedFrom values resulting from non-latest checkout/in operations. If filterTerminals is true, all terminals (and any iterations on the same branch) will be removed from the result set.

Supported API: true

Specified by:
allIterationsFrom in interface VersionControlService
Parameters:
iteration -
includeDerivedFroms - If true then return a QueryResult where each element is a two-element array where element[0] = the previous iteration's predecessor element[1] = the previous iteration's derivedFrom if it is different than previous iteration's predecessor. If they are the same element[1] = null. If false then return a QueryResult containing the iterations ordered by predecessors.
filterTerminals -
Returns:
QueryResult
Throws:
VersionControlException
WTException

allIterationsOf

public QueryResult allIterationsOf(Mastered master,
                                   boolean filterTerminals)
                            throws WTException,
                                   PersistenceException
Finds all of the iterations to the very first one created associated with the given master. The result is an ordered list of iterations from the most recent one to the first one created for that version. If filterTerminals is true, all terminals (and any iterations on the same branch) will be removed from the result set.

Supported API: true

Specified by:
allIterationsOf in interface VersionControlService
Parameters:
master -
filterTerminals -
Returns:
QueryResult
Throws:
WTException
PersistenceException