org.apache.jackrabbit.rmi.client
Class ClientSession

java.lang.Object
  extended byorg.apache.jackrabbit.rmi.client.ClientObject
      extended byorg.apache.jackrabbit.rmi.client.ClientSession
All Implemented Interfaces:
Session

public class ClientSession
extends ClientObject
implements Session

Local adapter for the JCR-RMI RemoteSession inteface. This class makes a remote session locally available using the JCR Session interface.

Author:
Jukka Zitting
See Also:
Session, RemoteSession

Constructor Summary
ClientSession(Repository repository, RemoteSession remote, LocalAdapterFactory factory)
          Creates a client adapter for the given remote session.
 
Method Summary
 void addLockToken(String name)
          
 void checkPermission(String path, String actions)
          
 void exportDocumentView(String path, ContentHandler handler, boolean binaryAsLink, boolean noRecurse)
          Exports the XML document view of the specified repository location to the given XML content handler.
 void exportDocumentView(String path, OutputStream output, boolean binaryAsLink, boolean noRecurse)
          Exports the XML document view of the specified repository location to the given output stream.
 void exportSystemView(String path, ContentHandler handler, boolean binaryAsLink, boolean noRecurse)
          Exports the XML system view of the specified repository location to the given XML content handler.
 void exportSystemView(String path, OutputStream output, boolean binaryAsLink, boolean noRecurse)
          Exports the XML system view of the specified repository location to the given output stream.
 Object getAttribute(String name)
          
 String[] getAttributeNames()
          
 ContentHandler getImportContentHandler(String path, int mode)
          
 Item getItem(String path)
          
 String[] getLockTokens()
          
 String getNamespacePrefix(String uri)
          
 String[] getNamespacePrefixes()
          
 String getNamespaceURI(String prefix)
          
 Node getNodeByUUID(String uuid)
          
 Repository getRepository()
          Returns the current repository without contacting the remote session.
 Node getRootNode()
          
 String getUserID()
          
 ValueFactory getValueFactory()
          Returns the SerialValueFactory.getInstance().
 Workspace getWorkspace()
          
 boolean hasPendingChanges()
          
 Session impersonate(Credentials credentials)
          
 void importXML(String path, InputStream xml, int mode)
          
 boolean isLive()
          
 boolean itemExists(String path)
          
 void logout()
          
 void move(String from, String to)
          
 void refresh(boolean keepChanges)
          
 void removeLockToken(String name)
          
 void save()
          
 void setNamespacePrefix(String prefix, String uri)
          
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientObject
getFactory, getItem, getNode, getNodeTypeArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSession

public ClientSession(Repository repository,
                     RemoteSession remote,
                     LocalAdapterFactory factory)
Creates a client adapter for the given remote session.

Parameters:
repository - current repository
remote - remote repository
factory - local adapter factory
Method Detail

getRepository

public Repository getRepository()
Returns the current repository without contacting the remote session.

Specified by:
getRepository in interface Session

getUserID

public String getUserID()

Specified by:
getUserID in interface Session

getAttribute

public Object getAttribute(String name)

Specified by:
getAttribute in interface Session

getAttributeNames

public String[] getAttributeNames()

Specified by:
getAttributeNames in interface Session

getWorkspace

public Workspace getWorkspace()

Specified by:
getWorkspace in interface Session

impersonate

public Session impersonate(Credentials credentials)
                    throws RepositoryException

Specified by:
impersonate in interface Session
Throws:
RepositoryException

getRootNode

public Node getRootNode()
                 throws RepositoryException

Specified by:
getRootNode in interface Session
Throws:
RepositoryException

getNodeByUUID

public Node getNodeByUUID(String uuid)
                   throws RepositoryException

Specified by:
getNodeByUUID in interface Session
Throws:
RepositoryException

getItem

public Item getItem(String path)
             throws RepositoryException

Specified by:
getItem in interface Session
Throws:
RepositoryException

itemExists

public boolean itemExists(String path)
                   throws RepositoryException

Specified by:
itemExists in interface Session
Throws:
RepositoryException

move

public void move(String from,
                 String to)
          throws RepositoryException

Specified by:
move in interface Session
Throws:
RepositoryException

save

public void save()
          throws RepositoryException

Specified by:
save in interface Session
Throws:
RepositoryException

refresh

public void refresh(boolean keepChanges)
             throws RepositoryException

Specified by:
refresh in interface Session
Throws:
RepositoryException

hasPendingChanges

public boolean hasPendingChanges()
                          throws RepositoryException

Specified by:
hasPendingChanges in interface Session
Throws:
RepositoryException

getValueFactory

public ValueFactory getValueFactory()
Returns the SerialValueFactory.getInstance().

Specified by:
getValueFactory in interface Session

checkPermission

public void checkPermission(String path,
                            String actions)
                     throws AccessControlException,
                            RepositoryException

Specified by:
checkPermission in interface Session
Throws:
AccessControlException
RepositoryException

importXML

public void importXML(String path,
                      InputStream xml,
                      int mode)
               throws IOException,
                      RepositoryException

Specified by:
importXML in interface Session
Throws:
IOException
RepositoryException

getImportContentHandler

public ContentHandler getImportContentHandler(String path,
                                              int mode)
                                       throws RepositoryException

Specified by:
getImportContentHandler in interface Session
Throws:
RepositoryException

setNamespacePrefix

public void setNamespacePrefix(String prefix,
                               String uri)
                        throws RepositoryException

Specified by:
setNamespacePrefix in interface Session
Throws:
RepositoryException

getNamespacePrefixes

public String[] getNamespacePrefixes()
                              throws RepositoryException

Specified by:
getNamespacePrefixes in interface Session
Throws:
RepositoryException

getNamespaceURI

public String getNamespaceURI(String prefix)
                       throws RepositoryException

Specified by:
getNamespaceURI in interface Session
Throws:
RepositoryException

getNamespacePrefix

public String getNamespacePrefix(String uri)
                          throws RepositoryException

Specified by:
getNamespacePrefix in interface Session
Throws:
RepositoryException

logout

public void logout()

Specified by:
logout in interface Session

addLockToken

public void addLockToken(String name)

Specified by:
addLockToken in interface Session

getLockTokens

public String[] getLockTokens()

Specified by:
getLockTokens in interface Session

removeLockToken

public void removeLockToken(String name)

Specified by:
removeLockToken in interface Session

exportSystemView

public void exportSystemView(String path,
                             ContentHandler handler,
                             boolean binaryAsLink,
                             boolean noRecurse)
                      throws SAXException,
                             RepositoryException
Exports the XML system view of the specified repository location to the given XML content handler. This method first requests the raw XML data from the remote session, and then uses an identity transformation to feed the data to the given XML content handler. Possible IO and transformer exceptions are thrown as SAXExceptions.

Specified by:
exportSystemView in interface Session
Throws:
SAXException
RepositoryException

exportSystemView

public void exportSystemView(String path,
                             OutputStream output,
                             boolean binaryAsLink,
                             boolean noRecurse)
                      throws IOException,
                             RepositoryException
Exports the XML system view of the specified repository location to the given output stream. This method first requests the raw XML data from the remote session, and then writes the data to the output stream.

Specified by:
exportSystemView in interface Session
Throws:
IOException
RepositoryException

exportDocumentView

public void exportDocumentView(String path,
                               ContentHandler handler,
                               boolean binaryAsLink,
                               boolean noRecurse)
                        throws SAXException,
                               RepositoryException
Exports the XML document view of the specified repository location to the given XML content handler. This method first requests the raw XML data from the remote session, and then uses an identity transformation to feed the data to the given XML content handler. Possible IO and transformer exceptions are thrown as SAXExceptions.

Specified by:
exportDocumentView in interface Session
Throws:
SAXException
RepositoryException

exportDocumentView

public void exportDocumentView(String path,
                               OutputStream output,
                               boolean binaryAsLink,
                               boolean noRecurse)
                        throws IOException,
                               RepositoryException
Exports the XML document view of the specified repository location to the given output stream. This method first requests the raw XML data from the remote session, and then writes the data to the output stream.

Specified by:
exportDocumentView in interface Session
Throws:
IOException
RepositoryException

isLive

public boolean isLive()

Specified by:
isLive in interface Session


Copyright © 2004-2006 . All Rights Reserved.