Package org.apache.jackrabbit.core
Class SessionImpl
- java.lang.Object
-
- org.apache.jackrabbit.commons.AbstractSession
-
- org.apache.jackrabbit.core.SessionImpl
-
- All Implemented Interfaces:
Session,JackrabbitSession,IdentifierResolver,NamePathResolver,NameResolver,PathResolver,NamespaceResolver,SessionExtensions
- Direct Known Subclasses:
XASessionImpl
public class SessionImpl extends AbstractSession implements JackrabbitSession, SessionExtensions, NamespaceResolver, NamePathResolver, IdentifierResolver
ASessionImpl...
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>attributesthe attributes of this sessionstatic StringAUTO_FIX_CORRUPTIONSName of the session attribute that controls whether repository inconsistencies should be automatically fixed when traversing over child nodes, when trying to add a child node, or removing a child node.protected SessionContextcontextThe component context of this session.static StringDISABLE_CLUSTER_SYNC_ON_REFRESHName of the session attribute that controls whether therefresh(boolean)method will cause the repository to synchronize itself to changes in other cluster nodes.protected Map<SessionListener,SessionListener>listenersListeners (weak references)protected AuthContextloginContextthe AuthContext of this session (can be null if this session was not instantiated through a login process)protected NamePathResolvernamePathResolverName and Path resolverprotected RepositoryContextrepositoryContextThe component context of the repository that issued this session.protected Subjectsubjectthe Subject of this sessionprotected StringuserIdthe user ID that was used to acquire this sessionprotected InternalVersionManagerversionMgrThe version manager for this session-
Fields inherited from interface org.apache.jackrabbit.api.JackrabbitSession
ACTION_ADD_PROPERTY, ACTION_LOCKING, ACTION_MODIFY_ACCESS_CONTROL, ACTION_MODIFY_PROPERTY, ACTION_NODE_TYPE_MANAGEMENT, ACTION_READ_ACCESS_CONTROL, ACTION_REMOVE_NODE, ACTION_REMOVE_PROPERTY, ACTION_USER_MANAGEMENT, ACTION_VERSIONING
-
Fields inherited from interface javax.jcr.Session
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSessionImpl(RepositoryContext repositoryContext, Subject subject, WorkspaceConfig wspConfig)Protected constructor.protectedSessionImpl(RepositoryContext repositoryContext, AuthContext loginContext, WorkspaceConfig wspConfig)Protected constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(SessionListener listener)Add aSessionListenervoidaddLockToken(String lt)protected booleanautoFixCorruptions()Checks whether repository inconsistencies should be automatically fixed when traversing over child nodes, when trying to add a child node, or when removing a child node.voidcheckFormat(String identifier)voidcheckPermission(String absPath, String actions)protected booleanclusterSyncOnRefresh()Checks whether therefresh(boolean)method should cause cluster synchronization.protected AccessManagercreateAccessManager(Subject subject)Create the access manager.GarbageCollectorcreateDataStoreGarbageCollector()Create a data store garbage collector for this repository.protected ItemManagercreateItemManager()Create the item manager.protected ObservationManagerImplcreateObservationManager(String wspName)SessioncreateSession(String workspaceName)Creates a new session with the same subject as this sessions but to a different workspace.protected SessionItemStateManagercreateSessionItemStateManager()Create the session item state manager.protected InternalVersionManagercreateVersionManager()Create the version manager.voidfinalize()Finalize the session.AccessControlManagergetAccessControlManager()AccessManagergetAccessManager()Returns theAccessManagerassociated with this session.ObjectgetAttribute(String name)String[]getAttributeNames()HierarchyManagergetHierarchyManager()Returns theHierarchyManagerassociated with this session.ContentHandlergetImportContentHandler(String parentAbsPath, int uuidBehavior)InternalVersionManagergetInternalVersionManager()Returns theInternalVersionManagerassociated with this session.ItemgetItem(String absPath)Returns the node or property at the given path.ItemManagergetItemManager()Returns theItemManagerof this session.ItemgetItemOrNull(String absPath)StringgetJCRName(Name name)Returns the qualified JCR name String for the givenNameobject.StringgetJCRPath(Path path)Returns the given JCR path string for the given path object.Lock[]getLocks()Returns all locks owned by this session.String[]getLockTokens()NodegetNode(String absPath)Returns the node with the given absolute path.NodeImplgetNodeById(NodeId id)Retrieves theNodewith the given id.NodegetNodeByIdentifier(String id)NodegetNodeByUUID(String uuid)NodegetNodeOrNull(String absPath)NodeTypeManagerImplgetNodeTypeManager()Returns theNodeTypeManager.PathgetPath(String identifier)StringgetPrefix(String uri)Returns the prefix which is mapped to the given URI.PrincipalManagergetPrincipalManager()PropertygetProperty(String absPath)Returns the property with the given absolute path.PropertygetPropertyOrNull(String absPath)NamegetQName(String name)Returns theNamefor the given JCR name String.PathgetQPath(String path)Returns the path object for the given JCR path string.PathgetQPath(String path, boolean normalizeIdentifier)Returns the path object for the given JCR path string.RepositorygetRepository()RetentionManagergetRetentionManager()protected RetentionRegistrygetRetentionRegistry()Returns the internal retention manager used for evaluation of effective retention policies and holds.NodegetRootNode()SubjectgetSubject()Returns a read only copy of theSubjectassociated with this session.StringgetURI(String prefix)Returns the URI to which the given prefix is mapped.StringgetUserID()UserManagergetUserManager()ValueFactorygetValueFactory()WorkspacegetWorkspace()booleanhasCapability(String methodName, Object target, Object[] arguments)booleanhasPendingChanges()booleanhasPermission(String absPath, String actions)booleanhasPermission(String absPath, String... actions)Sessionimpersonate(Credentials otherCredentials)Logs in the same workspace with the given credentials.booleanisAdmin()Returnstrueif this session has been created for the administrator.booleanisLive()booleanisSystem()Returnstrueif the subject contains aSystemPrincipal;falseotherwise.booleanitemExists(String absPath)CallsAbstractSession.getItem(String)with the given path and returnstrueif the call succeeds.voidlogout()Invalidates this session and releases all associated resources.voidmove(String srcAbsPath, String destAbsPath)booleannodeExists(String absPath)Checks whether a node with the given absolute path exists.protected voidnotifyLoggedOut()Notify the listeners that this session has been closed.protected voidnotifyLoggingOut()Notify the listeners that this session is about to be closed.booleanpropertyExists(String absPath)Checks whether a property with the given absolute path exists.voidrefresh(boolean keepChanges)voidremoveItem(String absPath)Removes the identified item.voidremoveListener(SessionListener listener)Remove aSessionListenervoidremoveLockToken(String lt)protected StringretrieveUserId(Subject subject, String workspaceName)Retrieve the userID from the specified subject.voidsave()voidsetAttribute(String name, Object value)Sets the named attribute.voidsetNamespacePrefix(String prefix, String uri)Modifies the session local namespace mappings to contain the given prefix to URI mapping.StringtoString()Returns the unique internal name of this session.-
Methods inherited from class org.apache.jackrabbit.commons.AbstractSession
exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, importXML
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.api.JackrabbitSession
getParentOrNull
-
Methods inherited from interface javax.jcr.Session
exportDocumentView, exportDocumentView, exportSystemView, exportSystemView, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, importXML
-
-
-
-
Field Detail
-
DISABLE_CLUSTER_SYNC_ON_REFRESH
public static final String DISABLE_CLUSTER_SYNC_ON_REFRESH
Name of the session attribute that controls whether therefresh(boolean)method will cause the repository to synchronize itself to changes in other cluster nodes. This cluster synchronization is enabled by default, unless an attribute with this name is set (any non-null value) for this session.- Since:
- Apache Jackrabbit 1.6
- See Also:
- JCR-1753, Constant Field Values
-
AUTO_FIX_CORRUPTIONS
public static final String AUTO_FIX_CORRUPTIONS
Name of the session attribute that controls whether repository inconsistencies should be automatically fixed when traversing over child nodes, when trying to add a child node, or removing a child node.- Since:
- Apache Jackrabbit 2.2
- See Also:
- JCR-2740, Constant Field Values
-
context
protected final SessionContext context
The component context of this session.
-
repositoryContext
protected final RepositoryContext repositoryContext
The component context of the repository that issued this session.
-
loginContext
protected AuthContext loginContext
the AuthContext of this session (can be null if this session was not instantiated through a login process)
-
subject
protected final Subject subject
the Subject of this session
-
userId
protected final String userId
the user ID that was used to acquire this session
-
namePathResolver
protected NamePathResolver namePathResolver
Name and Path resolver
-
versionMgr
protected final InternalVersionManager versionMgr
The version manager for this session
-
listeners
protected final Map<SessionListener,SessionListener> listeners
Listeners (weak references)
-
-
Constructor Detail
-
SessionImpl
protected SessionImpl(RepositoryContext repositoryContext, AuthContext loginContext, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
Protected constructor.- Parameters:
repositoryContext- repository contextloginContext-wspConfig-- Throws:
AccessDeniedException- if the subject of the given login context is not granted access to the specified workspaceRepositoryException- if another error occurs
-
SessionImpl
protected SessionImpl(RepositoryContext repositoryContext, Subject subject, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
Protected constructor.- Parameters:
repositoryContext- repository contextsubject-wspConfig-- Throws:
AccessDeniedException- if the given subject is not granted access to the specified workspaceRepositoryException- if another error occurs
-
-
Method Detail
-
retrieveUserId
protected String retrieveUserId(Subject subject, String workspaceName) throws RepositoryException
Retrieve the userID from the specified subject.- Returns:
- the userID.
- Throws:
RepositoryException
-
createSessionItemStateManager
protected SessionItemStateManager createSessionItemStateManager()
Create the session item state manager.- Returns:
- session item state manager
-
createItemManager
protected ItemManager createItemManager()
Create the item manager.- Returns:
- item manager
-
createObservationManager
protected ObservationManagerImpl createObservationManager(String wspName) throws RepositoryException
- Throws:
RepositoryException
-
createVersionManager
protected InternalVersionManager createVersionManager() throws RepositoryException
Create the version manager. If we are not using XA, we may safely use the repository version manager.- Returns:
- version manager
- Throws:
RepositoryException
-
createAccessManager
protected AccessManager createAccessManager(Subject subject) throws AccessDeniedException, RepositoryException
Create the access manager.- Parameters:
subject-- Returns:
- access manager
- Throws:
AccessDeniedException- if the current subject is not granted access to the current workspaceRepositoryException- if the access manager cannot be instantiated
-
getSubject
public Subject getSubject()
Returns a read only copy of theSubjectassociated with this session.- Returns:
- a read only copy of
Subjectassociated with this session
-
isSystem
public boolean isSystem()
Returnstrueif the subject contains aSystemPrincipal;falseotherwise.- Returns:
trueif this is an system session.
-
isAdmin
public boolean isAdmin()
Returnstrueif this session has been created for the administrator.Falseotherwise.- Returns:
trueif this is an admin session.
-
createSession
public Session createSession(String workspaceName) throws AccessDeniedException, NoSuchWorkspaceException, RepositoryException
Creates a new session with the same subject as this sessions but to a different workspace. The returned session is a newly logged in session, with the same subject but a different workspace. Even if the given workspace is the same as this sessions one, the implementation must return a new session object.- Parameters:
workspaceName- name of the workspace to acquire a session for.- Returns:
- A session to the requested workspace for the same authenticated subject.
- Throws:
AccessDeniedException- in case the current Subject is not allowed to access the requested WorkspaceNoSuchWorkspaceException- If the named workspace does not exist.RepositoryException- in any other exceptional state
-
getAccessManager
public AccessManager getAccessManager()
Returns theAccessManagerassociated with this session.- Returns:
- the
AccessManagerassociated with this session
-
getNodeTypeManager
public NodeTypeManagerImpl getNodeTypeManager()
Returns theNodeTypeManager.- Returns:
- the
NodeTypeManager
-
getItemManager
public ItemManager getItemManager()
Returns theItemManagerof this session.- Returns:
- the
ItemManager
-
getHierarchyManager
public HierarchyManager getHierarchyManager()
Returns theHierarchyManagerassociated with this session.- Returns:
- the
HierarchyManagerassociated with this session
-
getInternalVersionManager
public InternalVersionManager getInternalVersionManager()
Returns theInternalVersionManagerassociated with this session.- Returns:
- the
InternalVersionManagerassociated with this session
-
getRetentionRegistry
protected RetentionRegistry getRetentionRegistry() throws RepositoryException
Returns the internal retention manager used for evaluation of effective retention policies and holds.- Returns:
- internal retention manager
- Throws:
RepositoryException
-
setAttribute
public void setAttribute(String name, Object value)
Sets the named attribute. If the value isnull, then the named attribute is removed.- Specified by:
setAttributein interfaceSessionExtensions- Parameters:
name- attribute namevalue- attribute value- Since:
- Apache Jackrabbit 1.6
- See Also:
- JCR-1932
-
getNodeById
public NodeImpl getNodeById(NodeId id) throws ItemNotFoundException, RepositoryException
Retrieves theNodewith the given id.- Parameters:
id- id of node to be retrieved- Returns:
- node with the given
NodeId. - Throws:
ItemNotFoundException- if no such node exists or if thisSessiondoes not have permission to access the node.RepositoryException- if another error occurs.
-
notifyLoggingOut
protected void notifyLoggingOut()
Notify the listeners that this session is about to be closed.
-
notifyLoggedOut
protected void notifyLoggedOut()
Notify the listeners that this session has been closed.
-
addListener
public void addListener(SessionListener listener)
Add aSessionListener- Parameters:
listener- the new listener to be informed on modifications
-
removeListener
public void removeListener(SessionListener listener)
Remove aSessionListener- Parameters:
listener- an existing listener
-
createDataStoreGarbageCollector
public GarbageCollector createDataStoreGarbageCollector() throws RepositoryException
Create a data store garbage collector for this repository.- Throws:
RepositoryException
-
getPrefix
public String getPrefix(String uri) throws NamespaceException
Description copied from interface:NamespaceResolverReturns the prefix which is mapped to the given URI.- Specified by:
getPrefixin interfaceNamespaceResolver- Parameters:
uri- namespace URI- Returns:
- the prefix mapped to the given URI.
- Throws:
NamespaceException- if the URI is unknown.
-
getURI
public String getURI(String prefix) throws NamespaceException
Description copied from interface:NamespaceResolverReturns the URI to which the given prefix is mapped.- Specified by:
getURIin interfaceNamespaceResolver- Parameters:
prefix- namespace prefix- Returns:
- the namespace URI to which the given prefix is mapped.
- Throws:
NamespaceException- if the prefix is unknown.
-
getJCRName
public String getJCRName(Name name) throws NamespaceException
Description copied from interface:NameResolverReturns the qualified JCR name String for the givenNameobject.- Specified by:
getJCRNamein interfaceNameResolver- Parameters:
name- ANameobject.- Returns:
- The qualified JCR name String consisting of
prefix:localNameorlocalNamein case of the empty namespace. - Throws:
NamespaceException- if the namespace URI can not be resolved
-
getQName
public Name getQName(String name) throws IllegalNameException, NamespaceException
Description copied from interface:NameResolverReturns theNamefor the given JCR name String.- Specified by:
getQNamein interfaceNameResolver- Parameters:
name- A JCR name String.- Returns:
- A
Nameobject. - Throws:
IllegalNameException- if the JCR name format is invalidNamespaceException- if the namespace prefix can not be resolved
-
getJCRPath
public String getJCRPath(Path path) throws NamespaceException
Description copied from interface:PathResolverReturns the given JCR path string for the given path object.- Specified by:
getJCRPathin interfacePathResolver- Parameters:
path- aPathobject.- Returns:
- a JCR path string
- Throws:
NamespaceException- if a namespace URI can not be resolved
-
getQPath
public Path getQPath(String path) throws MalformedPathException, IllegalNameException, NamespaceException
Description copied from interface:PathResolverReturns the path object for the given JCR path string.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- prefixed JCR path- Returns:
- a
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalid.IllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.
-
getQPath
public Path getQPath(String path, boolean normalizeIdentifier) throws MalformedPathException, IllegalNameException, NamespaceException
Description copied from interface:PathResolverReturns the path object for the given JCR path string.- Specified by:
getQPathin interfacePathResolver- Parameters:
path- prefixed JCR path- Returns:
- a
Pathobject. - Throws:
MalformedPathException- if the JCR path format is invalid.IllegalNameException- if any of the JCR names contained in the path are invalid.NamespaceException- if a namespace prefix can not be resolved.
-
getPath
public Path getPath(String identifier) throws MalformedPathException
- Specified by:
getPathin interfaceIdentifierResolver- Throws:
MalformedPathException- See Also:
IdentifierResolver.getPath(String)
-
checkFormat
public void checkFormat(String identifier) throws MalformedPathException
- Specified by:
checkFormatin interfaceIdentifierResolver- Throws:
MalformedPathException- See Also:
IdentifierResolver.checkFormat(String)
-
hasPermission
public boolean hasPermission(String absPath, String... actions) throws RepositoryException
- Specified by:
hasPermissionin interfaceJackrabbitSession- Throws:
RepositoryException- See Also:
JackrabbitSession.hasPermission(String, String...)
-
getPrincipalManager
public PrincipalManager getPrincipalManager() throws RepositoryException, AccessDeniedException
- Specified by:
getPrincipalManagerin interfaceJackrabbitSession- Throws:
RepositoryExceptionAccessDeniedException- See Also:
JackrabbitSession.getPrincipalManager()
-
getUserManager
public UserManager getUserManager() throws AccessDeniedException, RepositoryException
- Specified by:
getUserManagerin interfaceJackrabbitSession- Throws:
AccessDeniedExceptionRepositoryException- See Also:
JackrabbitSession.getUserManager()
-
getItemOrNull
public Item getItemOrNull(String absPath) throws RepositoryException
- Specified by:
getItemOrNullin interfaceJackrabbitSession- Throws:
RepositoryException
-
getPropertyOrNull
public Property getPropertyOrNull(String absPath) throws RepositoryException
- Specified by:
getPropertyOrNullin interfaceJackrabbitSession- Throws:
RepositoryException
-
getNodeOrNull
public Node getNodeOrNull(String absPath) throws RepositoryException
- Specified by:
getNodeOrNullin interfaceJackrabbitSession- Throws:
RepositoryException
-
checkPermission
public void checkPermission(String absPath, String actions) throws AccessControlException, RepositoryException
- Specified by:
checkPermissionin interfaceSession- Throws:
AccessControlExceptionRepositoryException
-
getWorkspace
public Workspace getWorkspace()
- Specified by:
getWorkspacein interfaceSession
-
impersonate
public Session impersonate(Credentials otherCredentials) throws LoginException, RepositoryException
Logs in the same workspace with the given credentials.The default implementation:
- Retrieves the
Repositoryinstance usingSession.getRepository() - Retrieves the current workspace using
Session.getWorkspace() - Retrieves the name of the current workspace using
Workspace.getName() - Calls
Repository.login(Credentials, String)on the retrieved repository with the given credentials and the retrieved workspace name.
- Specified by:
impersonatein interfaceSession- Overrides:
impersonatein classAbstractSession- Parameters:
otherCredentials- login credentials- Returns:
- logged in session
- Throws:
RepositoryException- if an error occursLoginException
- Retrieves the
-
getRootNode
public Node getRootNode() throws RepositoryException
- Specified by:
getRootNodein interfaceSession- Throws:
RepositoryException
-
getNodeByUUID
public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
- Specified by:
getNodeByUUIDin interfaceSession- Throws:
ItemNotFoundExceptionRepositoryException
-
getItem
public Item getItem(String absPath) throws RepositoryException
Returns the node or property at the given path.The default implementation:
- Returns the root node if the given path is "/"
- Delegates to
Session.getNodeByIdentifier(String)for identifier paths - Throws a
PathNotFoundExceptionif the given path does not start with a slash. - Calls
Node.getNode(String)on the root node with the part of the given path after the first slash - Calls
Node.getProperty(String)similarly in case the above call fails with aPathNotFoundException
- Specified by:
getItemin interfaceSession- Overrides:
getItemin classAbstractSession- Parameters:
absPath- absolute path- Returns:
- the node or property with the given path
- Throws:
PathNotFoundException- if the given path is invalid or not foundRepositoryException- if another error occurs- See Also:
Session.getItem(String)
-
itemExists
public boolean itemExists(String absPath) throws RepositoryException
CallsAbstractSession.getItem(String)with the given path and returnstrueif the call succeeds. Returnsfalseif aPathNotFoundExceptionwas thrown. Other exceptions are passed through.- Specified by:
itemExistsin interfaceSession- Overrides:
itemExistsin classAbstractSession- Parameters:
absPath- absolute path- Returns:
trueif an item exists at the given path,falseotherwise- Throws:
RepositoryException- if an error occurs- See Also:
Session.itemExists(String)
-
save
public void save() throws RepositoryException- Specified by:
savein interfaceSession- Throws:
RepositoryException
-
refresh
public void refresh(boolean keepChanges) throws RepositoryException- Specified by:
refreshin interfaceSession- Throws:
RepositoryException
-
clusterSyncOnRefresh
protected boolean clusterSyncOnRefresh()
Checks whether therefresh(boolean)method should cause cluster synchronization.Subclasses can override this method to implement alternative rules on when cluster synchronization should be done.
- Returns:
trueif theDISABLE_CLUSTER_SYNC_ON_REFRESHattribute is not set,falseotherwise- Since:
- Apache Jackrabbit 1.6
- See Also:
- JCR-1753
-
autoFixCorruptions
protected boolean autoFixCorruptions()
Checks whether repository inconsistencies should be automatically fixed when traversing over child nodes, when trying to add a child node, or when removing a child node.- Returns:
trueif theAUTO_FIX_CORRUPTIONSattribute is set,falseotherwise- Since:
- Apache Jackrabbit 2.2
- See Also:
- JCR-2740
-
hasPendingChanges
public boolean hasPendingChanges() throws RepositoryException- Specified by:
hasPendingChangesin interfaceSession- Throws:
RepositoryException
-
move
public void move(String srcAbsPath, String destAbsPath) throws RepositoryException
- Specified by:
movein interfaceSession- Throws:
RepositoryException
-
getImportContentHandler
public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
- Specified by:
getImportContentHandlerin interfaceSession- Throws:
PathNotFoundExceptionConstraintViolationExceptionVersionExceptionLockExceptionRepositoryException
-
logout
public void logout()
Invalidates this session and releases all associated resources.- Specified by:
logoutin interfaceSession- Overrides:
logoutin classAbstractSession
-
getRepository
public Repository getRepository()
- Specified by:
getRepositoryin interfaceSession
-
getValueFactory
public ValueFactory getValueFactory()
- Specified by:
getValueFactoryin interfaceSession
-
getAttribute
public Object getAttribute(String name)
- Specified by:
getAttributein interfaceSession
-
getAttributeNames
public String[] getAttributeNames()
- Specified by:
getAttributeNamesin interfaceSession
-
setNamespacePrefix
public void setNamespacePrefix(String prefix, String uri) throws NamespaceException, RepositoryException
Modifies the session local namespace mappings to contain the given prefix to URI mapping.This behaviour is based on JSR 283 (JCR 2.0), but remains backwards compatible with JCR 1.0.
- Specified by:
setNamespacePrefixin interfaceSession- Overrides:
setNamespacePrefixin classAbstractSession- Parameters:
prefix- namespace prefixuri- namespace URI- Throws:
NamespaceException- if the mapping is illegalRepositoryException- if a repository error occurs
-
addLockToken
public void addLockToken(String lt)
- Specified by:
addLockTokenin interfaceSession
-
getLockTokens
public String[] getLockTokens()
- Specified by:
getLockTokensin interfaceSession
-
removeLockToken
public void removeLockToken(String lt)
- Specified by:
removeLockTokenin interfaceSession
-
getLocks
public Lock[] getLocks()
Returns all locks owned by this session.- Returns:
- an array of
Locks
-
getNodeByIdentifier
public Node getNodeByIdentifier(String id) throws ItemNotFoundException, RepositoryException
- Specified by:
getNodeByIdentifierin interfaceSession- Throws:
ItemNotFoundExceptionRepositoryException- Since:
- JCR 2.0
- See Also:
Session.getNodeByIdentifier(String)
-
getNode
public Node getNode(String absPath) throws RepositoryException
Description copied from class:AbstractSessionReturns the node with the given absolute path.- Specified by:
getNodein interfaceSession- Overrides:
getNodein classAbstractSession- Parameters:
absPath- absolute path- Returns:
- node at the given path
- Throws:
RepositoryException- if the node can not be accessed- Since:
- JCR 2.0
- See Also:
Session.getNode(String)
-
getProperty
public Property getProperty(String absPath) throws RepositoryException
Description copied from class:AbstractSessionReturns the property with the given absolute path.- Specified by:
getPropertyin interfaceSession- Overrides:
getPropertyin classAbstractSession- Parameters:
absPath- absolute path- Returns:
- node at the given path
- Throws:
RepositoryException- if the property can not be accessed- Since:
- JCR 2.0
- See Also:
Session.getProperty(String)
-
nodeExists
public boolean nodeExists(String absPath) throws RepositoryException
Description copied from class:AbstractSessionChecks whether a node with the given absolute path exists.- Specified by:
nodeExistsin interfaceSession- Overrides:
nodeExistsin classAbstractSession- Parameters:
absPath- absolute path- Returns:
trueif a node with the given path exists,falseotherwise- Throws:
RepositoryException- if the path is invalid- Since:
- JCR 2.0
- See Also:
Session.nodeExists(String)
-
propertyExists
public boolean propertyExists(String absPath) throws RepositoryException
Description copied from class:AbstractSessionChecks whether a property with the given absolute path exists.- Specified by:
propertyExistsin interfaceSession- Overrides:
propertyExistsin classAbstractSession- Parameters:
absPath- absolute path- Returns:
trueif a property with the given path exists,falseotherwise- Throws:
RepositoryException- if the path is invalid- Since:
- JCR 2.0
- See Also:
Session.propertyExists(String)
-
removeItem
public void removeItem(String absPath) throws RepositoryException
Description copied from class:AbstractSessionRemoves the identified item. Implemented by callingItem.remove()on the item removed byAbstractSession.getItem(String).- Specified by:
removeItemin interfaceSession- Overrides:
removeItemin classAbstractSession- Parameters:
absPath- An absolute path of the item to be removed- Throws:
RepositoryException- if the item can not be removed- Since:
- JCR 2.0
- See Also:
Session.removeItem(String)
-
hasPermission
public boolean hasPermission(String absPath, String actions) throws RepositoryException
- Specified by:
hasPermissionin interfaceSession- Throws:
RepositoryException- Since:
- 2.0
- See Also:
Session.hasPermission(String, String)
-
hasCapability
public boolean hasCapability(String methodName, Object target, Object[] arguments) throws RepositoryException
- Specified by:
hasCapabilityin interfaceSession- Throws:
RepositoryException- Since:
- JCR 2.0
- See Also:
Session.hasCapability(String, Object, Object[])
-
getAccessControlManager
public AccessControlManager getAccessControlManager() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getAccessControlManagerin interfaceSession- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- Since:
- JCR 2.0
- See Also:
Session.getAccessControlManager()
-
getRetentionManager
public RetentionManager getRetentionManager() throws UnsupportedRepositoryOperationException, RepositoryException
- Specified by:
getRetentionManagerin interfaceSession- Throws:
UnsupportedRepositoryOperationExceptionRepositoryException- Since:
- JCR 2.0
- See Also:
Session.getRetentionManager()
-
toString
public String toString()
Returns the unique internal name of this session. The returned name is especially useful for debugging and logging purposes.- Overrides:
toStringin classObject- Returns:
- session name
- See Also:
sessionName
-
-