Interface InternalVersionManager
-
- All Known Implementing Classes:
InternalVersionManagerImpl
,InternalXAVersionManager
public interface InternalVersionManager
This interface defines the version manager. It gives access to the underlying persistence layer of the versioning.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeId
canCheckout(NodeStateEx state, NodeId activityId)
invokes the checkout() on the persistent version manager.InternalVersion
checkin(Session session, NodeStateEx node, Calendar created)
invokes the checkin() on the persistent version manager and remaps the newly created version objects.void
close()
Close this version manager.NodeId
createActivity(Session session, String title)
Creates a new activityInternalActivity
getActivity(NodeId id)
Returns the activity with the given idInternalBaseline
getBaseline(NodeId id)
Returns the baseline with the given idInternalVersion
getHeadVersionOfNode(NodeId id)
Returns the head version of the node with the given id.InternalVersion
getVersion(NodeId id)
Returns the version with the given idVersionHistoryInfo
getVersionHistory(Session session, NodeState vNode, NodeId copiedFrom)
Returns information about the version history of the specified node.InternalVersionHistory
getVersionHistory(NodeId id)
Returns the version history with the given idInternalVersionHistory
getVersionHistoryOfNode(NodeId id)
Returns the version history for the versionable node with the given id.VirtualItemStateProvider
getVirtualItemStateProvider()
returns the virtual item state provider that exposes the internal versions as items.void
removeActivity(Session session, NodeId nodeId)
Removes an activity and allvoid
removeVersion(Session session, InternalVersionHistory history, Name versionName)
Removes the specified version from the given version history.void
removeVersionHistory(Session session, InternalVersionHistory history)
Removes the specified version history from storage.InternalVersion
setVersionLabel(Session session, InternalVersionHistory history, Name version, Name label, boolean move)
Sets the versionlabel
to the givenversion
.
-
-
-
Method Detail
-
getVirtualItemStateProvider
VirtualItemStateProvider getVirtualItemStateProvider()
returns the virtual item state provider that exposes the internal versions as items.- Returns:
- the virtual item state provider.
-
getVersionHistory
VersionHistoryInfo getVersionHistory(Session session, NodeState vNode, NodeId copiedFrom) throws RepositoryException
Returns information about the version history of the specified node. If the given node does not already have an associated version history, then an empty history is automatically created. This method should only be called by code that already knows that the specified node is versionable.- Parameters:
session
- workspace sessionvNode
- node whose version history should be returnedcopiedFrom
- the node id for the jcr:copiedFrom property use for copied nodes- Returns:
- identifiers of the version history and root version nodes
- Throws:
RepositoryException
- if an error occurs
-
checkin
InternalVersion checkin(Session session, NodeStateEx node, Calendar created) throws RepositoryException
invokes the checkin() on the persistent version manager and remaps the newly created version objects.- Parameters:
session
- session that invokes the checkinnode
- node to checkincreated
- create time of the new version, ornull
for the current time- Returns:
- the newly created version
- Throws:
RepositoryException
- if an error occurs
-
canCheckout
NodeId canCheckout(NodeStateEx state, NodeId activityId) throws RepositoryException
invokes the checkout() on the persistent version manager.- Parameters:
state
- node to checkoutactivityId
- node id if the current activity- Returns:
- the base version id
- Throws:
RepositoryException
- if an error occurs
-
removeVersion
void removeVersion(Session session, InternalVersionHistory history, Name versionName) throws RepositoryException
Removes the specified version from the given version history.- Parameters:
session
- the session that performs the removehistory
- version history to remove the version fromversionName
- name of the version- Throws:
RepositoryException
- if an error occurs
-
removeVersionHistory
void removeVersionHistory(Session session, InternalVersionHistory history) throws RepositoryException
Removes the specified version history from storage.- Parameters:
session
- the session that performs the removehistory
- the version history to remove- Throws:
RepositoryException
- if an error occurs
-
setVersionLabel
InternalVersion setVersionLabel(Session session, InternalVersionHistory history, Name version, Name label, boolean move) throws RepositoryException
Sets the versionlabel
to the givenversion
. If the label is already assigned to another version, a VersionException is thrown unlessmove
istrue
. Ifversion
isnull
, the label is removed from the respective version. In either case, the version the label was previously assigned is returned, ornull
of the label was not moved.- Parameters:
session
- the session that performs the operationhistory
- version historyversion
- name of the versionlabel
- new labelmove
- iftrue
label will be moved- Returns:
- the version that had the label or
null
- Throws:
RepositoryException
- if an error occurs
-
getVersionHistory
InternalVersionHistory getVersionHistory(NodeId id) throws RepositoryException
Returns the version history with the given id- Parameters:
id
- id of the version history- Returns:
- the version history.
- Throws:
RepositoryException
- if an error occurs
-
getVersionHistoryOfNode
InternalVersionHistory getVersionHistoryOfNode(NodeId id) throws RepositoryException
Returns the version history for the versionable node with the given id.- Parameters:
id
- id of the node to retrieve the version history for- Returns:
- the version history
- Throws:
RepositoryException
- if an error occurs or the history does not exit
-
getVersion
InternalVersion getVersion(NodeId id) throws RepositoryException
Returns the version with the given id- Parameters:
id
- id of the version to retrieve- Returns:
- the version or
null
- Throws:
RepositoryException
- if an error occurs
-
getBaseline
InternalBaseline getBaseline(NodeId id) throws RepositoryException
Returns the baseline with the given id- Parameters:
id
- id of the baseline version to retrieve- Returns:
- the baseline or
null
if not found - Throws:
RepositoryException
- if an error occurs
-
getActivity
InternalActivity getActivity(NodeId id) throws RepositoryException
Returns the activity with the given id- Parameters:
id
- id of the activity to retrieve- Returns:
- the activity.
- Throws:
RepositoryException
- if an error occurs
-
getHeadVersionOfNode
InternalVersion getHeadVersionOfNode(NodeId id) throws RepositoryException
Returns the head version of the node with the given id. this is always the last of all versions. this only works correctly for liner version graphs (i.e. simple versioning)- Parameters:
id
- id of the node to retrieve the version for- Returns:
- the version.
- Throws:
RepositoryException
- if an error occurs
-
createActivity
NodeId createActivity(Session session, String title) throws RepositoryException
Creates a new activity- Parameters:
session
- the current sessiontitle
- title of the new activity- Returns:
- the nodeid of the new activity
- Throws:
RepositoryException
- if an error occurs
-
removeActivity
void removeActivity(Session session, NodeId nodeId) throws RepositoryException
Removes an activity and all- Parameters:
session
- the current sessionnodeId
- id of the activity to remove- Throws:
RepositoryException
- if an error occurs
-
-