org.apache.jackrabbit.core.version
Interface VersionManager

All Known Implementing Classes:
VersionManagerImpl

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(String id)
          Returns the version 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.
 InternalVersionHistory getVersionHistory(String id)
          Returns the version history with the given id
 VirtualItemStateProvider getVirtualItemStateProvider()
          returns the virtual item state provider that exposes the internal versions as items.
 boolean hasVersion(String id)
          Checks if the version with the given id exists
 boolean hasVersionHistory(String id)
          Checks if the version history with the given id exists
 void removeVersion(VersionHistory history, QName versionName)
          Removes the specified version from the given version history.
 Version setVersionLabel(VersionHistory history, QName version, QName label, boolean move)
          Sets the version label to the given version.
 

Method Detail

getVirtualItemStateProvider

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

Returns:

createVersionHistory

public 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

public 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

public 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

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

Parameters:
history -
versionName -
Throws:
RepositoryException

setVersionLabel

public Version setVersionLabel(VersionHistory history,
                               QName version,
                               QName 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

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

Parameters:
id -
Returns:

getVersionHistory

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

Parameters:
id -
Returns:
Throws:
RepositoryException

hasVersion

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

Parameters:
id -
Returns:

getVersion

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

Parameters:
id -
Returns:
Throws:
RepositoryException

close

public 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-2005 The Apache Software Foundation. All Rights Reserved.