org.apache.jackrabbit.jcr2spi
Class SessionImpl

java.lang.Object
  extended by org.apache.jackrabbit.commons.AbstractSession
      extended by org.apache.jackrabbit.jcr2spi.SessionImpl
All Implemented Interfaces:
Session, ManagerProvider, NamespaceResolver
Direct Known Subclasses:
XASessionImpl

public class SessionImpl
extends AbstractSession
implements NamespaceResolver, ManagerProvider

SessionImpl...


Field Summary
 
Fields inherited from interface javax.jcr.Session
ACTION_ADD_NODE, ACTION_READ, ACTION_REMOVE, ACTION_SET_PROPERTY
 
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)
           
 AccessControlManager getAccessControlManager()
           
 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)
           
 Item getItem(java.lang.String absPath)
           
 ItemDefinitionProvider getItemDefinitionProvider()
           
 ValueFactory getJcrValueFactory()
          Same as Session.getValueFactory() but omits the check, if this repository is really level 2 compliant.
 LockStateManager getLockStateManager()
          Returns the LockStateManager associated with this ManagerProvider.
 java.lang.String[] getLockTokens()
           
 NameFactory getNameFactory()
           
 NamePathResolver getNamePathResolver()
           
 NameResolver getNameResolver()
           
 NamespaceResolver getNamespaceResolver()
           
 Node getNode(java.lang.String absPath)
           
 Node getNodeByIdentifier(java.lang.String id)
           
 Node getNodeByUUID(java.lang.String uuid)
           
 NodeTypeDefinitionProvider getNodeTypeDefinitionProvider()
           
 PathResolver getPathResolver()
           
 java.lang.String getPrefix(java.lang.String uri)
           
 Property getProperty(java.lang.String absPath)
           
 QValueFactory getQValueFactory()
           
 Repository getRepository()
           
 RetentionManager getRetentionManager()
           
 Node getRootNode()
           
 java.lang.String getURI(java.lang.String prefix)
           
 java.lang.String getUserID()
           
 ItemStateValidator getValidator()
           
 ValueFactory getValueFactory()
           
 VersionManager getVersionStateManager()
          Returns the VersionManager associated with this ManagerProvider.
 Workspace getWorkspace()
           
 boolean hasCapability(java.lang.String methodName, java.lang.Object target, java.lang.Object[] arguments)
           
 boolean hasPendingChanges()
           
 boolean hasPermission(java.lang.String absPath, java.lang.String actions)
           
 Session impersonate(Credentials credentials)
           
 void importXML(java.lang.String parentAbsPath, java.io.InputStream in, int uuidBehavior)
           
 boolean isLive()
           
 boolean itemExists(java.lang.String absPath)
           
 void logout()
           
 void move(java.lang.String srcAbsPath, java.lang.String destAbsPath)
           
 boolean nodeExists(java.lang.String absPath)
           
 boolean propertyExists(java.lang.String absPath)
           
 void refresh(boolean keepChanges)
           
 void removeItem(java.lang.String absPath)
           
 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)
           
 
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

getRepository

public Repository getRepository()
Specified by:
getRepository in interface Session
See Also:
Session.getRepository()

getUserID

public java.lang.String getUserID()
Specified by:
getUserID in interface Session
See Also:
Session.getUserID()

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Always returns null.

Specified by:
getAttribute in interface Session
See Also:
Session.getAttribute(String)

getAttributeNames

public java.lang.String[] getAttributeNames()
Always returns an empty String array.

Specified by:
getAttributeNames in interface Session
See Also:
Session.getAttributeNames()

getWorkspace

public Workspace getWorkspace()
Specified by:
getWorkspace in interface Session
See Also:
Session.getWorkspace()

impersonate

public Session impersonate(Credentials credentials)
                    throws LoginException,
                           RepositoryException
Specified by:
impersonate in interface Session
Overrides:
impersonate in class AbstractSession
Throws:
LoginException
RepositoryException
See Also:
Session.impersonate(Credentials)

getRootNode

public Node getRootNode()
                 throws RepositoryException
Specified by:
getRootNode in interface Session
Throws:
RepositoryException
See Also:
Session.getRootNode()

getNodeByUUID

public Node getNodeByUUID(java.lang.String uuid)
                   throws ItemNotFoundException,
                          RepositoryException
Specified by:
getNodeByUUID in interface Session
Throws:
ItemNotFoundException
RepositoryException
See Also:
Session.getNodeByUUID(String)

getItem

public Item getItem(java.lang.String absPath)
             throws PathNotFoundException,
                    RepositoryException
Specified by:
getItem in interface Session
Overrides:
getItem in class AbstractSession
Throws:
PathNotFoundException
RepositoryException
See Also:
Session.getItem(String)

itemExists

public boolean itemExists(java.lang.String absPath)
                   throws RepositoryException
Specified by:
itemExists in interface Session
Overrides:
itemExists in class AbstractSession
Throws:
RepositoryException
See Also:
Session.itemExists(String)

move

public void move(java.lang.String srcAbsPath,
                 java.lang.String destAbsPath)
          throws ItemExistsException,
                 PathNotFoundException,
                 VersionException,
                 ConstraintViolationException,
                 LockException,
                 RepositoryException
Specified by:
move in interface Session
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
See Also:
Session.move(String, String)

save

public void save()
          throws AccessDeniedException,
                 ConstraintViolationException,
                 InvalidItemStateException,
                 VersionException,
                 LockException,
                 RepositoryException
Specified by:
save in interface Session
Throws:
AccessDeniedException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
RepositoryException
See Also:
Session.save()

refresh

public void refresh(boolean keepChanges)
             throws RepositoryException
Specified by:
refresh in interface Session
Throws:
RepositoryException
See Also:
Session.refresh(boolean)

hasPendingChanges

public boolean hasPendingChanges()
                          throws RepositoryException
Specified by:
hasPendingChanges in interface Session
Throws:
RepositoryException
See Also:
Session.hasPendingChanges()

getValueFactory

public ValueFactory getValueFactory()
                             throws UnsupportedRepositoryOperationException,
                                    RepositoryException
Specified by:
getValueFactory in interface Session
Throws:
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Session.getValueFactory()

checkPermission

public void checkPermission(java.lang.String absPath,
                            java.lang.String actions)
                     throws java.security.AccessControlException,
                            RepositoryException
Specified by:
checkPermission in interface Session
Throws:
java.security.AccessControlException
RepositoryException
See Also:
Session.checkPermission(String, String)

getImportContentHandler

public org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath,
                                                          int uuidBehavior)
                                                   throws PathNotFoundException,
                                                          ConstraintViolationException,
                                                          VersionException,
                                                          LockException,
                                                          RepositoryException
Specified by:
getImportContentHandler in interface Session
Throws:
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
See Also:
Session.getImportContentHandler(String, int)

importXML

public void importXML(java.lang.String parentAbsPath,
                      java.io.InputStream in,
                      int uuidBehavior)
               throws java.io.IOException,
                      PathNotFoundException,
                      ItemExistsException,
                      ConstraintViolationException,
                      VersionException,
                      InvalidSerializedDataException,
                      LockException,
                      RepositoryException
Specified by:
importXML in interface Session
Overrides:
importXML in class AbstractSession
Throws:
java.io.IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
See Also:
Session.importXML(String, java.io.InputStream, int)

setNamespacePrefix

public void setNamespacePrefix(java.lang.String prefix,
                               java.lang.String uri)
                        throws RepositoryException
Specified by:
setNamespacePrefix in interface Session
Overrides:
setNamespacePrefix in class AbstractSession
Throws:
RepositoryException
See Also:
Session.setNamespacePrefix(String, String)

logout

public void logout()
Specified by:
logout in interface Session
Overrides:
logout in class AbstractSession
See Also:
Session.logout()

isLive

public boolean isLive()
Specified by:
isLive in interface Session
See Also:
Session.isLive()

addLockToken

public void addLockToken(java.lang.String lt)
Specified by:
addLockToken in interface Session
See Also:
Session.addLockToken(String)

getLockTokens

public java.lang.String[] getLockTokens()
Specified by:
getLockTokens in interface Session
See Also:
Session.getLockTokens()

removeLockToken

public void removeLockToken(java.lang.String lt)
Specified by:
removeLockToken in interface Session
See Also:
Session.removeLockToken(String)

getAccessControlManager

public AccessControlManager getAccessControlManager()
                                             throws RepositoryException
Specified by:
getAccessControlManager in interface Session
Throws:
RepositoryException
See Also:
Session.getAccessControlManager()

getNode

public Node getNode(java.lang.String absPath)
             throws RepositoryException
Specified by:
getNode in interface Session
Overrides:
getNode in class AbstractSession
Throws:
RepositoryException
See Also:
Session.getNode(String)

getNodeByIdentifier

public Node getNodeByIdentifier(java.lang.String id)
                         throws RepositoryException
Specified by:
getNodeByIdentifier in interface Session
Throws:
RepositoryException
See Also:
Session.getNodeByIdentifier(String)

getProperty

public Property getProperty(java.lang.String absPath)
                     throws RepositoryException
Specified by:
getProperty in interface Session
Overrides:
getProperty in class AbstractSession
Throws:
RepositoryException
See Also:
Session.getProperty(String)

getRetentionManager

public RetentionManager getRetentionManager()
                                     throws UnsupportedRepositoryOperationException,
                                            RepositoryException
Specified by:
getRetentionManager in interface Session
Throws:
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Session.getRetentionManager()

hasCapability

public boolean hasCapability(java.lang.String methodName,
                             java.lang.Object target,
                             java.lang.Object[] arguments)
                      throws RepositoryException
Specified by:
hasCapability in interface Session
Throws:
RepositoryException
See Also:
Session.hasCapability(String, Object, Object[])

hasPermission

public boolean hasPermission(java.lang.String absPath,
                             java.lang.String actions)
                      throws RepositoryException
Specified by:
hasPermission in interface Session
Throws:
RepositoryException
See Also:
Session.hasPermission(String, String)

nodeExists

public boolean nodeExists(java.lang.String absPath)
                   throws RepositoryException
Specified by:
nodeExists in interface Session
Overrides:
nodeExists in class AbstractSession
Throws:
RepositoryException
See Also:
Session.nodeExists(String)

propertyExists

public boolean propertyExists(java.lang.String absPath)
                       throws RepositoryException
Specified by:
propertyExists in interface Session
Overrides:
propertyExists in class AbstractSession
Throws:
RepositoryException
See Also:
Session.propertyExists(String)

removeItem

public void removeItem(java.lang.String absPath)
                throws RepositoryException
Specified by:
removeItem in interface Session
Overrides:
removeItem in class AbstractSession
Throws:
RepositoryException
See Also:
Session.removeItem(String)

getPrefix

public java.lang.String getPrefix(java.lang.String uri)
                           throws NamespaceException
Specified by:
getPrefix in interface NamespaceResolver
Throws:
NamespaceException
See Also:
NamespaceResolver.getPrefix(String)

getURI

public java.lang.String getURI(java.lang.String prefix)
                        throws NamespaceException
Specified by:
getURI in interface NamespaceResolver
Throws:
NamespaceException
See Also:
NamespaceResolver.getURI(String)

addListener

public void addListener(SessionListener listener)
Add a SessionListener

Parameters:
listener - the new listener to be informed on modifications

removeListener

public void removeListener(SessionListener listener)
Remove a SessionListener

Parameters:
listener - an existing listener

createWorkspaceInstance

protected WorkspaceImpl createWorkspaceInstance(RepositoryConfig config,
                                                SessionInfo sessionInfo)
                                         throws RepositoryException
Throws:
RepositoryException

createSessionItemStateManager

protected SessionItemStateManager createSessionItemStateManager(UpdatableItemStateManager workspaceStateManager,
                                                                ItemStateFactory isf)
                                                         throws RepositoryException
Throws:
RepositoryException

createItemManager

protected ItemManager createItemManager(HierarchyManager hierarchyManager)

getNamePathResolver

public NamePathResolver getNamePathResolver()
Specified by:
getNamePathResolver in interface ManagerProvider
See Also:
ManagerProvider.getNamePathResolver()

getNameResolver

public NameResolver getNameResolver()
Specified by:
getNameResolver in interface ManagerProvider
See Also:
ManagerProvider.getNameResolver()

getPathResolver

public PathResolver getPathResolver()
Specified by:
getPathResolver in interface ManagerProvider
See Also:
ManagerProvider.getPathResolver()

getNamespaceResolver

public NamespaceResolver getNamespaceResolver()
Specified by:
getNamespaceResolver in interface ManagerProvider
See Also:
ManagerProvider.getNamespaceResolver()

getHierarchyManager

public HierarchyManager getHierarchyManager()
Specified by:
getHierarchyManager in interface ManagerProvider
See Also:
ManagerProvider.getHierarchyManager()

getLockStateManager

public LockStateManager getLockStateManager()
Description copied from interface: ManagerProvider
Returns the LockStateManager associated with this ManagerProvider.

Specified by:
getLockStateManager in interface ManagerProvider
Returns:
the LockStateManager associated with this ManagerProvider
See Also:
ManagerProvider.getLockStateManager()

getAccessManager

public AccessManager getAccessManager()
Specified by:
getAccessManager in interface ManagerProvider
See Also:
ManagerProvider.getAccessManager()

getVersionStateManager

public VersionManager getVersionStateManager()
Description copied from interface: ManagerProvider
Returns the VersionManager associated with this ManagerProvider.

Specified by:
getVersionStateManager in interface ManagerProvider
Returns:
the VersionManager associated with this ManagerProvider
See Also:
ManagerProvider.getVersionStateManager()

getItemDefinitionProvider

public ItemDefinitionProvider getItemDefinitionProvider()
Specified by:
getItemDefinitionProvider in interface ManagerProvider
See Also:
ManagerProvider.getItemDefinitionProvider()

getNodeTypeDefinitionProvider

public NodeTypeDefinitionProvider getNodeTypeDefinitionProvider()
Specified by:
getNodeTypeDefinitionProvider in interface ManagerProvider
See Also:
ManagerProvider.getNodeTypeDefinitionProvider()

getEffectiveNodeTypeProvider

public EffectiveNodeTypeProvider getEffectiveNodeTypeProvider()
Specified by:
getEffectiveNodeTypeProvider in interface ManagerProvider
See Also:
ManagerProvider.getEffectiveNodeTypeProvider()

getQValueFactory

public QValueFactory getQValueFactory()
                               throws RepositoryException
Specified by:
getQValueFactory in interface ManagerProvider
Throws:
RepositoryException
See Also:
ManagerProvider.getQValueFactory()

getJcrValueFactory

public ValueFactory getJcrValueFactory()
                                throws RepositoryException
Description copied from interface: ManagerProvider
Same as Session.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.

Specified by:
getJcrValueFactory in interface ManagerProvider
Returns:
Throws:
RepositoryException
See Also:
ManagerProvider.getJcrValueFactory()

getValidator

public ItemStateValidator getValidator()

getIdFactory

public IdFactory getIdFactory()
                       throws RepositoryException
Throws:
RepositoryException

getNameFactory

public NameFactory getNameFactory()
                           throws RepositoryException
Throws:
RepositoryException


Copyright © 2004-2011 The Apache Software Foundation. All Rights Reserved.