javax.jcr.version
Interface Version

All Superinterfaces:
Item, Node

public interface Version
extends Node

A Version object wraps an nt:version node. It provides convenient access to version information.


Field Summary
 
Fields inherited from interface javax.jcr.Node
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
 
Method Summary
 VersionHistory getContainingHistory()
          Returns the VersionHistory that contains this Version.
 java.util.Calendar getCreated()
          Returns the date this version was created.
 Node getFrozenNode()
          Returns the frozen node of this version.
 Version getLinearPredecessor()
          Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the predecessor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.
 Version getLinearSuccessor()
          Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the successor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.
 Version[] getPredecessors()
          In both simple and full versioning repositories, this method returns the predecessor versions of this version.
 Version[] getSuccessors()
          Returns the successor versions of this version.
 
Methods inherited from interface javax.jcr.Node
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, removeShare, removeSharedSet, restore, restore, restore, restoreByLabel, setPrimaryType, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
 
Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
 

Method Detail

getContainingHistory

VersionHistory getContainingHistory()
                                    throws RepositoryException
Returns the VersionHistory that contains this Version.

Returns:
the VersionHistory that contains this Version.
Throws:
RepositoryException - if an error occurs.

getCreated

java.util.Calendar getCreated()
                              throws RepositoryException
Returns the date this version was created. This corresponds to the value of the jcr:created property in the nt:version node that represents this version.

Returns:
a Calendar object
Throws:
RepositoryException - if an error occurs.

getLinearSuccessor

Version getLinearSuccessor()
                           throws RepositoryException
Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the successor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.

Note that under simple versioning the behavior of this method is equivalent to getting the unique successor (if any) of this version.

Returns:
a Version or null if no linear successor exists.
Throws:
RepositoryException - if an error occurs.
See Also:
VersionHistory.getAllLinearVersions()

getSuccessors

Version[] getSuccessors()
                        throws RepositoryException
Returns the successor versions of this version. This corresponds to returning all the nt:version nodes referenced by the jcr:successors multi-value property in the nt:version node that represents this version.

In a simple versioning repository this method

Returns:
a Version array.
Throws:
RepositoryException - if an error occurs.

getLinearPredecessor

Version getLinearPredecessor()
                             throws RepositoryException
Assuming that this Version object was acquired through a Workspace W and is within the VersionHistory H, this method returns the predecessor of this version along the same line of descent as is returned by H.getAllLinearVersions() where H was also acquired through W.

Note that under simple versioning the behavior of this method is equivalent to getting the unique predecessor (if any) of this version.

Returns:
a Version or null if no linear predecessor exists.
Throws:
RepositoryException - if an error occurs.
See Also:
VersionHistory.getAllLinearVersions()

getPredecessors

Version[] getPredecessors()
                          throws RepositoryException
In both simple and full versioning repositories, this method returns the predecessor versions of this version. This corresponds to returning all the nt:version nodes whose jcr:successors property includes a reference to the nt:version node that represents this version.

Returns:
a Version array.
Throws:
RepositoryException - if an error occurs.

getFrozenNode

Node getFrozenNode()
                   throws RepositoryException
Returns the frozen node of this version.

Returns:
a Node object
Throws:
RepositoryException - if an error occurs.
Since:
JCR 2.0