|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.commons.AbstractSession
public abstract class AbstractSession
Abstract base class for implementing the JCR Session interface.
| Constructor Summary | |
|---|---|
AbstractSession()
|
|
| Method Summary | |
|---|---|
void |
exportDocumentView(java.lang.String path,
org.xml.sax.ContentHandler handler,
boolean skipBinary,
boolean noRecurse)
Generates a document view export using a DocumentViewExporter
instance. |
void |
exportDocumentView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
Calls Session.exportDocumentView(String, ContentHandler, boolean, boolean)
with the given arguments and a ContentHandler that serializes
SAX events to the given output stream. |
void |
exportSystemView(java.lang.String path,
org.xml.sax.ContentHandler handler,
boolean skipBinary,
boolean noRecurse)
Generates a system view export using a SystemViewExporter
instance. |
void |
exportSystemView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
Calls Session.exportSystemView(String, ContentHandler, boolean, boolean)
with the given arguments and a ContentHandler that serializes
SAX events to the given output stream. |
javax.jcr.Item |
getItem(java.lang.String absPath)
Returns the node or property at the given path. |
java.lang.String |
getNamespacePrefix(java.lang.String uri)
Returns the namespace prefix mapped to the given URI. |
java.lang.String[] |
getNamespacePrefixes()
Returns the prefixes of all known namespace mappings. |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Returns the namespace URI mapped to the given prefix. |
javax.jcr.Session |
impersonate(javax.jcr.Credentials credentials)
Logs in the same workspace with the given credentials. |
void |
importXML(java.lang.String parentAbsPath,
java.io.InputStream in,
int uuidBehavior)
Parses the given input stream as an XML document and processes the SAX events using the ContentHandler returned by
Session.getImportContentHandler(String, int). |
boolean |
itemExists(java.lang.String absPath)
Calls getItem(String) with the given path and returns
true if the call succeeds. |
void |
logout()
Clears the local namespace mappings. |
void |
setNamespacePrefix(java.lang.String prefix,
java.lang.String uri)
Modifies the session local namespace mappings to contain the given prefix to URI mapping. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jcr.Session |
|---|
addLockToken, checkPermission, getAttribute, getAttributeNames, getImportContentHandler, getLockTokens, getNodeByUUID, getRepository, getRootNode, getUserID, getValueFactory, getWorkspace, hasPendingChanges, isLive, move, refresh, removeLockToken, save |
| Constructor Detail |
|---|
public AbstractSession()
| Method Detail |
|---|
public void logout()
super.logout() when overriding this method to avoid
namespace mappings to be carried over to a new session.
logout in interface javax.jcr.Session
public java.lang.String getNamespacePrefix(java.lang.String uri)
throws javax.jcr.NamespaceException,
javax.jcr.RepositoryException
This behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
getNamespacePrefix in interface javax.jcr.Sessionuri - namespace URI
javax.jcr.NamespaceException - if the namespace is not found
javax.jcr.RepositoryException - if a repository error occurs
public java.lang.String getNamespaceURI(java.lang.String prefix)
throws javax.jcr.NamespaceException,
javax.jcr.RepositoryException
This behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
getNamespaceURI in interface javax.jcr.Sessionprefix - namespace prefix
javax.jcr.NamespaceException - if the namespace is not found
javax.jcr.RepositoryException - if a repository error occurs
public java.lang.String[] getNamespacePrefixes()
throws javax.jcr.RepositoryException
This behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
getNamespacePrefixes in interface javax.jcr.Sessionjavax.jcr.RepositoryException - if a repository error occurs
public void setNamespacePrefix(java.lang.String prefix,
java.lang.String uri)
throws javax.jcr.NamespaceException,
javax.jcr.RepositoryException
This behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
setNamespacePrefix in interface javax.jcr.Sessionprefix - namespace prefixuri - namespace URI
javax.jcr.NamespaceException - if the mapping is illegal
javax.jcr.RepositoryException - if a repository error occurs
public void exportDocumentView(java.lang.String path,
org.xml.sax.ContentHandler handler,
boolean skipBinary,
boolean noRecurse)
throws javax.jcr.PathNotFoundException,
org.xml.sax.SAXException,
javax.jcr.RepositoryException
DocumentViewExporter
instance.
exportDocumentView in interface javax.jcr.Sessionpath - of the node to be exportedhandler - handler for the SAX events of the exportskipBinary - whether binary values should be skippednoRecurse - whether to export just the identified node
javax.jcr.PathNotFoundException - if a node at the given path does not exist
org.xml.sax.SAXException - if the SAX event handler failed
javax.jcr.RepositoryException - if another error occurs
public void exportSystemView(java.lang.String path,
org.xml.sax.ContentHandler handler,
boolean skipBinary,
boolean noRecurse)
throws javax.jcr.PathNotFoundException,
org.xml.sax.SAXException,
javax.jcr.RepositoryException
SystemViewExporter
instance.
exportSystemView in interface javax.jcr.Sessionpath - of the node to be exportedhandler - handler for the SAX events of the exportskipBinary - whether binary values should be skippednoRecurse - whether to export just the identified node
javax.jcr.PathNotFoundException - if a node at the given path does not exist
org.xml.sax.SAXException - if the SAX event handler failed
javax.jcr.RepositoryException - if another error occurs
public void exportDocumentView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
throws java.io.IOException,
javax.jcr.RepositoryException
Session.exportDocumentView(String, ContentHandler, boolean, boolean)
with the given arguments and a ContentHandler that serializes
SAX events to the given output stream.
exportDocumentView in interface javax.jcr.SessionabsPath - passed throughout - output stream to which the SAX events are serializedskipBinary - passed throughnoRecurse - passed through
java.io.IOException - if the SAX serialization failed
javax.jcr.RepositoryException - if another error occurs
public void exportSystemView(java.lang.String absPath,
java.io.OutputStream out,
boolean skipBinary,
boolean noRecurse)
throws java.io.IOException,
javax.jcr.RepositoryException
Session.exportSystemView(String, ContentHandler, boolean, boolean)
with the given arguments and a ContentHandler that serializes
SAX events to the given output stream.
exportSystemView in interface javax.jcr.SessionabsPath - passed throughout - output stream to which the SAX events are serializedskipBinary - passed throughnoRecurse - passed through
java.io.IOException - if the SAX serialization failed
javax.jcr.RepositoryException - if another error occurs
public void importXML(java.lang.String parentAbsPath,
java.io.InputStream in,
int uuidBehavior)
throws java.io.IOException,
javax.jcr.InvalidSerializedDataException,
javax.jcr.RepositoryException
ContentHandler returned by
Session.getImportContentHandler(String, int).
importXML in interface javax.jcr.SessionparentAbsPath - passed throughin - input stream to be parsed as XML and importeduuidBehavior - passed through
java.io.IOException - if an I/O error occurs
javax.jcr.InvalidSerializedDataException - if an XML parsing error occurs
javax.jcr.RepositoryException - if a repository error occurs
public javax.jcr.Item getItem(java.lang.String absPath)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
The default implementation:
PathNotFoundException if the given path
does not start with a slash.
Node.getNode(String) on the root node with the
part of the given path after the first slash
Node.getProperty(String) similarly in case the
above call fails with a PathNotFoundException
getItem in interface javax.jcr.SessionabsPath - absolute path
javax.jcr.PathNotFoundException - if the given path is invalid or not found
javax.jcr.RepositoryException - if another error occurs
public boolean itemExists(java.lang.String absPath)
throws javax.jcr.RepositoryException
getItem(String) with the given path and returns
true if the call succeeds. Returns false
if a PathNotFoundException was thrown. Other exceptions are
passed through.
itemExists in interface javax.jcr.SessionabsPath - absolute path
true if an item exists at the given path,
false otherwise
javax.jcr.RepositoryException - if an error occurs
public javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
throws javax.jcr.RepositoryException
The default implementation:
Repository instance using
Session.getRepository()
Session.getWorkspace()
Workspace.getName()
Repository.login(Credentials, String) on the
retrieved repository with the given credentials and the retrieved
workspace name.
impersonate in interface javax.jcr.Sessioncredentials - login credentials
javax.jcr.RepositoryException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||