org.apache.jackrabbit.core.version
Class InternalVersionHistoryImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.version.InternalVersionItemImpl
      extended byorg.apache.jackrabbit.core.version.InternalVersionHistoryImpl
All Implemented Interfaces:
InternalVersionHistory, InternalVersionItem

public class InternalVersionHistoryImpl
extends org.apache.jackrabbit.core.version.InternalVersionItemImpl
implements InternalVersionHistory

Implements a InternalVersionHistory


Constructor Summary
InternalVersionHistoryImpl(VersionManagerImpl vMgr, org.apache.jackrabbit.core.version.NodeStateEx node)
          Creates a new VersionHistory object for the given node state.
 
Method Summary
 String getId()
          Returns the external id of this item
 int getNumVersions()
          Returns the number of versions in this version history.
 InternalVersionItem getParent()
          returns the parent version item or null
 InternalVersion getRootVersion()
          Equivalalent to VersionHistory.getRootVersion().
 InternalVersion getVersion(QName versionName)
          Equivalalent to VersionHistory.getVersion(java.lang.String).
 InternalVersion getVersion(String uuid)
          Returns the version with the given uuid or null if the respective version does not exist.
 String getVersionableUUID()
          Returns the UUID of the versionable node that this history belongs to.
 InternalVersion getVersionByLabel(QName label)
          Equivalalent to VersionHistory.getVersionByLabel(java.lang.String) but returns null if the version does not exists.
 QName[] getVersionLabels()
          Returns a string iterator over all version labels that exist in this version history
 String getVersionLabelsUUID()
          Returns the UUID of the version labels node
protected  VersionManagerImpl getVersionManager()
          Returns the persistent version manager for this item
 Iterator getVersions()
          Returns an iterator over all versions (not ordered yet), including the root version.
 boolean hasVersion(QName versionName)
          Checks if the version with the given name exists in this version history.
 boolean hasVersion(String uuid)
          Checks if the version for the given uuid exists in this history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InternalVersionHistoryImpl

public InternalVersionHistoryImpl(VersionManagerImpl vMgr,
                                  org.apache.jackrabbit.core.version.NodeStateEx node)
                           throws RepositoryException
Creates a new VersionHistory object for the given node state.

Method Detail

getId

public String getId()
Returns the external id of this item

Specified by:
getId in interface InternalVersionItem
Returns:

getParent

public InternalVersionItem getParent()
returns the parent version item or null

Specified by:
getParent in interface InternalVersionItem
Returns:

getRootVersion

public InternalVersion getRootVersion()
Equivalalent to VersionHistory.getRootVersion().

Specified by:
getRootVersion in interface InternalVersionHistory
See Also:
VersionHistory.getRootVersion()

getVersion

public InternalVersion getVersion(QName versionName)
                           throws VersionException
Equivalalent to VersionHistory.getVersion(java.lang.String).

Specified by:
getVersion in interface InternalVersionHistory
Throws:
VersionException
See Also:
VersionHistory.getVersion(java.lang.String)

hasVersion

public boolean hasVersion(QName versionName)
Checks if the version with the given name exists in this version history.

Specified by:
hasVersion in interface InternalVersionHistory
Parameters:
versionName - the name of the version
Returns:
true if the version exists; false otherwise.

hasVersion

public boolean hasVersion(String uuid)
Checks if the version for the given uuid exists in this history.

Specified by:
hasVersion in interface InternalVersionHistory
Parameters:
uuid - the uuid of the version
Returns:
true if the version exists; false otherwise.

getVersion

public InternalVersion getVersion(String uuid)
Returns the version with the given uuid or null if the respective version does not exist.

Specified by:
getVersion in interface InternalVersionHistory
Parameters:
uuid - the uuid of the version
Returns:
the internal version ot null

getVersionByLabel

public InternalVersion getVersionByLabel(QName label)
Equivalalent to VersionHistory.getVersionByLabel(java.lang.String) but returns null if the version does not exists.

Specified by:
getVersionByLabel in interface InternalVersionHistory
See Also:
VersionHistory.getVersionByLabel(java.lang.String)

getVersions

public Iterator getVersions()
Returns an iterator over all versions (not ordered yet), including the root version.

Specified by:
getVersions in interface InternalVersionHistory
Returns:
an iterator over InternalVersion objects.

getNumVersions

public int getNumVersions()
Returns the number of versions in this version history.

Specified by:
getNumVersions in interface InternalVersionHistory
Returns:
the number of versions, including the root version.

getVersionableUUID

public String getVersionableUUID()
Returns the UUID of the versionable node that this history belongs to.

Specified by:
getVersionableUUID in interface InternalVersionHistory
Returns:
the UUID of the versionable node.

getVersionLabels

public QName[] getVersionLabels()
Returns a string iterator over all version labels that exist in this version history

Specified by:
getVersionLabels in interface InternalVersionHistory
Returns:

getVersionLabelsUUID

public String getVersionLabelsUUID()
Returns the UUID of the version labels node

Specified by:
getVersionLabelsUUID in interface InternalVersionHistory
Returns:

getVersionManager

protected VersionManagerImpl getVersionManager()
Returns the persistent version manager for this item

Returns:


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