|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.version.AbstractVersionManager org.apache.jackrabbit.core.version.VersionManagerImpl
This Class implements a VersionManager.
Field Summary | |
protected org.apache.jackrabbit.core.version.NodeStateEx |
historyRoot
Persistent root node of the version histories. |
protected LocalItemStateManager |
stateMgr
State manager for the version storage. |
Constructor Summary | |
VersionManagerImpl(PersistenceManager pMgr,
NodeTypeRegistry ntReg,
DelegatingObservationDispatcher obsMgr,
NodeId rootId,
NodeId rootParentId)
Creates a bew vesuion manager |
Method Summary | |
protected InternalVersion |
checkin(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
NodeImpl node)
Checks in a node |
Version |
checkin(NodeImpl node)
invokes the checkin() on the persistent version manager and remaps the newly created version objects. This method must not be synchronized since it could cause deadlocks with item-reading listeners in the observation thread. |
void |
close()
Close this version manager. After having closed a persistence manager, further operations on this object are treated as illegal and throw |
EventStateCollection |
createEventStateCollection()
Creates an EventStateCollection .
This object uses one instance of a LocalItemStateManager
to update data on behalf of many sessions. |
VersionHistory |
createVersionHistory(Session session,
NodeState node)
Creates a new version history. This action is needed either when creating a new 'mix:versionable' node or when adding the 'mix:versionable' mixin to a node. This method must not be synchronized since it could cause deadlocks with item-reading listeners in the observation thread. |
protected InternalVersionItem |
getItem(NodeId id)
Returns the item with the given persistent id. Subclass responsibility. |
protected List |
getItemReferences(InternalVersionItem item)
Returns the item references that reference the given version item. Subclass responsiblity. |
InternalVersion |
getVersion(NodeId id)
Returns the version with the given id |
InternalVersionHistory |
getVersionHistory(NodeId id)
Returns the version history with the given id |
VersionHistory |
getVersionHistory(Session session,
NodeState node)
Returns the version history of the specified node or
null if the given node doesn't (yet) have an associated
version history. |
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. Subclass responsibility. |
boolean |
hasVersion(NodeId id)
Checks if the version with the given id exists |
boolean |
hasVersionHistory(NodeId id)
Checks if the version history with the given id exists |
void |
itemsUpdated(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,
QName name)
Removes the specified version from the history |
void |
removeVersion(VersionHistory history,
QName name)
Removes the specified version from the given version history. This method must not be synchronized since it could cause deadlocks with item-reading listeners in the observation thread. |
void |
setItemReferences(InternalVersionItem item,
List references)
{@inheritDoc} |
boolean |
setNodeReferences(NodeReferences refs)
|
protected InternalVersion |
setVersionLabel(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history,
QName version,
QName label,
boolean move)
Set version label on the specified version. |
Version |
setVersionLabel(VersionHistory history,
QName version,
QName label,
boolean move)
Sets the version 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. |
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 org.apache.jackrabbit.core.version.NodeStateEx historyRoot
Constructor Detail |
public VersionManagerImpl(PersistenceManager pMgr, NodeTypeRegistry ntReg, DelegatingObservationDispatcher obsMgr, NodeId rootId, NodeId rootParentId) throws RepositoryException
Method Detail |
public VirtualItemStateProvider getVirtualItemStateProvider()
getVirtualItemStateProvider
in interface VersionManager
public void close() throws Exception
close
in interface VersionManager
Exception
- if an error occurspublic VersionHistory createVersionHistory(Session session, NodeState node) throws RepositoryException
createVersionHistory
in interface VersionManager
node
-
RepositoryException
VersionManager.getVersionHistory(Session, NodeState)
public boolean hasItem(NodeId id)
id
- the id of the item
true
if the item exists;
false
otherwiseprotected InternalVersionItem getItem(NodeId id) throws RepositoryException
id
- the id of the item
RepositoryException
- if an error occurspublic Version checkin(NodeImpl node) throws RepositoryException
checkin
in interface VersionManager
node
-
RepositoryException
public void removeVersion(VersionHistory history, QName name) throws VersionException, RepositoryException
removeVersion
in interface VersionManager
history
- name
-
RepositoryException
VersionException
public Version setVersionLabel(VersionHistory history, QName version, QName label, boolean move) throws 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 VersionManager
history
- version
- label
- move
-
RepositoryException
public void itemsUpdated(Collection items)
items
- items updatedpublic boolean setNodeReferences(NodeReferences refs)
public void setItemReferences(InternalVersionItem item, List references)
protected List getItemReferences(InternalVersionItem item)
item
- version item
public EventStateCollection createEventStateCollection() throws RepositoryException
EventStateCollection
.
This object uses one instance of a LocalItemStateManager
to update data on behalf of many sessions. In order to maintain the
association between update operation and session who actually invoked
the update, an internal event source is used.
createEventStateCollection
in interface EventStateCollectionFactory
EventStateCollection
RepositoryException
- if creation fails for some reasonpublic InternalVersion getVersion(NodeId id) throws RepositoryException
getVersion
in interface VersionManager
id
-
RepositoryException
public InternalVersionHistory getVersionHistory(NodeId id) throws RepositoryException
getVersionHistory
in interface VersionManager
id
-
RepositoryException
public boolean hasVersionHistory(NodeId id)
hasVersionHistory
in interface VersionManager
id
-
true
if the version history exists.public boolean hasVersion(NodeId id)
hasVersion
in interface VersionManager
id
-
true
if the version exists.public VersionHistory getVersionHistory(Session session, NodeState node) throws RepositoryException
node
or
null
if the given node doesn't (yet) have an associated
version history.
getVersionHistory
in interface VersionManager
session
- node
- node whose version history should be returned
node
or
null
if the given node doesn't (yet) have an
associated version history.
RepositoryException
- if an error occursVersionManager.createVersionHistory(Session, NodeState)
protected InternalVersion checkin(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history, NodeImpl node) throws RepositoryException
node
- node to checkin
RepositoryException
- if an error occursNode.checkin()
protected void removeVersion(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history, QName name) throws VersionException, RepositoryException
history
- the version history from where to remove the version.name
- the name of the version to remove.
VersionException
- if the version history
does
not have a version with name
.
RepositoryException
- if any other error occurs.protected InternalVersion setVersionLabel(org.apache.jackrabbit.core.version.InternalVersionHistoryImpl history, QName version, QName label, boolean move) throws RepositoryException
history
- version historyversion
- version namelabel
- version labelmove
- true
to move from existing version;
false
otherwise
RepositoryException
- if an error occursprotected void versionCreated(InternalVersion version)
version
- internal version itemprotected void versionDestroyed(InternalVersion version)
version
- internal version item
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |