org.xiruss.snapcm.api
Class NullMutableSnapshot

java.lang.Object
  extended by org.xiruss.snapcm.api.NullRepositoryObject
      extended by org.xiruss.snapcm.api.NullSnapshot
          extended by org.xiruss.snapcm.api.NullMutableSnapshot
All Implemented Interfaces:
MutableSnapshot, RepositoryObject, Snapshot

public class NullMutableSnapshot
extends NullSnapshot
implements MutableSnapshot

A null mutable snapshot.


Constructor Summary
NullMutableSnapshot()
           
 
Method Summary
 void addCreatedVersion(Version ver)
          Adds a newly-created version to the snapshot.
 void addEffectiveVersion(Version ver)
          Adds an effective version to the sandbox.
 void excludeVersion(java.lang.String versionId)
          Excludes the version from the set of visible versions on the snapshot.
 void initialize(Branch br, java.lang.String objId, java.lang.String objName)
          Initialize a newly-created mutable snapshot.
 boolean isFixed()
          If true, indicates that the snapshot is fixed and committed to the repository.
 void removeCreatedVersion(Resource resource)
          Removes the version for the specified resource from the created versions list.
 void removeCreatedVersion(Version version)
          Removes the version for the specified resource from the created versions list.
 void setBranch(Branch branch)
           
 void setPreviousSnapshot(Snapshot snap)
          Sets the previous snapshot.
 
Methods inherited from class org.xiruss.snapcm.api.NullSnapshot
checkIsNotFixed, getBranch, getCreatedVersions, getEffectiveVersions, getExcludedVersions, getNext, getPrevious, getType, getVersion, getVersionById, getVersionsByPropertyValue, getVersionsByResource, getVisibleVersionCount, getVisibleVersions, initialize, initialize, resourceIsVisible, setId, setNext, versionIsVisible, versionIsVisible
 
Methods inherited from class org.xiruss.snapcm.api.NullRepositoryObject
accept, compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, hasProperty, isNull, setName, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xiruss.snapcm.api.Snapshot
checkIsNotFixed, getBranch, getCreatedVersions, getEffectiveVersions, getExcludedVersions, getNext, getPrevious, getVersion, getVersionById, getVersionsByPropertyValue, getVersionsByResource, getVisibleVersionCount, getVisibleVersions, initialize, resourceIsVisible, setNext, versionIsVisible, versionIsVisible
 
Methods inherited from interface org.xiruss.snapcm.api.RepositoryObject
accept, compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, getType, hasProperty, initialize, isNull, setId, setName, setProperty, toString
 

Constructor Detail

NullMutableSnapshot

public NullMutableSnapshot()
Method Detail

isFixed

public boolean isFixed()
Description copied from interface: Snapshot
If true, indicates that the snapshot is fixed and committed to the repository.

Specified by:
isFixed in interface Snapshot
Overrides:
isFixed in class NullSnapshot
Returns:

initialize

public void initialize(Branch br,
                       java.lang.String objId,
                       java.lang.String objName)
                throws ObjectMutationException
Description copied from interface: MutableSnapshot
Initialize a newly-created mutable snapshot. The initial state of the created snapshot will reflect the state of the latest snapshot on the branch. Note that it's not meaningful to create a snapshot for a given branch from any snapshot other than the latest. If the desire is to use some older snapshot as a starting point, that requires creation of a new branch and sync operation from the starting snapshot of the starting branch to create the first fixed snapshot on the new branch, from which you then create a new mutable snapshot. It is the sync operation that determines the initial set of versions reflected in the new branch's initial snapshot. If the branch has no snapshots then the mutable snapshot has a starting state with no versions.

Specified by:
initialize in interface MutableSnapshot
Throws:
ObjectMutationException

addCreatedVersion

public void addCreatedVersion(Version ver)
                       throws SnapCMException
Description copied from interface: MutableSnapshot
Adds a newly-created version to the snapshot.

Specified by:
addCreatedVersion in interface MutableSnapshot
Parameters:
ver - Version to add. The version must be new, meaning it is unfixed.
Throws:
VersionException
SnapshotException
SnapCMException

removeCreatedVersion

public void removeCreatedVersion(Resource resource)
                          throws SnapCMException
Description copied from interface: MutableSnapshot
Removes the version for the specified resource from the created versions list. It is not an error to remove a version that is not in the list.

Specified by:
removeCreatedVersion in interface MutableSnapshot
Parameters:
resource - Resource of the version to be removed.
Throws:
SnapCMException

setPreviousSnapshot

public void setPreviousSnapshot(Snapshot snap)
Description copied from interface: MutableSnapshot
Sets the previous snapshot. Can only be set if the snapshot is not fixed.

Specified by:
setPreviousSnapshot in interface MutableSnapshot

excludeVersion

public void excludeVersion(java.lang.String versionId)
                    throws SnapshotException
Description copied from interface: MutableSnapshot
Excludes the version from the set of visible versions on the snapshot. The version may be an effective or created version; however, excluding a created version has the effect of removing it entirely from the snapshot, while an effective version will be listed in the excluded versions list. This reflects the fact that a version is not known to the repository until the snapshot is committed, so it would not make sense to keep a list of versions that were added and then removed from the snapshot before it was committed. That is, the repository does not itself maintain any record of the mutation history of a mutable snapshot before it is committed and made immutable.

Specified by:
excludeVersion in interface MutableSnapshot
Parameters:
versionId - ID of the version to be excluded.
Throws:
SnapshotException - If version is neither effective nor created

setBranch

public void setBranch(Branch branch)
Specified by:
setBranch in interface MutableSnapshot

addEffectiveVersion

public void addEffectiveVersion(Version ver)
Description copied from interface: MutableSnapshot
Adds an effective version to the sandbox.

Specified by:
addEffectiveVersion in interface MutableSnapshot

removeCreatedVersion

public void removeCreatedVersion(Version version)
                          throws SnapCMException
Description copied from interface: MutableSnapshot
Removes the version for the specified resource from the created versions list. It is not an error to remove a version that is not in the list.

Specified by:
removeCreatedVersion in interface MutableSnapshot
Parameters:
version - Version to be removed.
Throws:
SnapCMException