org.priha.version
Class VersionHistoryImpl

java.lang.Object
  extended by org.priha.core.ItemImpl
      extended by org.priha.core.NodeImpl
          extended by org.priha.version.AbstractVersion
              extended by org.priha.version.VersionHistoryImpl
All Implemented Interfaces:
java.lang.Comparable<Node>

public class VersionHistoryImpl
extends AbstractVersion


Field Summary
 
Fields inherited from class org.priha.core.NodeImpl
m_cachedUUID, Q_PRIHA_TMPMOVE
 
Fields inherited from class org.priha.core.ItemImpl
m_isNew, m_path, m_session
 
Constructor Summary
VersionHistoryImpl(SessionImpl session, Path path, QNodeType primaryType, QNodeDefinition nDef, boolean initDefaults)
           
 
Method Summary
 void addVersionLabel(java.lang.String versionName, java.lang.String label, boolean moveLabel)
          Adds a Version Label.
 VersionIterator getAllVersions()
           
static VersionHistoryImpl getInstance(SessionImpl session, Path path)
           
 Version getRootVersion()
           
 Version getVersion(java.lang.String versionName)
           
 java.lang.String getVersionableUUID()
           
 Version getVersionByLabel(java.lang.String versionLabel)
           
 java.lang.String[] getVersionLabels()
           
 java.lang.String[] getVersionLabels(Version v)
           
 boolean hasVersionLabel(java.lang.String label)
           
 boolean hasVersionLabel(Version version, java.lang.String label)
           
 void remove()
          
 void removeVersion(java.lang.String arg0)
           
 void removeVersionLabel(java.lang.String label)
           
 
Methods inherited from class org.priha.version.AbstractVersion
addMixin, addNode, addNode, canAddMixin, checkout, getBaseVersion, getLock, lock, merge, prepareProperty, prepareProperty, removeMixin, restore, restore, update
 
Methods inherited from class org.priha.core.NodeImpl
cancelMerge, checkin, compareTo, doneMerge, equals, findPropertyDefinition, getChildOrder, getChildProperty, getCorrespondingNodePath, getDefinition, getIndex, getMixinNodeTypes, getNode, getNode, getNode, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getPrimaryQNodeType, getProperties, getProperties, getProperty, getProperty, getQDefinition, getReferences, getUUID, getVersionHistory, hasMixinType, hasNode, hasNode, hasNodes, hasProperties, hasProperty, hasProperty, hasTag, holdsLock, internalSave, isCheckedOut, isLocked, isLockedWithoutToken, isNode, isNodeType, orderBefore, preSave, removeNodeOnly, removeProperty, restoreByLabel, sanitize, save, setChildOrder, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, tag, tag, unlock
 
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
 

Constructor Detail

VersionHistoryImpl

public VersionHistoryImpl(SessionImpl session,
                          Path path,
                          QNodeType primaryType,
                          QNodeDefinition nDef,
                          boolean initDefaults)
                   throws ValueFormatException,
                          VersionException,
                          LockException,
                          ConstraintViolationException,
                          RepositoryException
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException
Method Detail

getInstance

public static VersionHistoryImpl getInstance(SessionImpl session,
                                             Path path)
                                      throws RepositoryException
Throws:
RepositoryException

addVersionLabel

public void addVersionLabel(java.lang.String versionName,
                            java.lang.String label,
                            boolean moveLabel)
                     throws VersionException,
                            RepositoryException
Adds a Version Label. The labels are stored as Properties of the VersionHistory's "jcr:versionLabels" Node. Each Property is named

Throws:
VersionException
RepositoryException

getAllVersions

public VersionIterator getAllVersions()
                               throws RepositoryException
Throws:
RepositoryException

getRootVersion

public Version getRootVersion()
                       throws RepositoryException
Throws:
RepositoryException

getVersion

public Version getVersion(java.lang.String versionName)
                   throws VersionException,
                          RepositoryException
Throws:
VersionException
RepositoryException

getVersionByLabel

public Version getVersionByLabel(java.lang.String versionLabel)
                          throws RepositoryException
Throws:
RepositoryException

getVersionLabels

public java.lang.String[] getVersionLabels()
                                    throws RepositoryException
Throws:
RepositoryException

getVersionLabels

public java.lang.String[] getVersionLabels(Version v)
                                    throws VersionException,
                                           RepositoryException
Throws:
VersionException
RepositoryException

getVersionableUUID

public java.lang.String getVersionableUUID()
                                    throws RepositoryException
Throws:
RepositoryException

hasVersionLabel

public boolean hasVersionLabel(java.lang.String label)
                        throws RepositoryException
Throws:
RepositoryException

hasVersionLabel

public boolean hasVersionLabel(Version version,
                               java.lang.String label)
                        throws VersionException,
                               RepositoryException
Throws:
VersionException
RepositoryException

removeVersion

public void removeVersion(java.lang.String arg0)
                   throws ReferentialIntegrityException,
                          AccessDeniedException,
                          UnsupportedRepositoryOperationException,
                          VersionException,
                          RepositoryException
Throws:
ReferentialIntegrityException
AccessDeniedException
UnsupportedRepositoryOperationException
VersionException
RepositoryException

remove

public void remove()
            throws VersionException,
                   LockException,
                   ConstraintViolationException,
                   RepositoryException
Description copied from class: ItemImpl

Overrides:
remove in class NodeImpl
Throws:
VersionException
LockException
ConstraintViolationException
RepositoryException

removeVersionLabel

public void removeVersionLabel(java.lang.String label)
                        throws VersionException,
                               RepositoryException
Throws:
VersionException
RepositoryException