|
||||||||||
| 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(String lt)
|
void |
checkPermission(String absPath,
String actions)
|
protected ItemManager |
createItemManager(HierarchyManager hierarchyManager)
|
protected SessionItemStateManager |
createSessionItemStateManager(UpdatableItemStateManager workspaceStateManager,
ItemStateFactory isf)
|
protected WorkspaceImpl |
createWorkspaceInstance(RepositoryConfig config,
SessionInfo sessionInfo)
|
AccessManager |
getAccessManager()
|
Object |
getAttribute(String name)
Always returns null. |
String[] |
getAttributeNames()
Always returns an empty String array. |
EffectiveNodeTypeProvider |
getEffectiveNodeTypeProvider()
|
HierarchyManager |
getHierarchyManager()
|
IdFactory |
getIdFactory()
|
ContentHandler |
getImportContentHandler(String parentAbsPath,
int uuidBehavior)
|
Item |
getItem(String absPath)
Returns the node or property at the given path. |
ItemDefinitionProvider |
getItemDefinitionProvider()
|
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. |
String[] |
getLockTokens()
|
NameFactory |
getNameFactory()
|
NamePathResolver |
getNamePathResolver()
|
NameResolver |
getNameResolver()
|
NamespaceResolver |
getNamespaceResolver()
|
Node |
getNodeByUUID(String uuid)
|
PathResolver |
getPathResolver()
|
String |
getPrefix(String uri)
Returns the prefix which is mapped to the given URI. |
QValueFactory |
getQValueFactory()
|
Repository |
getRepository()
|
Node |
getRootNode()
|
String |
getURI(String prefix)
Returns the URI to which the given prefix is mapped. |
String |
getUserID()
|
ItemStateValidator |
getValidator()
|
ValueFactory |
getValueFactory()
|
VersionManager |
getVersionManager()
Returns the VersionManager associated with this
ManagerProvider. |
Workspace |
getWorkspace()
|
boolean |
hasPendingChanges()
|
Session |
impersonate(Credentials credentials)
Logs in the same workspace with the given credentials. |
void |
importXML(String parentAbsPath,
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(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(String srcAbsPath,
String destAbsPath)
|
void |
refresh(boolean keepChanges)
|
void |
removeListener(SessionListener listener)
Remove a SessionListener |
void |
removeLockToken(String lt)
|
void |
save()
|
void |
setNamespacePrefix(String prefix,
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 Repository getRepository()
getRepository in interface SessionSession.getRepository()public String getUserID()
getUserID in interface SessionSession.getUserID()public Object getAttribute(String name)
null.
getAttribute in interface SessionSession.getAttribute(String)public String[] getAttributeNames()
getAttributeNames in interface SessionSession.getAttributeNames()public Workspace getWorkspace()
getWorkspace in interface SessionSession.getWorkspace()
public Session impersonate(Credentials credentials)
throws LoginException,
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 Sessionimpersonate in class AbstractSessioncredentials - login credentials
RepositoryException - if an error occurs
LoginExceptionSession.impersonate(Credentials)
public Node getRootNode()
throws RepositoryException
getRootNode in interface SessionRepositoryExceptionSession.getRootNode()
public Node getNodeByUUID(String uuid)
throws ItemNotFoundException,
RepositoryException
getNodeByUUID in interface SessionItemNotFoundException
RepositoryExceptionSession.getNodeByUUID(String)
public Item getItem(String absPath)
throws PathNotFoundException,
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 SessiongetItem in class AbstractSessionabsPath - absolute path
PathNotFoundException - if the given path is invalid or not found
RepositoryException - if another error occursSession.getItem(String)
public boolean itemExists(String absPath)
throws 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 SessionitemExists in class AbstractSessionabsPath - absolute path
true if an item exists at the given path,
false otherwise
RepositoryException - if an error occursSession.itemExists(String)
public void move(String srcAbsPath,
String destAbsPath)
throws ItemExistsException,
PathNotFoundException,
VersionException,
ConstraintViolationException,
LockException,
RepositoryException
move in interface SessionItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryExceptionSession.move(String, String)
public void save()
throws AccessDeniedException,
ConstraintViolationException,
InvalidItemStateException,
VersionException,
LockException,
RepositoryException
save in interface SessionAccessDeniedException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
RepositoryExceptionSession.save()
public void refresh(boolean keepChanges)
throws RepositoryException
refresh in interface SessionRepositoryExceptionSession.refresh(boolean)
public boolean hasPendingChanges()
throws RepositoryException
hasPendingChanges in interface SessionRepositoryExceptionSession.hasPendingChanges()
public ValueFactory getValueFactory()
throws UnsupportedRepositoryOperationException,
RepositoryException
getValueFactory in interface SessionUnsupportedRepositoryOperationException
RepositoryExceptionSession.getValueFactory()
public void checkPermission(String absPath,
String actions)
throws AccessControlException,
RepositoryException
checkPermission in interface SessionAccessControlException
RepositoryExceptionSession.checkPermission(String, String)
public ContentHandler getImportContentHandler(String parentAbsPath,
int uuidBehavior)
throws PathNotFoundException,
ConstraintViolationException,
VersionException,
LockException,
RepositoryException
getImportContentHandler in interface SessionPathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryExceptionSession.getImportContentHandler(String, int)
public void importXML(String parentAbsPath,
InputStream in,
int uuidBehavior)
throws IOException,
PathNotFoundException,
ItemExistsException,
ConstraintViolationException,
VersionException,
InvalidSerializedDataException,
LockException,
RepositoryException
AbstractSessionContentHandler returned by
Session.getImportContentHandler(String, int).
importXML in interface SessionimportXML in class AbstractSessionparentAbsPath - passed throughin - input stream to be parsed as XML and importeduuidBehavior - passed through
IOException - if an I/O error occurs
InvalidSerializedDataException - if an XML parsing error occurs
RepositoryException - if a repository error occurs
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
LockExceptionSession.importXML(String, java.io.InputStream, int)
public void setNamespacePrefix(String prefix,
String uri)
throws RepositoryException
AbstractSessionThis behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
setNamespacePrefix in interface SessionsetNamespacePrefix in class AbstractSessionprefix - namespace prefixuri - namespace URI
NamespaceException - if the mapping is illegal
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 Sessionlogout in class AbstractSessionSession.logout()public boolean isLive()
isLive in interface SessionSession.isLive()public void addLockToken(String lt)
addLockToken in interface SessionSession.addLockToken(String)public String[] getLockTokens()
getLockTokens in interface SessionSession.getLockTokens()public void removeLockToken(String lt)
removeLockToken in interface SessionSession.removeLockToken(String)
public String getPrefix(String uri)
throws NamespaceException
NamespaceResolver
getPrefix in interface NamespaceResolveruri - namespace URI
NamespaceException - if the URI is unknown.
public String getURI(String prefix)
throws NamespaceException
NamespaceResolver
getURI in interface NamespaceResolverprefix - namespace prefix
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 RepositoryException
RepositoryException
protected SessionItemStateManager createSessionItemStateManager(UpdatableItemStateManager workspaceStateManager,
ItemStateFactory isf)
throws RepositoryException
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 RepositoryException
getQValueFactory in interface ManagerProviderRepositoryExceptionManagerProvider.getQValueFactory()
public ValueFactory getJcrValueFactory()
throws 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 ManagerProviderRepositoryExceptionManagerProvider.getJcrValueFactory()public ItemStateValidator getValidator()
public IdFactory getIdFactory()
throws RepositoryException
RepositoryException
public NameFactory getNameFactory()
throws RepositoryException
RepositoryException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||