org.apache.jackrabbit.rmi.server
Class ServerVersionHistory

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.apache.jackrabbit.rmi.server.ServerObject
                  extended by org.apache.jackrabbit.rmi.server.ServerItem
                      extended by org.apache.jackrabbit.rmi.server.ServerNode
                          extended by org.apache.jackrabbit.rmi.server.ServerVersionHistory
All Implemented Interfaces:
Serializable, Remote, RemoteItem, RemoteNode, RemoteVersionHistory

public class ServerVersionHistory
extends ServerNode
implements RemoteVersionHistory

Remote adapter for the JCR VersionHistory interface. This class makes a local version history available as an RMI service using the RemoteVersionHistory interface.

See Also:
VersionHistory, RemoteVersionHistory, Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ServerVersionHistory(VersionHistory versionHistory, RemoteAdapterFactory factory)
          Creates a remote adapter for the given local version history.
 
Method Summary
 void addVersionLabel(String versionName, String label, boolean moveLabel)
          Remote version of the VersionHistory.addVersionLabel(String, String, boolean) method.
 RemoteIterator getAllVersions()
          Remote version of the VersionHistory.getAllVersions() method.
 RemoteVersion getRootVersion()
          Remote version of the VersionHistory.getRootVersion() method.
 RemoteVersion getVersion(String versionName)
          Remote version of the VersionHistory.getVersion(String) method.
 String getVersionableUUID()
          Remote version of the VersionHistory.getVersionableUUID() VersionHistory.getVersionableUUID()} method.
 RemoteVersion getVersionByLabel(String label)
          Remote version of the VersionHistory.getVersionByLabel(String) method.
 String[] getVersionLabels()
          Remote version of the VersionHistory.getVersionLabels() method.
 String[] getVersionLabels(String versionUUID)
          Remote version of the VersionHistory.getVersionLabels(Version) method.
 boolean hasVersionLabel(String label)
          Remote version of the VersionHistory.hasVersionLabel(String) method.
 boolean hasVersionLabel(String versionUUID, String label)
          Remote version of the hasVersionLabel(Version, String) method.
 void removeVersion(String versionName)
          Remote version of the VersionHistory.removeVersion(String) method.
 void removeVersionLabel(String label)
          Remote version of the VersionHistory.removeVersionLabel(String) method.
 
Methods inherited from class org.apache.jackrabbit.rmi.server.ServerNode
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getReferences, getReferences, getUUID, getVersionByUUID, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, restore, restore, restoreByLabel, restoreByUUID, setProperty, setProperty, setProperty, setProperty, unlock, update
 
Methods inherited from class org.apache.jackrabbit.rmi.server.ServerItem
getAncestor, getDepth, getName, getParent, getPath, isModified, isNew, refresh, remove, save
 
Methods inherited from class org.apache.jackrabbit.rmi.server.ServerObject
getFactory, getRemoteItem, getRemoteNode, getRemoteNodeTypeArray, getRepositoryException, getSerialValue, getSerialValues
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.rmi.remote.RemoteNode
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getReferences, getReferences, getUUID, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, restore, restore, restoreByLabel, restoreByUUID, setProperty, setProperty, setProperty, setProperty, unlock, update
 
Methods inherited from interface org.apache.jackrabbit.rmi.remote.RemoteItem
getAncestor, getDepth, getName, getParent, getPath, isModified, isNew, refresh, remove, save
 

Constructor Detail

ServerVersionHistory

public ServerVersionHistory(VersionHistory versionHistory,
                            RemoteAdapterFactory factory)
                     throws RemoteException
Creates a remote adapter for the given local version history.

Parameters:
versionHistory - local version history
factory - remote adapter factory
Throws:
RemoteException - on RMI errors
Method Detail

getRootVersion

public RemoteVersion getRootVersion()
                             throws RepositoryException,
                                    RemoteException
Remote version of the VersionHistory.getRootVersion() method.

Specified by:
getRootVersion in interface RemoteVersionHistory
Returns:
a Version object.
Throws:
RepositoryException - if an error occurs.
RemoteException - on RMI errors

getAllVersions

public RemoteIterator getAllVersions()
                              throws RepositoryException,
                                     RemoteException
Remote version of the VersionHistory.getAllVersions() method.

Specified by:
getAllVersions in interface RemoteVersionHistory
Returns:
remote versions
Throws:
RepositoryException - if an error occurs.
RemoteException - on RMI errors

getVersion

public RemoteVersion getVersion(String versionName)
                         throws RepositoryException,
                                RemoteException
Remote version of the VersionHistory.getVersion(String) method.

Specified by:
getVersion in interface RemoteVersionHistory
Parameters:
versionName - a version name
Returns:
a Version object.
Throws:
RepositoryException - if an error occurs.
RemoteException - on RMI errors

getVersionByLabel

public RemoteVersion getVersionByLabel(String label)
                                throws RepositoryException,
                                       RemoteException
Remote version of the VersionHistory.getVersionByLabel(String) method.

Specified by:
getVersionByLabel in interface RemoteVersionHistory
Parameters:
label - a version label
Returns:
a Version object.
Throws:
RepositoryException - if an error occurs.
RemoteException - on RMI errors

addVersionLabel

public void addVersionLabel(String versionName,
                            String label,
                            boolean moveLabel)
                     throws RepositoryException,
                            RemoteException
Remote version of the VersionHistory.addVersionLabel(String, String, boolean) method.

Specified by:
addVersionLabel in interface RemoteVersionHistory
Parameters:
versionName - the name of the version to which the label is to be added.
label - the label to be added.
moveLabel - if true, then if label is already assigned to a version in this version history, it is moved to the new version specified; if false, then attempting to assign an already used label will throw a VersionException.
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors

removeVersionLabel

public void removeVersionLabel(String label)
                        throws RepositoryException,
                               RemoteException
Remote version of the VersionHistory.removeVersionLabel(String) method.

Specified by:
removeVersionLabel in interface RemoteVersionHistory
Parameters:
label - a version label
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors

hasVersionLabel

public boolean hasVersionLabel(String label)
                        throws RepositoryException,
                               RemoteException
Remote version of the VersionHistory.hasVersionLabel(String) method.

Specified by:
hasVersionLabel in interface RemoteVersionHistory
Parameters:
label - a version label
Returns:
a boolean
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

hasVersionLabel

public boolean hasVersionLabel(String versionUUID,
                               String label)
                        throws RepositoryException,
                               RemoteException
Remote version of the hasVersionLabel(Version, String) method.

Specified by:
hasVersionLabel in interface RemoteVersionHistory
Parameters:
versionUUID - The UUID of the version whose labels are to be returned.
label - a version label
Returns:
a boolean.
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors

getVersionLabels

public String[] getVersionLabels()
                          throws RepositoryException,
                                 RemoteException
Remote version of the VersionHistory.getVersionLabels() method.

Specified by:
getVersionLabels in interface RemoteVersionHistory
Returns:
a String array containing all the labels of the version history
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getVersionLabels

public String[] getVersionLabels(String versionUUID)
                          throws RepositoryException,
                                 RemoteException
Remote version of the VersionHistory.getVersionLabels(Version) method.

Specified by:
getVersionLabels in interface RemoteVersionHistory
Parameters:
versionUUID - The UUID of the version whose labels are to be returned.
Returns:
a String array containing all the labels of the given version
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors

removeVersion

public void removeVersion(String versionName)
                   throws RepositoryException,
                          RemoteException
Remote version of the VersionHistory.removeVersion(String) method.

Specified by:
removeVersion in interface RemoteVersionHistory
Parameters:
versionName - the name of a version in this version history.
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors

getVersionableUUID

public String getVersionableUUID()
                          throws RepositoryException,
                                 RemoteException
Remote version of the VersionHistory.getVersionableUUID() VersionHistory.getVersionableUUID()} method.

Specified by:
getVersionableUUID in interface RemoteVersionHistory
Returns:
the uuid of the versionable node
Throws:
RepositoryException - if another error occurs.
RemoteException - on RMI errors


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