org.xiruss.snapcm.api
Interface Snapshot

All Superinterfaces:
RepositoryObject
All Known Subinterfaces:
MutableSnapshot
All Known Implementing Classes:
MutableSnapshotBase, MutableSnapshotProxy, NullMutableSnapshot, NullSnapshot, SnapshotBase, SnapshotProxy

public interface Snapshot
extends RepositoryObject


Method Summary
 void checkIsNotFixed()
          Throws an exception is the snapshot is fixed.
 Branch getBranch()
           
 VersionByResourceMap getCreatedVersions()
           
 VersionByResourceMap getEffectiveVersions()
          Returns a copy of the effective versions map.
 VersionByResourceMap getExcludedVersions()
          Returns a copy of the excluded versions map.
 Snapshot getNext()
          Returns the snapshot that follows this one on the branch, if any.
 Snapshot getPrevious()
          Returns the previous snapshot on the snapshot's branch, if any.
 Version getVersion(Resource res)
          Given a resource, returns the version of that resource that has been created on or is effective on the snapshot.
 Version getVersionById(java.lang.String verKey)
           
 VersionMap getVersionsByPropertyValue(java.lang.String propertyName, java.lang.Object testValue)
          Returns the set of versions that exhibit the specified value for the specified property.
 VersionByResourceMap getVersionsByResource()
           
 long getVisibleVersionCount()
          Returns the number of versions that are visible on the snapshot.
 VersionByResourceMap getVisibleVersions()
          Returns a map of the versions visible on this snapshot.
 void initialize(MutableSnapshot baseSnapshot, java.lang.String objId, java.util.Date commitTime)
          Initialize a mutable or immutable snapshot using an existing snapshot as the base.
 boolean isFixed()
          If true, indicates that the snapshot is fixed and committed to the repository.
 boolean resourceIsVisible(Resource res)
           
 Snapshot setNext(Snapshot nextSnapshot)
           
 boolean versionIsVisible(java.lang.String versionId)
          Returns true if the specified version is visible on the snapshot, meaning that it is a created or effective version.
 boolean versionIsVisible(Version ver)
          Returns true if the specified version is visible on the snapshot, meaning that it is a created or effective version.
 
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(MutableSnapshot baseSnapshot,
                java.lang.String objId,
                java.util.Date commitTime)
                throws ObjectMutationException
Initialize a mutable or immutable snapshot using an existing snapshot as the base.

Parameters:
baseSnapshot - Snapshot to use as the initialization source.
objId - Object ID of the newly-created snapshot.
commitTime -
Throws:
ObjectMutationException

getPrevious

Snapshot getPrevious()
Returns the previous snapshot on the snapshot's branch, if any.

Returns:
The previous snapshot, or null if this is the first snapshot.

getVersion

Version getVersion(Resource res)
Given a resource, returns the version of that resource that has been created on or is effective on the snapshot. If the version is either explicitly excluded or simply not on the snapshot, returns null.

Parameters:
cd1Res -
Returns:

checkIsNotFixed

void checkIsNotFixed()
                     throws ObjectMutationException
Throws an exception is the snapshot is fixed. A snapshot becomes "fixed" (immutable) when it is committed to the repository. Before that time the snapshot and any created versions on it may be mutated without restriction.

Throws:
ObjectMutationException

getVersionsByPropertyValue

VersionMap getVersionsByPropertyValue(java.lang.String propertyName,
                                      java.lang.Object testValue)
Returns the set of versions that exhibit the specified value for the specified property.

Parameters:
propertyName - The name of the property to check.
testValue - The property value to check for.
Returns:
The set of versions that exhibit the property and value.

getVisibleVersions

VersionByResourceMap getVisibleVersions()
Returns a map of the versions visible on this snapshot.


isFixed

boolean isFixed()
If true, indicates that the snapshot is fixed and committed to the repository.

Returns:

getVersionById

Version getVersionById(java.lang.String verKey)
Parameters:
verKey - String key for a version
Returns:
The version, if visible on the snapshot, otherwise null.

getBranch

Branch getBranch()

getNext

Snapshot getNext()
Returns the snapshot that follows this one on the branch, if any.

Returns:
The next snapshot, or null if this is the last snapshot on the branch.

setNext

Snapshot setNext(Snapshot nextSnapshot)

getCreatedVersions

VersionByResourceMap getCreatedVersions()
Returns:

getEffectiveVersions

VersionByResourceMap getEffectiveVersions()
Returns a copy of the effective versions map. Effective versions are versions that were created on another snapshot and simply made visible on this snapshot. By default, when a new snapshot is created, all the versions of all the resources visible on the previous snapshot become effective versions of this snapshot.

Returns:

getExcludedVersions

VersionByResourceMap getExcludedVersions()
Returns a copy of the excluded versions map. Excluded versions are versions that were initially effective on this snapshot (see getEffectiveVersions) but where then marked as excluded from this snapshot, making them (and therefore their associated resources) no longer visible. Excluded versions will not be automatically made effective on the next snapshot in the branch. Versions that have been excluded can, of course, be re-added to subsequence snapshots on the branch.

Returns:

versionIsVisible

boolean versionIsVisible(java.lang.String versionId)
Returns true if the specified version is visible on the snapshot, meaning that it is a created or effective version.

Parameters:
versionId - ID of the version to check for
Returns:
True if the version is visible.

versionIsVisible

boolean versionIsVisible(Version ver)
Returns true if the specified version is visible on the snapshot, meaning that it is a created or effective version.

Parameters:
ver - The version to check for
Returns:
True if the version is visible.

resourceIsVisible

boolean resourceIsVisible(Resource res)

getVisibleVersionCount

long getVisibleVersionCount()
Returns the number of versions that are visible on the snapshot.

Returns:

getVersionsByResource

VersionByResourceMap getVersionsByResource()