Interface VersionSelector

All Known Implementing Classes:
DateVersionSelector, LabelVersionSelector

public interface VersionSelector

This Interface defines the version selector that needs to provide a version, given some hints and a version history. the selector is used in the various restore methods in order to select the correct version of previously versioned OPV=Version children upon restore. JSR170 states: "This determination [of the version] depends on the configuration of the workspace and is outside the scope of this specification."

The version selection in jackrabbit works as follows:
The Node.restore() methods uses the DateVersionSelector which is initialized with the creation date of the parent version. This selector selects the latest version that is equal or older than the given date. if no such version exists, the initial one is restored.
The Node.restoreByLabel() uses the LabelVersionSelector which is initialized with the label of the version to be restored. This selector selectes the version with the same label. if no such version exists, the initial one is restored.

See Also:
DateVersionSelector, LabelVersionSelector, NodeImpl.restore(String, boolean), NodeImpl.restore(Version, boolean), NodeImpl.restore(Version, String, boolean), NodeImpl.restoreByLabel(String, boolean)

Method Summary
 Version select(VersionHistory versionHistory)
          Selects a version of the given version history.

Method Detail


Version select(VersionHistory versionHistory)
               throws RepositoryException
Selects a version of the given version history. If this VersionSelector is unable to select one, it can return null. Please note, that a version selector is not allowed to return the root version.

versionHistory - version history to select a version from
A version or null.
RepositoryException - if an error occurs.

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