org.xiruss.xirussrepository.client
Class VersionProxy

java.lang.Object
  extended by org.xiruss.xirussrepository.client.RepositoryObjectProxy
      extended by org.xiruss.xirussrepository.client.VersionProxy
All Implemented Interfaces:
RepositoryObject, Version
Direct Known Subclasses:
OrganizerProxy, StorageObjectProxy

public class VersionProxy
extends RepositoryObjectProxy
implements Version


Field Summary
 
Fields inherited from class org.xiruss.xirussrepository.client.RepositoryObjectProxy
cHelper, logger, objectTypeCode, pathToMe
 
Constructor Summary
VersionProxy()
           
VersionProxy(XirussHttpApiClientHelper helper, org.w3c.dom.Element dataSource)
           
 
Method Summary
 void addDependency(DependencyLink dependency)
           
 void addNextVersion(Version ver)
          Adds a version as being a previous version of this version.
 void addPreviousVersion(Version ver)
          Adds a version as being a next version of this version.
 void checkIsNotFixed()
           
 void collectTargetVersions(VersionMap members, Snapshot onSnapshot, java.lang.String dependencyTypeName)
          Gets all the versions on which this version is dependent for a given dependency class.
 boolean dependsOn(Resource resource)
          Returns true if the version has one or more dependency relationships of any type to the specified resource.
 boolean dependsOn(Resource resource, java.lang.String dependencyTypeName)
          Returns true if the version has one or more dependency relationships to the specified resource.
 DependencyMap getDependencies()
          Returns the set of dependency
 DependencyMap getDependenciesByType(java.lang.String typeName)
          Returns a collection of dependencies of the specififed type, if any.
 VersionMap getNext()
          Gets the previous versions for this version.
protected  PathString getPathInSnapshotContext(SnapshotProxy snapshot)
           
 VersionMap getPrevious()
          Gets the previous versions for this version.
 Resource getResource()
           
protected  VersionMap getVersionMapValue(PathString path)
           
 void initialize(java.lang.String versionId, java.lang.String versionName, Resource res)
          Initialize the core properties of the version.
 void initialize(java.lang.String versionId, java.lang.String versionName, java.util.Set previousVersions, Resource res)
           
 void initialize(XirussHttpApiClientHelper helper, org.w3c.dom.Element dataSource)
           
 boolean isFixed()
           
protected  void loadVersionData(XirussHttpApiClientHelper helper, org.w3c.dom.Element dataSource)
           
 void setAsFixed()
          Sets the version as "fixed", meaning that it cannot be mutated further.
 void setPrevious(VersionMap previousVersions)
          Sets the previous versions for this version.
 
Methods inherited from class org.xiruss.xirussrepository.client.RepositoryObjectProxy
accept, compareTo, doPost, doStringReturnPost, equals, getBooleanValue, getId, getName, getOriginalClassName, getPathToMe, getProperties, getProperty, getPropertyNames, getRepository, getStringReturnValue, getStringSetReturnValue, getType, hasProperty, initialize, isNull, loadRepositoryObjectData, setId, setName, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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

VersionProxy

public VersionProxy(XirussHttpApiClientHelper helper,
                    org.w3c.dom.Element dataSource)
             throws XirussRepositoryException
Throws:
XirussRepositoryException

VersionProxy

public VersionProxy()
Method Detail

loadVersionData

protected void loadVersionData(XirussHttpApiClientHelper helper,
                               org.w3c.dom.Element dataSource)
                        throws XirussRepositoryException
Throws:
XirussRepositoryException

initialize

public void initialize(XirussHttpApiClientHelper helper,
                       org.w3c.dom.Element dataSource)
                throws XirussRepositoryException
Overrides:
initialize in class RepositoryObjectProxy
Throws:
XirussRepositoryException

initialize

public void initialize(java.lang.String versionId,
                       java.lang.String versionName,
                       Resource res)
                throws VersionMutationException
Description copied from interface: Version
Initialize the core properties of the version.

Specified by:
initialize in interface Version
Throws:
VersionMutationException

initialize

public void initialize(java.lang.String versionId,
                       java.lang.String versionName,
                       java.util.Set previousVersions,
                       Resource res)
                throws VersionMutationException
Specified by:
initialize in interface Version
Throws:
VersionMutationException

setAsFixed

public void setAsFixed()
Description copied from interface: Version
Sets the version as "fixed", meaning that it cannot be mutated further. This method also adds the version to the resource. While versions know what resource they are a version of, until they are committed to the repository, the resource doesn't know about the version.

Specified by:
setAsFixed in interface Version

isFixed

public boolean isFixed()
Specified by:
isFixed in interface Version

checkIsNotFixed

public void checkIsNotFixed()
                     throws VersionMutationException
Specified by:
checkIsNotFixed in interface Version
Throws:
VersionMutationException

addDependency

public void addDependency(DependencyLink dependency)
                   throws VersionMutationException
Specified by:
addDependency in interface Version
Throws:
VersionMutationException

getDependencies

public DependencyMap getDependencies()
Description copied from interface: Version
Returns the set of dependency

Specified by:
getDependencies in interface Version
Returns:

getDependenciesByType

public DependencyMap getDependenciesByType(java.lang.String typeName)
Description copied from interface: Version
Returns a collection of dependencies of the specififed type, if any.

Specified by:
getDependenciesByType in interface Version
Parameters:
typeName - The fully-qualified type name for the dependency (the Java class name for the dependency type.
Returns:
The set of dependencies of the specified type. May be empty.

getResource

public Resource getResource()
Specified by:
getResource in interface Version

dependsOn

public boolean dependsOn(Resource resource)
Description copied from interface: Version
Returns true if the version has one or more dependency relationships of any type to the specified resource.

Specified by:
dependsOn in interface Version
Returns:
Returns true if there are any dependencies.

dependsOn

public boolean dependsOn(Resource resource,
                         java.lang.String dependencyTypeName)
Description copied from interface: Version
Returns true if the version has one or more dependency relationships to the specified resource.

Specified by:
dependsOn in interface Version
dependencyTypeName - The name of the dependency type to check. If null, checks all dependency types.
Returns:
Returns true if there are any dependencies of the specified type.

getPrevious

public VersionMap getPrevious()
Description copied from interface: Version
Gets the previous versions for this version.

Specified by:
getPrevious in interface Version
Returns:
VersionMap of previous versions, if any.

getVersionMapValue

protected VersionMap getVersionMapValue(PathString path)

getNext

public VersionMap getNext()
Description copied from interface: Version
Gets the previous versions for this version.

Specified by:
getNext in interface Version
Returns:
VersionMapImpl of next versions, if any.

setPrevious

public void setPrevious(VersionMap previousVersions)
                 throws VersionMutationException
Description copied from interface: Version
Sets the previous versions for this version. Cannot be called once the version is fixed.

Specified by:
setPrevious in interface Version
Parameters:
previousVersions - Versionmap of previous versions.
Throws:
VersionMutationException

addPreviousVersion

public void addPreviousVersion(Version ver)
Description copied from interface: Version
Adds a version as being a next version of this version. Also adds the specified version as a previous version of this version. This can be done at any time, whether or not the versions involved are fixed.

Specified by:
addPreviousVersion in interface Version

addNextVersion

public void addNextVersion(Version ver)
Description copied from interface: Version
Adds a version as being a previous version of this version. Note that we can't add this version as a next version of the specified previous version at this time unless this version is fixed. That is, fixed versions cannot point to versions in mutable snapshots, at least as far as the invariant part of the repository is concerned. This normally happens when a version is created on a snapshot, although it could be done at other times.

Specified by:
addNextVersion in interface Version

collectTargetVersions

public void collectTargetVersions(VersionMap members,
                                  Snapshot onSnapshot,
                                  java.lang.String dependencyTypeName)
Description copied from interface: Version
Gets all the versions on which this version is dependent for a given dependency class.

Specified by:
collectTargetVersions in interface Version
Parameters:
members - The version map to which the target versions are added
onSnapshot - The snapshot on which to resolve the dependencies
dependencyTypeName - The class name of the dependency type

getPathInSnapshotContext

protected PathString getPathInSnapshotContext(SnapshotProxy snapshot)