|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.version.VersionManagerImplBase
public abstract class VersionManagerImplBase
The JCR Version Manager impementation is split in several classes in order to group related methods together.
this class provides basic routines for all operations and the methods related to checkin and checkout.
Nested Class Summary | |
---|---|
class |
VersionManagerImplBase.WriteOperation
Helper for managing write operations. |
Field Summary | |
---|---|
protected NodeId |
currentActivity
the node id of the current activity |
protected HierarchyManager |
hierMgr
hierarch manager that operates on the localte state manager |
protected NodeTypeRegistry |
ntReg
node type registry |
protected SessionImpl |
session
workspace session |
protected UpdatableItemStateManager |
stateMgr
item state manager for all workspace operations |
protected InternalVersionManager |
vMgr
the session version manager. |
Constructor Summary | |
---|---|
protected |
VersionManagerImplBase(SessionImpl session,
UpdatableItemStateManager stateMgr,
HierarchyManager hierMgr)
Creates a new version manager base for the given session |
Method Summary | |
---|---|
protected ISMLocking.ReadLock |
acquireReadLock()
acquires the read lock on this version manager. |
protected ISMLocking.WriteLock |
acquireWriteLock()
Acquires the write lock on this version manager. |
protected void |
checkModify(NodeImpl node,
int options,
int permissions)
Checks modify and permissions |
protected void |
checkModify(NodeStateEx state,
int options,
int permissions)
Checks modify and permissions |
protected NodeId |
checkoutCheckin(NodeStateEx state,
boolean checkin,
boolean checkout,
Calendar created)
Performs a checkin or checkout operation. |
protected boolean |
checkVersionable(NodeStateEx state)
Checks if the underlying node is versionable, i.e. |
protected InternalVersion |
getBaseVersion(NodeStateEx state)
Returns the internal base version for the underlying node. |
protected NodeId |
getBaseVersionId(NodeStateEx state)
Returns the node id of the base version, retrieved from the node state |
protected NodeStateEx |
getNodeStateEx(NodeId nodeId)
returns the node state for the given node id |
protected InternalVersion |
getVersion(Version v)
helper class that returns the internal version for a JCR one. |
protected InternalVersionHistory |
getVersionHistory(NodeStateEx state)
Returns the internal version history for the underlying node. |
protected boolean |
isCheckedOut(NodeStateEx state)
Determines the checked-out status of the given node state. |
protected String |
safeGetJCRPath(NodeStateEx state)
Returns the JCR path for the given node state without throwing an exception. |
VersionManagerImplBase.WriteOperation |
startWriteOperation()
Starts a write operation by acquiring the write lock and setting the item state manager to the "edit" state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SessionImpl session
protected final UpdatableItemStateManager stateMgr
protected final HierarchyManager hierMgr
protected final NodeTypeRegistry ntReg
protected final InternalVersionManager vMgr
protected NodeId currentActivity
Constructor Detail |
---|
protected VersionManagerImplBase(SessionImpl session, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
session
- workspace sesionstateMgr
- the underlying state managerhierMgr
- local hierarchy managerMethod Detail |
---|
protected NodeId checkoutCheckin(NodeStateEx state, boolean checkin, boolean checkout, Calendar created) throws RepositoryException
checkin
is
true
the node is checked in. if checkout
is
true
the node is checked out. if both flags are true
the checkin is performed prior to the checkout and the operation is
equivalent to a checkpoint operation.
state
- node statecheckin
- if true
the node is checked in.checkout
- if true
the node is checked out.created
- create time of the new version (if any),
or null
for the current time
null
for a pure
checkout.
RepositoryException
- if an error occursprotected boolean checkVersionable(NodeStateEx state) throws UnsupportedRepositoryOperationException, RepositoryException
state
- node state
true
if this node is full versionable, i.e. is
of nodetype mix:versionable
UnsupportedRepositoryOperationException
- if this node is not versionable at all
RepositoryException
protected String safeGetJCRPath(NodeStateEx state)
state
- node state
protected boolean isCheckedOut(NodeStateEx state) throws RepositoryException
state
- node state
RepositoryException
- if an error occursVersionManager.isCheckedOut(String)
,
Node.isCheckedOut()
protected NodeId getBaseVersionId(NodeStateEx state)
state
- node state
null
if not definedprotected InternalVersionHistory getVersionHistory(NodeStateEx state) throws RepositoryException
state
- node state
RepositoryException
- if an error occursprotected InternalVersion getVersion(Version v) throws RepositoryException
v
- the jcr version
RepositoryException
- if an error occursprotected InternalVersion getBaseVersion(NodeStateEx state) throws RepositoryException
state
- node state
RepositoryException
- if an error occursprotected NodeStateEx getNodeStateEx(NodeId nodeId) throws RepositoryException
nodeId
- the node id
RepositoryException
- if an error occursprotected void checkModify(NodeStateEx state, int options, int permissions) throws RepositoryException
state
- state to checkoptions
- options to checkpermissions
- permissions to check
RepositoryException
- if an error occursprotected void checkModify(NodeImpl node, int options, int permissions) throws RepositoryException
node
- node to checkoptions
- options to checkpermissions
- permissions to check
RepositoryException
- if an error occursprotected ISMLocking.WriteLock acquireWriteLock()
protected ISMLocking.ReadLock acquireReadLock()
public VersionManagerImplBase.WriteOperation startWriteOperation() throws RepositoryException
The pattern for using this method and the returned helper instance is:
WriteOperation operation = startWriteOperation(); try { ... operation.save(); // if everything is OK ... } catch (...) { ... } finally { operation.close(); }
RepositoryException
- if the write operation could not be started
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |