org.apache.jackrabbit.rmi.remote
Interface RemoteSession

All Superinterfaces:
Remote
All Known Subinterfaces:
RemoteXASession
All Known Implementing Classes:
ServerSession, ServerXASession

public interface RemoteSession
extends Remote

Remote version of the JCR Session interface. Used by the ServerSession and ClientSession adapters to provide transparent RMI access to remote sessions.

Most of the methods in this interface are documented only with a reference to a corresponding Session method. In these cases the remote object will simply forward the method call to the underlying Session instance. Complex return values like workspaces and other objects are returned as remote references to the corresponding remote interface. Simple return values and possible exceptions are simply copied over the network to the client. RMI errors are signaled with RemoteExceptions.

See Also:
Session, ClientSession, ServerSession

Method Summary
 void addLockToken(String name)
          Remote version of the Session.addLockToken(String) method.
 byte[] exportDocumentView(String path, boolean skipBinary, boolean noRecurse)
          Exports the identified repository subtree as a document view XML stream.
 byte[] exportSystemView(String path, boolean skipBinary, boolean noRecurse)
          Exports the identified repository subtree as a system view XML stream.
 RemoteAccessControlManager getAccessControlManager()
          Remote version of the Session.getAccessControlManager() method.
 Object getAttribute(String name)
          Returns the named attribute.
 String[] getAttributeNames()
          Remote version of the Session.getAttributeNames() method.
 RemoteItem getItem(String path)
          Remote version of the Session.getItem(String) method.
 String[] getLockTokens()
          Remote version of the Session.getLockTokens() method.
 String getNamespacePrefix(String uri)
          Remote version of the Session.getNamespacePrefix(String) method.
 String[] getNamespacePrefixes()
          Remote version of the Session.getNamespacePrefixes() method.
 String getNamespaceURI(String prefix)
          Remote version of the Session.getNamespaceURI(String) method.
 RemoteNode getNode(String path)
          Remote version of the Session.getNode(String) method.
 RemoteNode getNodeByIdentifier(String id)
          Remote version of the Session.getNodeByIdentifier(String) method.
 RemoteNode getNodeByUUID(String uuid)
          Remote version of the Session.getNodeByUUID(String) method.
 RemoteProperty getProperty(String path)
          Remote version of the Session.getProperty(String) method.
 RemoteNode getRootNode()
          Remote version of the Session.getRootNode() method.
 String getUserID()
          Remote version of the Session.getUserID() method.
 RemoteWorkspace getWorkspace()
          Remote version of the Session.getWorkspace() method.
 boolean hasPendingChanges()
          Remote version of the Session.hasPendingChanges() method.
 boolean hasPermission(String path, String actions)
          Remote version of the Session.hasPermission(String,String) method.
 RemoteSession impersonate(Credentials credentials)
          Remote version of the Session.impersonate(Credentials) method.
 void importXML(String path, byte[] xml, int uuidBehaviour)
          Imports the system or document view XML data into a subtree of the identified node.
 boolean isLive()
          Remote version of the Session.isLive() method.
 boolean itemExists(String path)
          Remote version of the Session.itemExists(String) method.
 void logout()
          Remote version of the Session.logout() method.
 void move(String from, String to)
          Remote version of the Session.move(String,String) method.
 boolean nodeExists(String path)
          Remote version of the Session.nodeExists(String) method.
 boolean propertyExists(String path)
          Remote version of the Session.propertyExists(String) method.
 void refresh(boolean keepChanges)
          Remote version of the Session.refresh(boolean) method.
 void removeItem(String path)
          Remote version of the Session.removeItem(String) method.
 void removeLockToken(String name)
          Remote version of the Session.removeLockToken(String) method.
 void save()
          Remote version of the Session.save() method.
 void setNamespacePrefix(String prefix, String uri)
          Remote version of the Session.setNamespacePrefix(String,String) method.
 

Method Detail

getUserID

String getUserID()
                 throws RemoteException
Remote version of the Session.getUserID() method.

Returns:
user id
Throws:
RemoteException - on RMI errors
See Also:
Session.getUserID()

getAttribute

Object getAttribute(String name)
                    throws RemoteException
Returns the named attribute. Note that only serializable attribute values can be transmitted over the network and that the client should have (or be able to fetch) the object class to access the returned value. Failures to meet these conditions are signalled with RemoteExceptions.

Parameters:
name - attribute name
Returns:
attribute value
Throws:
RemoteException - on RMI errors
See Also:
Session.getAttribute(java.lang.String)

getAttributeNames

String[] getAttributeNames()
                           throws RemoteException
Remote version of the Session.getAttributeNames() method.

Returns:
attribute names
Throws:
RemoteException - on RMI errors

getWorkspace

RemoteWorkspace getWorkspace()
                             throws RemoteException
Remote version of the Session.getWorkspace() method.

Returns:
workspace
Throws:
RemoteException - on RMI errors
See Also:
Session.getWorkspace()

impersonate

RemoteSession impersonate(Credentials credentials)
                          throws RepositoryException,
                                 RemoteException
Remote version of the Session.impersonate(Credentials) method.

Parameters:
credentials - credentials for the new session
Returns:
new session
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNodeByIdentifier

RemoteNode getNodeByIdentifier(String id)
                               throws RepositoryException,
                                      RemoteException
Remote version of the Session.getNodeByIdentifier(String) method.

Parameters:
id - node identifier
Returns:
node
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNodeByUUID

RemoteNode getNodeByUUID(String uuid)
                         throws RepositoryException,
                                RemoteException
Remote version of the Session.getNodeByUUID(String) method.

Parameters:
uuid - node uuid
Returns:
node
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getItem

RemoteItem getItem(String path)
                   throws RepositoryException,
                          RemoteException
Remote version of the Session.getItem(String) method.

Parameters:
path - item path
Returns:
item
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNode

RemoteNode getNode(String path)
                   throws RepositoryException,
                          RemoteException
Remote version of the Session.getNode(String) method.

Parameters:
path - node path
Returns:
node
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getProperty

RemoteProperty getProperty(String path)
                           throws RepositoryException,
                                  RemoteException
Remote version of the Session.getProperty(String) method.

Parameters:
path - property path
Returns:
property
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

itemExists

boolean itemExists(String path)
                   throws RepositoryException,
                          RemoteException
Remote version of the Session.itemExists(String) method.

Parameters:
path - item path
Returns:
true if the item exists, false otherwise
Throws:
RepositoryException - on repository exception
RemoteException - on RMI errors

nodeExists

boolean nodeExists(String path)
                   throws RepositoryException,
                          RemoteException
Remote version of the Session.nodeExists(String) method.

Parameters:
path - node path
Returns:
true if the node exists, false otherwise
Throws:
RepositoryException - on repository exception
RemoteException - on RMI errors

propertyExists

boolean propertyExists(String path)
                       throws RepositoryException,
                              RemoteException
Remote version of the Session.propertyExists(String) method.

Parameters:
path - property path
Returns:
true if the property exists, false otherwise
Throws:
RepositoryException - on repository exception
RemoteException - on RMI errors

removeItem

void removeItem(String path)
                throws RepositoryException,
                       RemoteException
Remote version of the Session.removeItem(String) method.

Parameters:
path - item path
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

move

void move(String from,
          String to)
          throws RepositoryException,
                 RemoteException
Remote version of the Session.move(String,String) method.

Parameters:
from - source path
to - destination path
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

save

void save()
          throws RepositoryException,
                 RemoteException
Remote version of the Session.save() method.

Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

refresh

void refresh(boolean keepChanges)
             throws RepositoryException,
                    RemoteException
Remote version of the Session.refresh(boolean) method.

Parameters:
keepChanges - flag to keep transient changes
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

logout

void logout()
            throws RemoteException
Remote version of the Session.logout() method.

Throws:
RemoteException - on RMI errors

isLive

boolean isLive()
               throws RemoteException
Remote version of the Session.isLive() method.

Returns:
true if the session is live, false otherwise
Throws:
RemoteException - on RMI errors

getRootNode

RemoteNode getRootNode()
                       throws RepositoryException,
                              RemoteException
Remote version of the Session.getRootNode() method.

Returns:
root node
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

hasPendingChanges

boolean hasPendingChanges()
                          throws RepositoryException,
                                 RemoteException
Remote version of the Session.hasPendingChanges() method.

Returns:
true if the session has pending changes, false otherwise
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

hasPermission

boolean hasPermission(String path,
                      String actions)
                      throws RepositoryException,
                             RemoteException
Remote version of the Session.hasPermission(String,String) method.

Parameters:
path - item path
actions - actions
Returns:
true if permission is granted, false otherwise
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

importXML

void importXML(String path,
               byte[] xml,
               int uuidBehaviour)
               throws IOException,
                      RepositoryException,
                      RemoteException
Imports the system or document view XML data into a subtree of the identified node. Note that the entire XML stream is transferred as a single byte array over the network. This may cause problems with large XML streams. The remote server will wrap the XML data into a ByteArrayInputStream and feed it to the normal importXML method.

Parameters:
path - node path
xml - imported XML document
uuidBehaviour - UUID handling mode
Throws:
IOException - on IO errors
RepositoryException - on repository errors
RemoteException - on RMI errors
See Also:
Session.importXML(java.lang.String, java.io.InputStream, int)

setNamespacePrefix

void setNamespacePrefix(String prefix,
                        String uri)
                        throws RepositoryException,
                               RemoteException
Remote version of the Session.setNamespacePrefix(String,String) method.

Parameters:
prefix - namespace prefix
uri - namespace uri
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNamespacePrefixes

String[] getNamespacePrefixes()
                              throws RepositoryException,
                                     RemoteException
Remote version of the Session.getNamespacePrefixes() method.

Returns:
namespace prefixes
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNamespaceURI

String getNamespaceURI(String prefix)
                       throws RepositoryException,
                              RemoteException
Remote version of the Session.getNamespaceURI(String) method.

Parameters:
prefix - namespace prefix
Returns:
namespace uri
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

getNamespacePrefix

String getNamespacePrefix(String uri)
                          throws RepositoryException,
                                 RemoteException
Remote version of the Session.getNamespacePrefix(String) method.

Parameters:
uri - namespace uri
Returns:
namespace prefix
Throws:
RepositoryException - on repository errors
RemoteException - on RMI errors

addLockToken

void addLockToken(String name)
                  throws RemoteException
Remote version of the Session.addLockToken(String) method.

Parameters:
name - lock token
Throws:
RemoteException - on RMI errors

getLockTokens

String[] getLockTokens()
                       throws RemoteException
Remote version of the Session.getLockTokens() method.

Returns:
lock tokens
Throws:
RemoteException - on RMI errors

removeLockToken

void removeLockToken(String name)
                     throws RemoteException
Remote version of the Session.removeLockToken(String) method.

Parameters:
name - lock token
Throws:
RemoteException - on RMI errors

exportSystemView

byte[] exportSystemView(String path,
                        boolean skipBinary,
                        boolean noRecurse)
                        throws IOException,
                               RepositoryException,
                               RemoteException
Exports the identified repository subtree as a system view XML stream. Note that the entire XML stream is transferred as a single byte array over the network. This may cause problems with large exports. The remote server uses a ByteArrayOutputStream to capture the XML data written by the normal exportSysView method.

Parameters:
path - node path
skipBinary - binary skip flag
noRecurse - no recursion flag
Returns:
exported XML document
Throws:
IOException - on IO errors
RepositoryException - on repository errors
RemoteException - on RMI errors
See Also:
Session.exportSystemView(java.lang.String, org.xml.sax.ContentHandler, boolean, boolean)

exportDocumentView

byte[] exportDocumentView(String path,
                          boolean skipBinary,
                          boolean noRecurse)
                          throws IOException,
                                 RepositoryException,
                                 RemoteException
Exports the identified repository subtree as a document view XML stream. Note that the entire XML stream is transferred as a single byte array over the network. This may cause problems with large exports. The remote server uses a ByteArrayOutputStream to capture the XML data written by the normal exportDocView method.

Parameters:
path - node path
skipBinary - skip binary flag
noRecurse - no recursion flag
Returns:
exported XML document
Throws:
IOException - on IO errors
RepositoryException - on repository errors
RemoteException - on RMI errors
See Also:
Session.exportDocumentView(java.lang.String, org.xml.sax.ContentHandler, boolean, boolean)

getAccessControlManager

RemoteAccessControlManager getAccessControlManager()
                                                   throws UnsupportedRepositoryOperationException,
                                                          RepositoryException,
                                                          RemoteException
Remote version of the Session.getAccessControlManager() method.

Throws:
UnsupportedRepositoryOperationException - if the remote session does not support this method
RepositoryException - if an error occurred getting the access control manager
RemoteException - on RMI errors


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