org.apache.jackrabbit.core.version
Interface VersionManager

All Known Implementing Classes:
VersionManagerImpl, XAVersionManager

public interface VersionManager

This interface defines the version manager. It gives access to the underlying persistence layer of the versioning.


Method Summary
 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.
 VersionHistory createVersionHistory(Session session, NodeState node)
          Creates a new version history.
 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 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 removeVersion(VersionHistory history, Name versionName)
          Removes the specified version from the given version history.
 Version setVersionLabel(VersionHistory history, Name version, Name label, boolean move)
          Sets the version label to the given version.
 

Method Detail

getVirtualItemStateProvider

VirtualItemStateProvider getVirtualItemStateProvider()
returns the virtual item state provider that exposes the internal versions as items.

Returns:
the virtual item state provider.

createVersionHistory

VersionHistory createVersionHistory(Session session,
                                    NodeState node)
                                    throws RepositoryException
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.

Parameters:
node -
Returns:
Throws:
RepositoryException
See Also:
getVersionHistory(Session, NodeState)

getVersionHistory

VersionHistory getVersionHistory(Session session,
                                 NodeState node)
                                 throws RepositoryException
Returns the version history of the specified node or null if the given node doesn't (yet) have an associated version history.

Parameters:
session -
node - node whose version history should be returned
Returns:
the version history of the specified node or null if the given node doesn't (yet) have an associated version history.
Throws:
RepositoryException - if an error occurs
See Also:
createVersionHistory(Session, NodeState)

checkin

Version checkin(NodeImpl node)
                throws RepositoryException
invokes the checkin() on the persistent version manager and remaps the newly created version objects.

Parameters:
node -
Returns:
Throws:
RepositoryException

removeVersion

void removeVersion(VersionHistory history,
                   Name versionName)
                   throws RepositoryException
Removes the specified version from the given version history.

Parameters:
history -
versionName -
Throws:
RepositoryException

setVersionLabel

Version setVersionLabel(VersionHistory history,
                        Name version,
                        Name label,
                        boolean move)
                        throws RepositoryException
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.

Parameters:
history -
version -
label -
move -
Returns:
Throws:
RepositoryException

hasVersionHistory

boolean hasVersionHistory(NodeId id)
Checks if the version history with the given id exists

Parameters:
id -
Returns:
true if the version history exists.

getVersionHistory

InternalVersionHistory getVersionHistory(NodeId id)
                                         throws RepositoryException
Returns the version history with the given id

Parameters:
id -
Returns:
the version history.
Throws:
RepositoryException

hasVersion

boolean hasVersion(NodeId id)
Checks if the version with the given id exists

Parameters:
id -
Returns:
true if the version exists.

getVersion

InternalVersion getVersion(NodeId id)
                           throws RepositoryException
Returns the version with the given id

Parameters:
id -
Returns:
the version.
Throws:
RepositoryException

close

void close()
           throws Exception
Close this version manager. After having closed a persistence manager, further operations on this object are treated as illegal and throw

Throws:
Exception - if an error occurs


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.