org.xiruss.snapcm.api
Interface MutableSnapshot

All Superinterfaces:
RepositoryObject, Snapshot
All Known Implementing Classes:
MutableSnapshotBase, MutableSnapshotProxy, NullMutableSnapshot

public interface MutableSnapshot
extends Snapshot

A Mutable snapshot is one that can be changed (i.e., a "sandbox") until such time as it is "fixed" (committed to the repository). Once a snapshot is fixed it becomes immutable.


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.
 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 interface org.xiruss.snapcm.api.Snapshot
checkIsNotFixed, getBranch, getCreatedVersions, getEffectiveVersions, getExcludedVersions, getNext, getPrevious, getVersion, getVersionById, getVersionsByPropertyValue, getVersionsByResource, getVisibleVersionCount, getVisibleVersions, initialize, isFixed, 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
 

Method Detail

initialize

void initialize(Branch br,
                java.lang.String objId,
                java.lang.String objName)
                throws ObjectMutationException
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.

Parameters:
br -
objId -
objName -
Throws:
ObjectMutationException

addCreatedVersion

void addCreatedVersion(Version ver)
                       throws SnapCMException
Adds a newly-created version to the snapshot.

Parameters:
ver - Version to add. The version must be new, meaning it is unfixed.
Throws:
VersionException
SnapshotException
SnapCMException

removeCreatedVersion

void removeCreatedVersion(Resource resource)
                          throws SnapCMException
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.

Parameters:
resource - Resource of the version to be removed.
Throws:
SnapCMException

removeCreatedVersion

void removeCreatedVersion(Version version)
                          throws SnapCMException
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.

Parameters:
version - Version to be removed.
Throws:
SnapCMException

setPreviousSnapshot

void setPreviousSnapshot(Snapshot snap)
Sets the previous snapshot. Can only be set if the snapshot is not fixed.

Parameters:
latest -

excludeVersion

void excludeVersion(java.lang.String versionId)
                    throws SnapshotException
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.

Parameters:
versionId - ID of the version to be excluded.
Throws:
SnapshotException - If version is neither effective nor created

setBranch

void setBranch(Branch branch)

addEffectiveVersion

void addEffectiveVersion(Version ver)
                         throws SnapshotException
Adds an effective version to the sandbox.

Parameters:
ver -
Throws:
SnapshotException