|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.version.VersionManagerImpl
public class VersionManagerImpl
This Class implements a VersionManager.
| Nested Class Summary | |
|---|---|
static class |
VersionManagerImpl.DynamicESCFactory
|
| Field Summary | |
|---|---|
protected NodeStateEx |
historyRoot
Persistent root node of the version histories. |
protected NodeTypeRegistry |
ntReg
Node type registry. |
protected LocalItemStateManager |
stateMgr
State manager for the version storage. |
| Constructor Summary | |
|---|---|
VersionManagerImpl(PersistenceManager pMgr,
FileSystem fs,
NodeTypeRegistry ntReg,
DelegatingObservationDispatcher obsMgr,
NodeId rootId,
NodeId rootParentId,
ItemStateCacheFactory cacheFactory,
ISMLocking ismLocking)
Creates a new version manager |
|
| 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 java.lang.String |
calculateCheckinVersionName(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
NodeImpl node)
Calculates the name of the new version that will be created by a checkin call. |
protected InternalVersion |
checkin(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
NodeImpl node)
Checks in a node |
javax.jcr.version.Version |
checkin(NodeImpl node)
invokes the checkin() on the persistent version manager and remaps the newly created version objects. |
void |
close()
Close this version manager. |
protected InternalVersionItem |
createInternalVersionItem(NodeId id)
Creates an InternalVersionItem based on the NodeState
identified by id. |
protected VersionItemStateManager |
createItemStateManager(PersistenceManager pMgr,
NodeId rootId,
NodeTypeRegistry ntReg,
ItemStateCacheFactory cacheFactory,
ISMLocking ismLocking)
Creates a VersionItemStateManager or derivative. |
protected VersionHistoryInfo |
createVersionHistory(javax.jcr.Session session,
NodeState node)
Creates a new version history. |
void |
externalUpdate(ChangeLog changes,
java.util.List events)
Handle an external update. |
VersionManagerImpl.DynamicESCFactory |
getEscFactory()
Returns the event state collection factory. |
protected InternalVersionItem |
getItem(NodeId id)
Returns the item with the given persistent id. |
PersistenceManager |
getPersistenceManager()
Return the persistence manager. |
protected SharedItemStateManager |
getSharedStateMgr()
Return the shared item state manager. |
InternalVersion |
getVersion(NodeId id)
Returns the version with the given id |
InternalVersionHistory |
getVersionHistory(NodeId id)
Returns the version history with the given id |
VersionHistoryInfo |
getVersionHistory(javax.jcr.Session session,
NodeState node)
Returns information about the version history of the specified node. |
VirtualItemStateProvider |
getVirtualItemStateProvider()
returns the virtual item state provider that exposes the internal versions as items. |
boolean |
hasItem(NodeId id)
Return a flag indicating if the item specified exists. |
protected boolean |
hasItemReferences(InternalVersionItem item)
Checks if there are item references (from outside the version storage) that reference the given version item. |
protected void |
itemDiscarded(InternalVersionItem item)
Invoked by the internal version item itself, when it's underlying persistence state was discarded. |
void |
itemsUpdated(java.util.Collection items)
Invoked by some external source to indicate that some items in the versions tree were updated. |
protected void |
removeVersion(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
Name name)
Removes the specified version from the history |
void |
removeVersion(javax.jcr.version.VersionHistory history,
Name name)
Removes the specified version from the given version history. |
void |
setEventChannel(UpdateEventChannel eventChannel)
Set an event channel to inform about updates. |
protected InternalVersion |
setVersionLabel(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
Name version,
Name label,
boolean move)
Set version label on the specified version. |
javax.jcr.version.Version |
setVersionLabel(javax.jcr.version.VersionHistory history,
Name version,
Name label,
boolean move)
Sets the version label to the given version. |
void |
stateCreated(ItemState created)
Called when an ItemState has successfully
been created (i.e. |
void |
stateDestroyed(ItemState destroyed)
Called when an ItemState has successfully been
removed (i.e. |
void |
stateDiscarded(ItemState discarded)
Called when an ItemState has been discarded (i.e. |
void |
stateModified(ItemState modified)
Called when an ItemState has successfully
been modified (i.e. |
protected void |
versionCreated(InternalVersion version)
Invoked when a new internal item has been created. |
protected void |
versionDestroyed(InternalVersion version)
Invoked when a new internal item has been destroyed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected LocalItemStateManager stateMgr
protected final NodeTypeRegistry ntReg
protected NodeStateEx historyRoot
| Constructor Detail |
|---|
public VersionManagerImpl(PersistenceManager pMgr,
FileSystem fs,
NodeTypeRegistry ntReg,
DelegatingObservationDispatcher obsMgr,
NodeId rootId,
NodeId rootParentId,
ItemStateCacheFactory cacheFactory,
ISMLocking ismLocking)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException| Method Detail |
|---|
public VirtualItemStateProvider getVirtualItemStateProvider()
getVirtualItemStateProvider in interface VersionManagerpublic PersistenceManager getPersistenceManager()
public void close()
throws java.lang.Exception
close in interface VersionManagerjava.lang.Exception - if an error occurspublic VersionManagerImpl.DynamicESCFactory getEscFactory()
protected VersionHistoryInfo createVersionHistory(javax.jcr.Session session,
NodeState node)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptiongetVersionHistory(Session, NodeState)public boolean hasItem(NodeId id)
id - the id of the item
true if the item exists;
false otherwise
protected InternalVersionItem getItem(NodeId id)
throws javax.jcr.RepositoryException
id - the id of the item
javax.jcr.RepositoryException - if an error occurs
public javax.jcr.version.Version checkin(NodeImpl node)
throws javax.jcr.RepositoryException
checkin in interface VersionManagerjavax.jcr.RepositoryException
public void removeVersion(javax.jcr.version.VersionHistory history,
Name name)
throws javax.jcr.version.VersionException,
javax.jcr.RepositoryException
removeVersion in interface VersionManagerjavax.jcr.RepositoryException
javax.jcr.version.VersionException
public javax.jcr.version.Version setVersionLabel(javax.jcr.version.VersionHistory history,
Name version,
Name label,
boolean move)
throws javax.jcr.RepositoryException
label to the given version.
If the label is already assigned to another version, a VersionException is
thrown unless move is true. If version
is null, the label is removed from the respective version.
In either case, the version the label was previously assigned is returned,
or null of the label was not moved.
This method must not be synchronized since it could cause deadlocks with
item-reading listeners in the observation thread.
setVersionLabel in interface VersionManagerjavax.jcr.RepositoryExceptionpublic void itemsUpdated(java.util.Collection items)
items - items updatedpublic void setEventChannel(UpdateEventChannel eventChannel)
eventChannel - event channelprotected void itemDiscarded(InternalVersionItem item)
protected boolean hasItemReferences(InternalVersionItem item)
throws javax.jcr.RepositoryException
item - version item
true if there are item references from outside the
version storage; false otherwise.
javax.jcr.RepositoryException - if an error occurs while reading from the
repository.protected SharedItemStateManager getSharedStateMgr()
protected VersionItemStateManager createItemStateManager(PersistenceManager pMgr,
NodeId rootId,
NodeTypeRegistry ntReg,
ItemStateCacheFactory cacheFactory,
ISMLocking ismLocking)
throws ItemStateException
VersionItemStateManager or derivative.
pMgr - persistence managerrootId - root node idntReg - node type registrycacheFactory - cache factoryismLocking - the ISM locking implementation
ItemStateException - if an error occurspublic void stateCreated(ItemState created)
ItemState has successfully
been created (i.e. its underlying persistent state was created).
Not used.
stateCreated in interface ItemStateListenercreated - the ItemState that has been 'created'public void stateModified(ItemState modified)
ItemState has successfully
been modified (i.e. its underlying persistent state has changed).
Not used.
stateModified in interface ItemStateListenermodified - the ItemState that has been 'modified'public void stateDestroyed(ItemState destroyed)
ItemState has successfully been
removed (i.e. its underlying persistent state has been destroyed).
Remove item from cache on removal.
stateDestroyed in interface ItemStateListenerdestroyed - the ItemState that has been 'destroyed'public void stateDiscarded(ItemState discarded)
ItemState has been discarded (i.e. it has
been rendered 'invalid').
Not used.
stateDiscarded in interface ItemStateListenerdiscarded - the ItemState that has been discardedItemState.discard()
public void externalUpdate(ChangeLog changes,
java.util.List events)
throws javax.jcr.RepositoryException
externalUpdate in interface UpdateEventListenerchanges - external changes containing only node and property ids.events - events to deliver
javax.jcr.RepositoryException - if the update cannot be processed
public InternalVersion getVersion(NodeId id)
throws javax.jcr.RepositoryException
getVersion in interface VersionManagerjavax.jcr.RepositoryException
public InternalVersionHistory getVersionHistory(NodeId id)
throws javax.jcr.RepositoryException
getVersionHistory in interface VersionManagerjavax.jcr.RepositoryExceptionprotected ISMLocking.WriteLock acquireWriteLock()
protected ISMLocking.ReadLock acquireReadLock()
public VersionHistoryInfo getVersionHistory(javax.jcr.Session session,
NodeState node)
throws javax.jcr.RepositoryException
getVersionHistory in interface VersionManagernode - node whose version history should be returned
javax.jcr.RepositoryException - if an error occurs
protected InternalVersion checkin(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
NodeImpl node)
throws javax.jcr.RepositoryException
history - the version historynode - node to checkin
javax.jcr.RepositoryException - if an error occursNode.checkin()
protected java.lang.String calculateCheckinVersionName(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
NodeImpl node)
throws javax.jcr.RepositoryException
history - the version historynode - the node to checkin
javax.jcr.RepositoryException - if an error occurs.
protected void removeVersion(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
Name name)
throws javax.jcr.version.VersionException,
javax.jcr.RepositoryException
history - the version history from where to remove the version.name - the name of the version to remove.
javax.jcr.version.VersionException - if the version history does
not have a version with name.
javax.jcr.RepositoryException - if any other error occurs.
protected InternalVersion setVersionLabel(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
Name version,
Name label,
boolean move)
throws javax.jcr.RepositoryException
history - version historyversion - version namelabel - version labelmove - true to move from existing version;
false otherwise
javax.jcr.RepositoryException - if an error occursprotected void versionCreated(InternalVersion version)
version - internal version itemprotected void versionDestroyed(InternalVersion version)
version - internal version item
protected InternalVersionItem createInternalVersionItem(NodeId id)
throws javax.jcr.RepositoryException
InternalVersionItem based on the NodeState
identified by id.
id - the node id of the version item.
null if there is no node state
with the given id.
javax.jcr.RepositoryException - if an error occurs while reading from the
version storage.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||