|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.commons.AbstractSession
org.apache.jackrabbit.jcr2spi.SessionImpl
public class SessionImpl
SessionImpl...
| Method Summary | |
|---|---|
void |
addListener(SessionListener listener)
Add a SessionListener |
void |
addLockToken(java.lang.String lt)
|
void |
checkPermission(java.lang.String absPath,
java.lang.String actions)
|
protected ItemManager |
createItemManager(HierarchyManager hierarchyManager)
|
protected SessionItemStateManager |
createSessionItemStateManager(UpdatableItemStateManager workspaceStateManager,
ItemStateFactory isf)
|
protected WorkspaceImpl |
createWorkspaceInstance(RepositoryConfig config,
SessionInfo sessionInfo)
|
AccessManager |
getAccessManager()
|
java.lang.Object |
getAttribute(java.lang.String name)
Always returns null. |
java.lang.String[] |
getAttributeNames()
Always returns an empty String array. |
EffectiveNodeTypeProvider |
getEffectiveNodeTypeProvider()
|
HierarchyManager |
getHierarchyManager()
|
IdFactory |
getIdFactory()
|
org.xml.sax.ContentHandler |
getImportContentHandler(java.lang.String parentAbsPath,
int uuidBehavior)
|
javax.jcr.Item |
getItem(java.lang.String absPath)
Returns the node or property at the given path. |
ItemDefinitionProvider |
getItemDefinitionProvider()
|
javax.jcr.ValueFactory |
getJcrValueFactory()
Same as Session.getValueFactory() but omits the check, if this repository
is really level 2 compliant. |
LockManager |
getLockManager()
Returns the AccessManager associated with this
ManagerProvider. |
java.lang.String[] |
getLockTokens()
|
NameFactory |
getNameFactory()
|
NamePathResolver |
getNamePathResolver()
|
NameResolver |
getNameResolver()
|
NamespaceResolver |
getNamespaceResolver()
|
javax.jcr.Node |
getNodeByUUID(java.lang.String uuid)
|
PathResolver |
getPathResolver()
|
java.lang.String |
getPrefix(java.lang.String uri)
Returns the prefix which is mapped to the given URI. |
QValueFactory |
getQValueFactory()
|
javax.jcr.Repository |
getRepository()
|
javax.jcr.Node |
getRootNode()
|
java.lang.String |
getURI(java.lang.String prefix)
Returns the URI to which the given prefix is mapped. |
java.lang.String |
getUserID()
|
ItemStateValidator |
getValidator()
|
javax.jcr.ValueFactory |
getValueFactory()
|
VersionManager |
getVersionManager()
Returns the VersionManager associated with this
ManagerProvider. |
javax.jcr.Workspace |
getWorkspace()
|
boolean |
hasPendingChanges()
|
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 |
isLive()
|
boolean |
itemExists(java.lang.String absPath)
Calls AbstractSession.getItem(String) with the given path and returns
true if the call succeeds. |
void |
logout()
Clears the local namespace mappings. |
void |
move(java.lang.String srcAbsPath,
java.lang.String destAbsPath)
|
void |
refresh(boolean keepChanges)
|
void |
removeListener(SessionListener listener)
Remove a SessionListener |
void |
removeLockToken(java.lang.String lt)
|
void |
save()
|
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 org.apache.jackrabbit.commons.AbstractSession |
|---|
exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public javax.jcr.Repository getRepository()
getRepository in interface javax.jcr.SessionSession.getRepository()public java.lang.String getUserID()
getUserID in interface javax.jcr.SessionSession.getUserID()public java.lang.Object getAttribute(java.lang.String name)
null.
getAttribute in interface javax.jcr.SessionSession.getAttribute(String)public java.lang.String[] getAttributeNames()
getAttributeNames in interface javax.jcr.SessionSession.getAttributeNames()public javax.jcr.Workspace getWorkspace()
getWorkspace in interface javax.jcr.SessionSession.getWorkspace()
public javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
throws javax.jcr.LoginException,
javax.jcr.RepositoryException
AbstractSessionThe 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.Sessionimpersonate in class AbstractSessioncredentials - login credentials
javax.jcr.RepositoryException - if an error occurs
javax.jcr.LoginExceptionSession.impersonate(Credentials)
public javax.jcr.Node getRootNode()
throws javax.jcr.RepositoryException
getRootNode in interface javax.jcr.Sessionjavax.jcr.RepositoryExceptionSession.getRootNode()
public javax.jcr.Node getNodeByUUID(java.lang.String uuid)
throws javax.jcr.ItemNotFoundException,
javax.jcr.RepositoryException
getNodeByUUID in interface javax.jcr.Sessionjavax.jcr.ItemNotFoundException
javax.jcr.RepositoryExceptionSession.getNodeByUUID(String)
public javax.jcr.Item getItem(java.lang.String absPath)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
AbstractSessionThe 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.SessiongetItem in class AbstractSessionabsPath - absolute path
javax.jcr.PathNotFoundException - if the given path is invalid or not found
javax.jcr.RepositoryException - if another error occursSession.getItem(String)
public boolean itemExists(java.lang.String absPath)
throws javax.jcr.RepositoryException
AbstractSessionAbstractSession.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.SessionitemExists in class AbstractSessionabsPath - absolute path
true if an item exists at the given path,
false otherwise
javax.jcr.RepositoryException - if an error occursSession.itemExists(String)
public void move(java.lang.String srcAbsPath,
java.lang.String destAbsPath)
throws javax.jcr.ItemExistsException,
javax.jcr.PathNotFoundException,
javax.jcr.version.VersionException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.lock.LockException,
javax.jcr.RepositoryException
move in interface javax.jcr.Sessionjavax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryExceptionSession.move(String, String)
public void save()
throws javax.jcr.AccessDeniedException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.InvalidItemStateException,
javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.RepositoryException
save in interface javax.jcr.Sessionjavax.jcr.AccessDeniedException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryExceptionSession.save()
public void refresh(boolean keepChanges)
throws javax.jcr.RepositoryException
refresh in interface javax.jcr.Sessionjavax.jcr.RepositoryExceptionSession.refresh(boolean)
public boolean hasPendingChanges()
throws javax.jcr.RepositoryException
hasPendingChanges in interface javax.jcr.Sessionjavax.jcr.RepositoryExceptionSession.hasPendingChanges()
public javax.jcr.ValueFactory getValueFactory()
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
getValueFactory in interface javax.jcr.Sessionjavax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryExceptionSession.getValueFactory()
public void checkPermission(java.lang.String absPath,
java.lang.String actions)
throws java.security.AccessControlException,
javax.jcr.RepositoryException
checkPermission in interface javax.jcr.Sessionjava.security.AccessControlException
javax.jcr.RepositoryExceptionSession.checkPermission(String, String)
public org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath,
int uuidBehavior)
throws javax.jcr.PathNotFoundException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.RepositoryException
getImportContentHandler in interface javax.jcr.Sessionjavax.jcr.PathNotFoundException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryExceptionSession.getImportContentHandler(String, int)
public void importXML(java.lang.String parentAbsPath,
java.io.InputStream in,
int uuidBehavior)
throws java.io.IOException,
javax.jcr.PathNotFoundException,
javax.jcr.ItemExistsException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.version.VersionException,
javax.jcr.InvalidSerializedDataException,
javax.jcr.lock.LockException,
javax.jcr.RepositoryException
AbstractSessionContentHandler returned by
Session.getImportContentHandler(String, int).
importXML in interface javax.jcr.SessionimportXML in class AbstractSessionparentAbsPath - 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
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockExceptionSession.importXML(String, java.io.InputStream, int)
public void setNamespacePrefix(java.lang.String prefix,
java.lang.String uri)
throws javax.jcr.RepositoryException
AbstractSessionThis behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
setNamespacePrefix in interface javax.jcr.SessionsetNamespacePrefix in class AbstractSessionprefix - namespace prefixuri - namespace URI
javax.jcr.NamespaceException - if the mapping is illegal
javax.jcr.RepositoryException - if a repository error occursSession.setNamespacePrefix(String, String)public void logout()
AbstractSessionsuper.logout() when overriding this method to avoid
namespace mappings to be carried over to a new session.
logout in interface javax.jcr.Sessionlogout in class AbstractSessionSession.logout()public boolean isLive()
isLive in interface javax.jcr.SessionSession.isLive()public void addLockToken(java.lang.String lt)
addLockToken in interface javax.jcr.SessionSession.addLockToken(String)public java.lang.String[] getLockTokens()
getLockTokens in interface javax.jcr.SessionSession.getLockTokens()public void removeLockToken(java.lang.String lt)
removeLockToken in interface javax.jcr.SessionSession.removeLockToken(String)
public java.lang.String getPrefix(java.lang.String uri)
throws javax.jcr.NamespaceException
NamespaceResolver
getPrefix in interface NamespaceResolveruri - namespace URI
javax.jcr.NamespaceException - if the URI is unknown.
public java.lang.String getURI(java.lang.String prefix)
throws javax.jcr.NamespaceException
NamespaceResolver
getURI in interface NamespaceResolverprefix - namespace prefix
javax.jcr.NamespaceException - if the prefix is unknown.public void addListener(SessionListener listener)
SessionListener
listener - the new listener to be informed on modificationspublic void removeListener(SessionListener listener)
SessionListener
listener - an existing listener
protected WorkspaceImpl createWorkspaceInstance(RepositoryConfig config,
SessionInfo sessionInfo)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected SessionItemStateManager createSessionItemStateManager(UpdatableItemStateManager workspaceStateManager,
ItemStateFactory isf)
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected ItemManager createItemManager(HierarchyManager hierarchyManager)
public NamePathResolver getNamePathResolver()
getNamePathResolver in interface ManagerProviderpublic NameResolver getNameResolver()
getNameResolver in interface ManagerProviderManagerProvider.getNameResolver()public PathResolver getPathResolver()
getPathResolver in interface ManagerProviderManagerProvider.getPathResolver()public NamespaceResolver getNamespaceResolver()
getNamespaceResolver in interface ManagerProviderManagerProvider.getNamespaceResolver()public HierarchyManager getHierarchyManager()
getHierarchyManager in interface ManagerProviderManagerProvider.getHierarchyManager()public LockManager getLockManager()
ManagerProviderAccessManager associated with this
ManagerProvider.
getLockManager in interface ManagerProviderAccessManager associated with this
ManagerProviderManagerProvider.getLockManager()public AccessManager getAccessManager()
getAccessManager in interface ManagerProviderManagerProvider.getAccessManager()public VersionManager getVersionManager()
ManagerProviderVersionManager associated with this
ManagerProvider.
getVersionManager in interface ManagerProviderVersionManager associated with this
ManagerProviderManagerProvider.getVersionManager()public ItemDefinitionProvider getItemDefinitionProvider()
getItemDefinitionProvider in interface ManagerProviderManagerProvider.getItemDefinitionProvider()public EffectiveNodeTypeProvider getEffectiveNodeTypeProvider()
getEffectiveNodeTypeProvider in interface ManagerProviderManagerProvider.getEffectiveNodeTypeProvider()
public QValueFactory getQValueFactory()
throws javax.jcr.RepositoryException
getQValueFactory in interface ManagerProviderjavax.jcr.RepositoryExceptionManagerProvider.getQValueFactory()
public javax.jcr.ValueFactory getJcrValueFactory()
throws javax.jcr.RepositoryException
ManagerProviderSession.getValueFactory() but omits the check, if this repository
is really level 2 compliant. Therefore, this method may be used for
internal functionality only, that require creation and conversion of
JCR values.
getJcrValueFactory in interface ManagerProviderjavax.jcr.RepositoryExceptionManagerProvider.getJcrValueFactory()public ItemStateValidator getValidator()
public IdFactory getIdFactory()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public NameFactory getNameFactory()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||