org.apache.jackrabbit.jcr2spi
Class SessionImpl

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

public class SessionImpl
extends Object
implements Session, ManagerProvider

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)
           
 void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse)
           
 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)
           
 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()
           
 String getNamespacePrefix(String uri)
           
 String[] getNamespacePrefixes()
           
 NamespaceResolver getNamespaceResolver()
           
 String getNamespaceURI(String prefix)
           
 Node getNodeByUUID(String uuid)
           
 PathResolver getPathResolver()
           
 QValueFactory getQValueFactory()
           
 Repository getRepository()
           
 Node getRootNode()
           
 String getUserID()
           
 ItemStateValidator getValidator()
           
 ValueFactory getValueFactory()
           
 VersionManager getVersionManager()
          Returns the VersionManager associated with this ManagerProvider.
 Workspace getWorkspace()
           
 boolean hasPendingChanges()
           
 Session impersonate(Credentials credentials)
           
 void importXML(String parentAbsPath, InputStream in, int uuidBehavior)
           
 boolean isLive()
           
 boolean itemExists(String absPath)
           
 void logout()
           
 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)
           
 
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 String getUserID()
Specified by:
getUserID in interface Session
See Also:
Session.getUserID()

getAttribute

public Object getAttribute(String name)
Always returns null.

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

getAttributeNames

public 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
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(String uuid)
                   throws ItemNotFoundException,
                          RepositoryException
Specified by:
getNodeByUUID in interface Session
Throws:
ItemNotFoundException
RepositoryException
See Also:
Session.getNodeByUUID(String)

getItem

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

itemExists

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

move

public void move(String srcAbsPath,
                 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(String absPath,
                            String actions)
                     throws AccessControlException,
                            RepositoryException
Specified by:
checkPermission in interface Session
Throws:
AccessControlException
RepositoryException
See Also:
Session.checkPermission(String, String)

getImportContentHandler

public ContentHandler getImportContentHandler(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(String parentAbsPath,
                      InputStream in,
                      int uuidBehavior)
               throws IOException,
                      PathNotFoundException,
                      ItemExistsException,
                      ConstraintViolationException,
                      VersionException,
                      InvalidSerializedDataException,
                      LockException,
                      RepositoryException
Specified by:
importXML in interface Session
Throws:
IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
See Also:
Session.importXML(String, java.io.InputStream, int)

exportSystemView

public void exportSystemView(String absPath,
                             ContentHandler contentHandler,
                             boolean skipBinary,
                             boolean noRecurse)
                      throws PathNotFoundException,
                             SAXException,
                             RepositoryException
Specified by:
exportSystemView in interface Session
Throws:
PathNotFoundException
SAXException
RepositoryException
See Also:
Session.exportSystemView(String, org.xml.sax.ContentHandler, boolean, boolean)

exportSystemView

public void exportSystemView(String absPath,
                             OutputStream out,
                             boolean skipBinary,
                             boolean noRecurse)
                      throws IOException,
                             PathNotFoundException,
                             RepositoryException
Specified by:
exportSystemView in interface Session
Throws:
IOException
PathNotFoundException
RepositoryException
See Also:
Session.exportSystemView(String, OutputStream, boolean, boolean)

exportDocumentView

public void exportDocumentView(String absPath,
                               ContentHandler contentHandler,
                               boolean skipBinary,
                               boolean noRecurse)
                        throws InvalidSerializedDataException,
                               PathNotFoundException,
                               SAXException,
                               RepositoryException
Specified by:
exportDocumentView in interface Session
Throws:
InvalidSerializedDataException
PathNotFoundException
SAXException
RepositoryException
See Also:
Session.exportDocumentView(String, org.xml.sax.ContentHandler, boolean, boolean)

exportDocumentView

public void exportDocumentView(String absPath,
                               OutputStream out,
                               boolean skipBinary,
                               boolean noRecurse)
                        throws InvalidSerializedDataException,
                               IOException,
                               PathNotFoundException,
                               RepositoryException
Specified by:
exportDocumentView in interface Session
Throws:
InvalidSerializedDataException
IOException
PathNotFoundException
RepositoryException
See Also:
Session.exportDocumentView(String, OutputStream, boolean, boolean)

setNamespacePrefix

public void setNamespacePrefix(String prefix,
                               String uri)
                        throws NamespaceException,
                               RepositoryException
Specified by:
setNamespacePrefix in interface Session
Throws:
NamespaceException
RepositoryException
See Also:
Session.setNamespacePrefix(String, String), LocalNamespaceMappings.setNamespacePrefix(String, String)

getNamespacePrefixes

public String[] getNamespacePrefixes()
                              throws RepositoryException
Specified by:
getNamespacePrefixes in interface Session
Throws:
RepositoryException
See Also:
Session.getNamespacePrefixes(), LocalNamespaceMappings.getPrefixes()

getNamespaceURI

public String getNamespaceURI(String prefix)
                       throws NamespaceException,
                              RepositoryException
Specified by:
getNamespaceURI in interface Session
Throws:
NamespaceException
RepositoryException
See Also:
Session.getNamespaceURI(String), NamespaceResolver.getURI(String)

getNamespacePrefix

public String getNamespacePrefix(String uri)
                          throws NamespaceException,
                                 RepositoryException
Specified by:
getNamespacePrefix in interface Session
Throws:
NamespaceException
RepositoryException
See Also:
Session.getNamespacePrefix(String), NamespaceResolver.getPrefix(String)

logout

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

isLive

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

addLockToken

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

getLockTokens

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

removeLockToken

public void removeLockToken(String lt)
Specified by:
removeLockToken in interface Session
See Also:
Session.removeLockToken(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

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()

getLockManager

public LockManager getLockManager()
Description copied from interface: ManagerProvider
Returns the AccessManager associated with this ManagerProvider.

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

getAccessManager

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

getVersionManager

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

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

getItemDefinitionProvider

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

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-2008 The Apache Software Foundation. All Rights Reserved.