org.priha.version
Class VersionImpl

java.lang.Object
  extended by org.priha.core.ItemImpl
      extended by org.priha.core.NodeImpl
          extended by org.priha.version.VersionImpl
All Implemented Interfaces:
java.lang.Comparable<javax.jcr.Node>, javax.jcr.Item, javax.jcr.Node, javax.jcr.version.Version

public class VersionImpl
extends NodeImpl
implements javax.jcr.version.Version

Implements a JCR Version. The JCR specification is slightly ambiguous on whether a Version with no predecessors/successors should return an empty array, but we will return an empty array if no such beast exists.


Field Summary
 
Fields inherited from class org.priha.core.NodeImpl
m_cachedUUID
 
Fields inherited from class org.priha.core.ItemImpl
m_isNew, m_path, m_session
 
Constructor Summary
VersionImpl(SessionImpl session, Path path, QNodeType primaryType, QNodeDefinition nDef, boolean initDefaults)
           
 
Method Summary
 javax.jcr.version.VersionHistory getContainingHistory()
          
 java.util.Calendar getCreated()
          
 javax.jcr.version.Version[] getPredecessors()
          Priha returns a valid array unless there was something weird going on.
 javax.jcr.version.Version[] getSuccessors()
          Priha returns a valid array unless there was something weird going on.
 
Methods inherited from class org.priha.core.NodeImpl
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, compareTo, doneMerge, equals, findPropertyDefinition, getBaseVersion, getChildOrder, getChildProperty, getCorrespondingNodePath, getDefinition, getIndex, getLock, getMixinNodeTypes, getNode, getNode, getNode, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getPrimaryQNodeType, getProperties, getProperties, getProperty, getProperty, getQDefinition, getReferences, getUUID, getVersionHistory, hasNode, hasNode, hasNodes, hasProperties, hasProperty, hasProperty, hasTag, holdsLock, internalSave, isCheckedOut, isLocked, isLockedWithoutToken, isNode, isNodeType, lock, merge, orderBefore, preSave, remove, removeMixin, removeProperty, restore, restore, restore, restoreByLabel, sanitize, save, setChildOrder, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, tag, tag, unlock, update
 
Methods inherited from class org.priha.core.ItemImpl
accept, enterState, getAncestor, getCreationTime, getDepth, getInternalPath, getName, getParent, getPath, getPathReference, getQName, getSession, getState, hashCode, isModified, isNew, isSame, postSave, refresh, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jcr.Node
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, getBaseVersion, getCorrespondingNodePath, getDefinition, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperty, getReferences, getUUID, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, restore, restore, restore, restoreByLabel, 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
 

Constructor Detail

VersionImpl

public VersionImpl(SessionImpl session,
                   Path path,
                   QNodeType primaryType,
                   QNodeDefinition nDef,
                   boolean initDefaults)
            throws javax.jcr.ValueFormatException,
                   javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
Method Detail

getContainingHistory

public javax.jcr.version.VersionHistory getContainingHistory()
                                                      throws javax.jcr.RepositoryException

Specified by:
getContainingHistory in interface javax.jcr.version.Version
Throws:
javax.jcr.RepositoryException

getCreated

public java.util.Calendar getCreated()
                              throws javax.jcr.RepositoryException

Specified by:
getCreated in interface javax.jcr.version.Version
Throws:
javax.jcr.RepositoryException

getPredecessors

public javax.jcr.version.Version[] getPredecessors()
                                            throws javax.jcr.RepositoryException
Priha returns a valid array unless there was something weird going on. If there are no predecessors, an empty array is returned.

Specified by:
getPredecessors in interface javax.jcr.version.Version
Throws:
javax.jcr.RepositoryException

getSuccessors

public javax.jcr.version.Version[] getSuccessors()
                                          throws javax.jcr.RepositoryException
Priha returns a valid array unless there was something weird going on. If there are no successors, an empty array is returned.

Specified by:
getSuccessors in interface javax.jcr.version.Version
Throws:
javax.jcr.RepositoryException