org.priha.version
Class AbstractVersion

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

public class AbstractVersion
extends NodeImpl

Provides a common base class for both Version and VersionHistory and disable a number of write-methods.


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
AbstractVersion(SessionImpl session, Path path, QNodeType primaryType, QNodeDefinition def, boolean initDefaults)
           
 
Method Summary
 void addMixin(java.lang.String mixinName)
           
 NodeImpl addNode(java.lang.String relPath)
           
 NodeImpl addNode(java.lang.String relPath, java.lang.String primaryNodeTypeName)
           
 boolean canAddMixin(java.lang.String mixinName)
           
 void checkout()
           
 VersionImpl getBaseVersion()
           
 QLock.Impl getLock()
           
 Lock lock(boolean isDeep, boolean isSessionScoped)
           
 NodeIterator merge(java.lang.String srcWorkspace, boolean bestEffort)
           
protected  PropertyImpl prepareProperty(QName name, java.lang.Object value)
          Finds a property and checks if we're supposed to remove it or not.
protected  PropertyImpl prepareProperty(java.lang.String name, java.lang.Object value)
           
 void removeMixin(java.lang.String mixinName)
           
 void restore(java.lang.String versionName, boolean removeExisting)
           
 void restore(Version version, java.lang.String relPath, boolean removeExisting)
           
 void update(java.lang.String srcWorkspaceName)
           
 
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, remove, 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

AbstractVersion

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

addMixin

public void addMixin(java.lang.String mixinName)
              throws NoSuchNodeTypeException,
                     VersionException,
                     ConstraintViolationException,
                     LockException,
                     RepositoryException
Overrides:
addMixin in class NodeImpl
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

canAddMixin

public boolean canAddMixin(java.lang.String mixinName)
                    throws NoSuchNodeTypeException,
                           RepositoryException
Overrides:
canAddMixin in class NodeImpl
Throws:
NoSuchNodeTypeException
RepositoryException

checkout

public void checkout()
              throws UnsupportedRepositoryOperationException,
                     LockException,
                     RepositoryException
Overrides:
checkout in class NodeImpl
Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException

getLock

public QLock.Impl getLock()
                   throws UnsupportedRepositoryOperationException,
                          LockException,
                          AccessDeniedException,
                          RepositoryException
Overrides:
getLock in class NodeImpl
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException

lock

public Lock lock(boolean isDeep,
                 boolean isSessionScoped)
          throws UnsupportedRepositoryOperationException,
                 LockException,
                 AccessDeniedException,
                 InvalidItemStateException,
                 RepositoryException
Overrides:
lock in class NodeImpl
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException

merge

public NodeIterator merge(java.lang.String srcWorkspace,
                          boolean bestEffort)
                   throws NoSuchWorkspaceException,
                          AccessDeniedException,
                          MergeException,
                          LockException,
                          InvalidItemStateException,
                          RepositoryException
Overrides:
merge in class NodeImpl
Throws:
NoSuchWorkspaceException
AccessDeniedException
MergeException
LockException
InvalidItemStateException
RepositoryException

removeMixin

public void removeMixin(java.lang.String mixinName)
                 throws NoSuchNodeTypeException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException
Overrides:
removeMixin in class NodeImpl
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

restore

public void restore(java.lang.String versionName,
                    boolean removeExisting)
             throws VersionException,
                    ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException
Overrides:
restore in class NodeImpl
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

restore

public void restore(Version version,
                    java.lang.String relPath,
                    boolean removeExisting)
             throws PathNotFoundException,
                    ItemExistsException,
                    VersionException,
                    ConstraintViolationException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException
Overrides:
restore in class NodeImpl
Throws:
PathNotFoundException
ItemExistsException
VersionException
ConstraintViolationException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

update

public void update(java.lang.String srcWorkspaceName)
            throws NoSuchWorkspaceException,
                   AccessDeniedException,
                   LockException,
                   InvalidItemStateException,
                   RepositoryException
Overrides:
update in class NodeImpl
Throws:
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException

prepareProperty

protected PropertyImpl prepareProperty(QName name,
                                       java.lang.Object value)
                                throws PathNotFoundException,
                                       RepositoryException
Description copied from class: NodeImpl
Finds a property and checks if we're supposed to remove it or not. It also creates the property if it does not exist. The property value itself is empty until the property is loaded with loadValue()

Overrides:
prepareProperty in class NodeImpl
Returns:
Throws:
PathNotFoundException
RepositoryException

prepareProperty

protected PropertyImpl prepareProperty(java.lang.String name,
                                       java.lang.Object value)
                                throws PathNotFoundException,
                                       RepositoryException
Overrides:
prepareProperty in class NodeImpl
Throws:
PathNotFoundException
RepositoryException

getBaseVersion

public VersionImpl getBaseVersion()
                           throws UnsupportedRepositoryOperationException,
                                  RepositoryException
Overrides:
getBaseVersion in class NodeImpl
Throws:
UnsupportedRepositoryOperationException
RepositoryException

addNode

public NodeImpl addNode(java.lang.String relPath,
                        java.lang.String primaryNodeTypeName)
                 throws ItemExistsException,
                        PathNotFoundException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException
Overrides:
addNode in class NodeImpl
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException

addNode

public NodeImpl addNode(java.lang.String relPath)
                 throws ItemExistsException,
                        PathNotFoundException,
                        NoSuchNodeTypeException,
                        LockException,
                        VersionException,
                        ConstraintViolationException,
                        RepositoryException
Overrides:
addNode in class NodeImpl
Throws:
ItemExistsException
PathNotFoundException
NoSuchNodeTypeException
LockException
VersionException
ConstraintViolationException
RepositoryException