org.alfresco.jcr.session
Class SessionImpl

java.lang.Object
  extended by org.alfresco.jcr.session.SessionImpl
All Implemented Interfaces:
javax.jcr.Session

public class SessionImpl
extends java.lang.Object
implements javax.jcr.Session

Alfresco Implementation of a JCR Session


Constructor Summary
SessionImpl(RepositoryImpl repository)
          Construct
 
Method Summary
 void addLockToken(java.lang.String lt)
           
 void checkPermission(java.lang.String absPath, java.lang.String actions)
           
 void exportDocumentView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportDocumentView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(java.lang.String absPath, org.xml.sax.ContentHandler contentHandler, boolean skipBinary, boolean noRecurse)
           
 void exportSystemView(java.lang.String absPath, java.io.OutputStream out, boolean skipBinary, boolean noRecurse)
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.lang.String[] getAttributeNames()
           
 org.xml.sax.ContentHandler getImportContentHandler(java.lang.String parentAbsPath, int uuidBehavior)
           
 javax.jcr.Item getItem(java.lang.String absPath)
           
 java.lang.String[] getLockTokens()
           
 java.lang.String getNamespacePrefix(java.lang.String uri)
           
 java.lang.String[] getNamespacePrefixes()
           
 org.alfresco.service.namespace.NamespacePrefixResolver getNamespaceResolver()
          Get the Namespace Resolver
 java.lang.String getNamespaceURI(java.lang.String prefix)
           
 javax.jcr.Node getNodeByUUID(java.lang.String uuid)
           
 javax.jcr.Session getProxy()
          Create proxied Session
 javax.jcr.Repository getRepository()
           
 RepositoryImpl getRepositoryImpl()
          Get the Repository Impl
 javax.jcr.Node getRootNode()
           
 java.lang.String getTicket()
          Get the session Ticket
 java.lang.String getTransactionId()
          Get the associated transaction Id
 JCRTypeConverter getTypeConverter()
          Get the Type Converter
 NodeTypeManagerImpl getTypeManager()
          Get the Type Manager
 java.lang.String getUserID()
           
 javax.jcr.ValueFactory getValueFactory()
           
 javax.jcr.Workspace getWorkspace()
           
 org.alfresco.service.cmr.repository.StoreRef getWorkspaceStore()
          Get the Workspace Store
 boolean hasPendingChanges()
           
 javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
           
 void importXML(java.lang.String parentAbsPath, java.io.InputStream in, int uuidBehavior)
           
 void init(java.lang.String ticket, java.lang.String workspaceName, java.util.Map attributes)
          Initialise Session
 boolean isLive()
           
 boolean itemExists(java.lang.String absPath)
           
 void logout()
           
 void move(java.lang.String srcAbsPath, java.lang.String destAbsPath)
           
 void refresh(boolean keepChanges)
           
 void removeLockToken(java.lang.String lt)
           
 void save()
           
 void setNamespacePrefix(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionImpl

public SessionImpl(RepositoryImpl repository)
Construct

Parameters:
repository - parent repository
Throws:
javax.jcr.NoSuchWorkspaceException
Method Detail

init

public void init(java.lang.String ticket,
                 java.lang.String workspaceName,
                 java.util.Map attributes)
          throws javax.jcr.RepositoryException
Initialise Session

Parameters:
ticket - authentication ticket
workspaceName - workspace name
attributes - session attributes
Throws:
javax.jcr.RepositoryException

getProxy

public javax.jcr.Session getProxy()
Create proxied Session

Returns:
JCR Session

getRepositoryImpl

public RepositoryImpl getRepositoryImpl()
Get the Repository Impl

Returns:
repository impl

getTicket

public java.lang.String getTicket()
Get the session Ticket

Returns:
ticket

getTransactionId

public java.lang.String getTransactionId()
Get the associated transaction Id

Returns:
transaction id

getTypeConverter

public JCRTypeConverter getTypeConverter()
Get the Type Converter

Returns:
the type converter

getTypeManager

public NodeTypeManagerImpl getTypeManager()
Get the Type Manager

Returns:
the type manager

getNamespaceResolver

public org.alfresco.service.namespace.NamespacePrefixResolver getNamespaceResolver()
Get the Namespace Resolver

Returns:
the session based Namespace Resolver

getWorkspaceStore

public org.alfresco.service.cmr.repository.StoreRef getWorkspaceStore()
Get the Workspace Store

Returns:
the workspace store reference

getRepository

public javax.jcr.Repository getRepository()
Specified by:
getRepository in interface javax.jcr.Session

getUserID

public java.lang.String getUserID()
Specified by:
getUserID in interface javax.jcr.Session

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface javax.jcr.Session

getAttributeNames

public java.lang.String[] getAttributeNames()
Specified by:
getAttributeNames in interface javax.jcr.Session

getWorkspace

public javax.jcr.Workspace getWorkspace()
Specified by:
getWorkspace in interface javax.jcr.Session

impersonate

public javax.jcr.Session impersonate(javax.jcr.Credentials credentials)
                              throws javax.jcr.LoginException,
                                     javax.jcr.RepositoryException
Specified by:
impersonate in interface javax.jcr.Session
Throws:
javax.jcr.LoginException
javax.jcr.RepositoryException

getRootNode

public javax.jcr.Node getRootNode()
                           throws javax.jcr.RepositoryException
Specified by:
getRootNode in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNodeByUUID

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

getItem

public javax.jcr.Item getItem(java.lang.String absPath)
                       throws javax.jcr.PathNotFoundException,
                              javax.jcr.RepositoryException
Specified by:
getItem in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

itemExists

public boolean itemExists(java.lang.String absPath)
                   throws javax.jcr.RepositoryException
Specified by:
itemExists in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

move

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
Specified by:
move in interface javax.jcr.Session
Throws:
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.AccessDeniedException,
                 javax.jcr.ItemExistsException,
                 javax.jcr.nodetype.ConstraintViolationException,
                 javax.jcr.InvalidItemStateException,
                 javax.jcr.version.VersionException,
                 javax.jcr.lock.LockException,
                 javax.jcr.nodetype.NoSuchNodeTypeException,
                 javax.jcr.RepositoryException
Specified by:
save in interface javax.jcr.Session
Throws:
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException

refresh

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

hasPendingChanges

public boolean hasPendingChanges()
                          throws javax.jcr.RepositoryException
Specified by:
hasPendingChanges in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getValueFactory

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

checkPermission

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

getImportContentHandler

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
Specified by:
getImportContentHandler in interface javax.jcr.Session
Throws:
javax.jcr.PathNotFoundException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

importXML

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
Specified by:
importXML in interface javax.jcr.Session
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

exportSystemView

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

exportSystemView

public void exportSystemView(java.lang.String absPath,
                             java.io.OutputStream out,
                             boolean skipBinary,
                             boolean noRecurse)
                      throws java.io.IOException,
                             javax.jcr.PathNotFoundException,
                             javax.jcr.RepositoryException
Specified by:
exportSystemView in interface javax.jcr.Session
Throws:
java.io.IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

exportDocumentView

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

exportDocumentView

public void exportDocumentView(java.lang.String absPath,
                               java.io.OutputStream out,
                               boolean skipBinary,
                               boolean noRecurse)
                        throws java.io.IOException,
                               javax.jcr.PathNotFoundException,
                               javax.jcr.RepositoryException
Specified by:
exportDocumentView in interface javax.jcr.Session
Throws:
java.io.IOException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

setNamespacePrefix

public void setNamespacePrefix(java.lang.String prefix,
                               java.lang.String uri)
                        throws javax.jcr.NamespaceException,
                               javax.jcr.RepositoryException
Specified by:
setNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

getNamespacePrefixes

public java.lang.String[] getNamespacePrefixes()
                                        throws javax.jcr.RepositoryException
Specified by:
getNamespacePrefixes in interface javax.jcr.Session
Throws:
javax.jcr.RepositoryException

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String prefix)
                                 throws javax.jcr.NamespaceException,
                                        javax.jcr.RepositoryException
Specified by:
getNamespaceURI in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

getNamespacePrefix

public java.lang.String getNamespacePrefix(java.lang.String uri)
                                    throws javax.jcr.NamespaceException,
                                           javax.jcr.RepositoryException
Specified by:
getNamespacePrefix in interface javax.jcr.Session
Throws:
javax.jcr.NamespaceException
javax.jcr.RepositoryException

logout

public void logout()
Specified by:
logout in interface javax.jcr.Session

isLive

public boolean isLive()
Specified by:
isLive in interface javax.jcr.Session

addLockToken

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

getLockTokens

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

removeLockToken

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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.