|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.SessionImpl
A SessionImpl
...
Field Summary | |
protected AccessManager |
accessMgr
the AccessManager associated with this session |
static String |
ADD_NODE_ACTION
|
protected boolean |
alive
flag indicating whether this session is alive |
protected HashMap |
attributes
the attributes of this session |
protected HierarchyManager |
hierMgr
the HierarchyManager associated with this session |
protected ItemManager |
itemMgr
the item mgr associated with this session |
protected SessionItemStateManager |
itemStateMgr
the item state mgr associated with this session |
protected Map |
listeners
Listeners (weak references) |
protected Set |
lockTokens
Lock tokens |
protected AuthContext |
loginContext
the AuthContext of this session (can be null if this session was not instantiated through a login process) |
protected org.apache.jackrabbit.core.LocalNamespaceMappings |
nsMappings
the transient prefix/namespace mappings with session scope |
protected NodeTypeManagerImpl |
ntMgr
the node type manager |
static String |
READ_ACTION
prededfined action constants in checkPermission |
static String |
REMOVE_ACTION
|
protected RepositoryImpl |
rep
the repository that issued this session |
static String |
SET_PROPERTY_ACTION
|
protected Subject |
subject
the Subject of this session |
protected String |
userId
the user ID that was used to acquire this session |
protected ValueFactory |
valueFactory
value factory |
protected VersionManager |
versionMgr
The version manager for this session |
protected WorkspaceImpl |
wsp
the Workspace associated with this session |
Constructor Summary | |
protected |
SessionImpl(RepositoryImpl rep,
AuthContext loginContext,
WorkspaceConfig wspConfig)
Protected constructor. |
protected |
SessionImpl(RepositoryImpl rep,
Subject subject,
WorkspaceConfig wspConfig)
Protected constructor. |
Method Summary | |
void |
addListener(SessionListener listener)
Add a SessionListener |
void |
addLockToken(String lt)
|
void |
addLockToken(String lt,
boolean notify)
Internal implementation of addLockToken(String) . |
void |
checkPermission(String absPath,
String actions)
|
protected AccessManager |
createAccessManager(Subject subject,
HierarchyManager hierMgr)
Create the access manager. |
protected ItemManager |
createItemManager(SessionItemStateManager itemStateMgr,
HierarchyManager hierMgr)
Create the item manager. |
protected SessionItemStateManager |
createSessionItemStateManager(UpdatableItemStateManager manager)
Create the session item state manager. |
protected VersionManager |
createVersionManager(RepositoryImpl rep)
Create the version manager. |
protected void |
createWorkspace(String workspaceName)
Creates a workspace with the given name. |
protected void |
createWorkspace(String workspaceName,
InputSource configTemplate)
Creates a workspace with the given name and a workspace configuration template. |
protected WorkspaceImpl |
createWorkspaceInstance(WorkspaceConfig wspConfig,
SharedItemStateManager stateMgr,
RepositoryImpl rep,
SessionImpl session)
Creates the workspace instance backing this session. |
void |
dump(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
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()
Returns the AccessManager associated with this session. |
Object |
getAttribute(String name)
|
String[] |
getAttributeNames()
|
HierarchyManager |
getHierarchyManager()
Returns the HierarchyManager associated with this session. |
ContentHandler |
getImportContentHandler(String parentAbsPath,
int uuidBehavior)
|
Item |
getItem(String absPath)
|
ItemManager |
getItemManager()
Returns the ItemManager of this session. |
protected SessionItemStateManager |
getItemStateManager()
Returns the SessionItemStateManager associated with this session. |
LockManager |
getLockManager()
Return the lock manager for this session. |
String[] |
getLockTokens()
|
String |
getNamespacePrefix(String uri)
|
String[] |
getNamespacePrefixes()
|
NamespaceResolver |
getNamespaceResolver()
Returns the NamespaceResolver of this session. |
String |
getNamespaceURI(String prefix)
|
NodeImpl |
getNodeById(NodeId id)
Retrieves the Node with the given id. |
Node |
getNodeByUUID(String uuid)
|
Node |
getNodeByUUID(UUID uuid)
Retrieves the referenceable node with the given UUID . |
NodeTypeManagerImpl |
getNodeTypeManager()
Returns the NodeTypeManager . |
Repository |
getRepository()
|
Node |
getRootNode()
|
protected Subject |
getSubject()
Returns the Subject associated with this session. |
String |
getUserID()
|
ValueFactory |
getValueFactory()
|
VersionManager |
getVersionManager()
Returns the VersionManager associated with this session. |
Workspace |
getWorkspace()
|
protected String[] |
getWorkspaceNames()
Returns the names of all workspaces of this repository with respect of the access rights of this session. |
boolean |
hasPendingChanges()
|
Session |
impersonate(Credentials otherCredentials)
|
void |
importXML(String parentAbsPath,
InputStream in,
int uuidBehavior)
|
boolean |
isLive()
|
boolean |
itemExists(String absPath)
|
void |
logout()
|
void |
move(String srcAbsPath,
String destAbsPath)
|
protected void |
notifyLoggedOut()
Notify the listeners that this session has been closed. |
protected void |
notifyLoggingOut()
Notify the listeners that this session is about to be closed. |
void |
refresh(boolean keepChanges)
|
void |
removeListener(SessionListener listener)
Remove a SessionListener |
void |
removeLockToken(String lt)
|
void |
removeLockToken(String lt,
boolean notify)
Internal implementation of removeLockToken(String) . |
protected void |
sanityCheck()
Performs a sanity check on this session. |
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 |
Field Detail |
public static final String READ_ACTION
public static final String REMOVE_ACTION
public static final String ADD_NODE_ACTION
public static final String SET_PROPERTY_ACTION
protected boolean alive
protected final RepositoryImpl rep
protected AuthContext loginContext
protected final Subject subject
protected final String userId
protected final HashMap attributes
protected final NodeTypeManagerImpl ntMgr
protected AccessManager accessMgr
protected final SessionItemStateManager itemStateMgr
protected final HierarchyManager hierMgr
protected final ItemManager itemMgr
protected final WorkspaceImpl wsp
protected final org.apache.jackrabbit.core.LocalNamespaceMappings nsMappings
protected final VersionManager versionMgr
protected final Map listeners
protected final Set lockTokens
protected ValueFactory valueFactory
Constructor Detail |
protected SessionImpl(RepositoryImpl rep, AuthContext loginContext, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
rep
- loginContext
- wspConfig
-
AccessDeniedException
- if the subject of the given login context
is not granted access to the specified
workspace
RepositoryException
- if another error occursprotected SessionImpl(RepositoryImpl rep, Subject subject, WorkspaceConfig wspConfig) throws AccessDeniedException, RepositoryException
rep
- subject
- wspConfig
-
AccessDeniedException
- if the given subject is not granted access
to the specified workspace
RepositoryException
- if another error occursMethod Detail |
protected SessionItemStateManager createSessionItemStateManager(UpdatableItemStateManager manager)
protected WorkspaceImpl createWorkspaceInstance(WorkspaceConfig wspConfig, SharedItemStateManager stateMgr, RepositoryImpl rep, SessionImpl session)
wspConfig
- The workspace configurationstateMgr
- The shared item state managerrep
- The repositorysession
- The session
WorkspaceImpl
class or an extension
thereof.protected ItemManager createItemManager(SessionItemStateManager itemStateMgr, HierarchyManager hierMgr)
protected VersionManager createVersionManager(RepositoryImpl rep) throws RepositoryException
RepositoryException
protected AccessManager createAccessManager(Subject subject, HierarchyManager hierMgr) throws AccessDeniedException, RepositoryException
AccessDeniedException
- if the current subject is not granted access
to the current workspace
RepositoryException
- if the access manager cannot be instantiatedprotected void sanityCheck() throws RepositoryException
RepositoryException
- if this session has been rendered invalid
for some reason (e.g. if this session has
been closed explicitly or if it has expired)protected Subject getSubject()
Subject
associated with this session.
Subject
associated with this sessionpublic AccessManager getAccessManager()
AccessManager
associated with this session.
AccessManager
associated with this sessionpublic NodeTypeManagerImpl getNodeTypeManager()
NodeTypeManager
.
NodeTypeManager
public ItemManager getItemManager()
ItemManager
of this session.
ItemManager
public NamespaceResolver getNamespaceResolver()
NamespaceResolver
of this session.
NamespaceResolver
of this sessionprotected SessionItemStateManager getItemStateManager()
SessionItemStateManager
associated with this session.
SessionItemStateManager
associated with this sessionpublic HierarchyManager getHierarchyManager()
HierarchyManager
associated with this session.
HierarchyManager
associated with this sessionpublic VersionManager getVersionManager()
VersionManager
associated with this session.
VersionManager
associated with this sessionpublic Node getNodeByUUID(UUID uuid) throws ItemNotFoundException, RepositoryException
UUID
.
uuid
- uuid of the node to be retrieved
ItemNotFoundException
- if no node exists with the given uuid or
if the existing node is not referenceable.
RepositoryException
- if another error occurs.getNodeByUUID(String)
,
getNodeById(NodeId)
public NodeImpl getNodeById(NodeId id) throws ItemNotFoundException, RepositoryException
Node
with the given id.
id
- id of node to be retrieved
NodeId
.
ItemNotFoundException
- if no such node exists or if this
Session
does not have permission to access the node.
RepositoryException
- if another error occurs.protected String[] getWorkspaceNames() throws RepositoryException
RepositoryException
- if an error occursprotected void createWorkspace(String workspaceName) throws AccessDeniedException, RepositoryException
workspaceName
- name of the new workspace
AccessDeniedException
- if the current session is not allowed to
create the workspace
RepositoryException
- if a workspace with the given name
already exists or if another error occursprotected void createWorkspace(String workspaceName, InputSource configTemplate) throws AccessDeniedException, RepositoryException
workspaceName
- name of the new workspaceconfigTemplate
- the configuration template of the new workspace
AccessDeniedException
- if the current session is not allowed to
create the workspace
RepositoryException
- if a workspace with the given name already
exists or if another error occursprotected void notifyLoggingOut()
protected void notifyLoggedOut()
public void addListener(SessionListener listener)
SessionListener
listener
- the new listener to be informed on modificationspublic void removeListener(SessionListener listener)
SessionListener
listener
- an existing listenerpublic void checkPermission(String absPath, String actions) throws AccessControlException, RepositoryException
checkPermission
in interface Session
AccessControlException
RepositoryException
public Workspace getWorkspace()
getWorkspace
in interface Session
public Session impersonate(Credentials otherCredentials) throws LoginException, RepositoryException
impersonate
in interface Session
LoginException
RepositoryException
public Node getRootNode() throws RepositoryException
getRootNode
in interface Session
RepositoryException
public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException
getNodeByUUID
in interface Session
ItemNotFoundException
RepositoryException
public Item getItem(String absPath) throws PathNotFoundException, RepositoryException
getItem
in interface Session
PathNotFoundException
RepositoryException
public boolean itemExists(String absPath) throws RepositoryException
itemExists
in interface Session
RepositoryException
public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException, InvalidItemStateException, VersionException, LockException, NoSuchNodeTypeException, RepositoryException
save
in interface Session
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
VersionException
LockException
NoSuchNodeTypeException
RepositoryException
public void refresh(boolean keepChanges) throws RepositoryException
refresh
in interface Session
RepositoryException
public boolean hasPendingChanges() throws RepositoryException
hasPendingChanges
in interface Session
RepositoryException
public void move(String srcAbsPath, String destAbsPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException
move
in interface Session
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException
public ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior) throws PathNotFoundException, ConstraintViolationException, VersionException, LockException, RepositoryException
getImportContentHandler
in interface Session
PathNotFoundException
ConstraintViolationException
VersionException
LockException
RepositoryException
public void importXML(String parentAbsPath, InputStream in, int uuidBehavior) throws IOException, PathNotFoundException, ItemExistsException, ConstraintViolationException, VersionException, InvalidSerializedDataException, LockException, RepositoryException
importXML
in interface Session
IOException
PathNotFoundException
ItemExistsException
ConstraintViolationException
VersionException
InvalidSerializedDataException
LockException
RepositoryException
public void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, SAXException, RepositoryException
exportDocumentView
in interface Session
PathNotFoundException
SAXException
RepositoryException
public void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportDocumentView
in interface Session
IOException
PathNotFoundException
RepositoryException
public void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse) throws PathNotFoundException, SAXException, RepositoryException
exportSystemView
in interface Session
PathNotFoundException
SAXException
RepositoryException
public void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse) throws IOException, PathNotFoundException, RepositoryException
exportSystemView
in interface Session
IOException
PathNotFoundException
RepositoryException
public boolean isLive()
isLive
in interface Session
public void logout()
logout
in interface Session
public Repository getRepository()
getRepository
in interface Session
public ValueFactory getValueFactory() throws UnsupportedRepositoryOperationException, RepositoryException
getValueFactory
in interface Session
UnsupportedRepositoryOperationException
RepositoryException
public String getUserID()
getUserID
in interface Session
public Object getAttribute(String name)
getAttribute
in interface Session
public String[] getAttributeNames()
getAttributeNames
in interface Session
public void setNamespacePrefix(String prefix, String uri) throws NamespaceException, RepositoryException
setNamespacePrefix
in interface Session
NamespaceException
RepositoryException
public String[] getNamespacePrefixes() throws NamespaceException, RepositoryException
getNamespacePrefixes
in interface Session
NamespaceException
RepositoryException
public String getNamespaceURI(String prefix) throws NamespaceException, RepositoryException
getNamespaceURI
in interface Session
NamespaceException
RepositoryException
public String getNamespacePrefix(String uri) throws NamespaceException, RepositoryException
getNamespacePrefix
in interface Session
NamespaceException
RepositoryException
public void addLockToken(String lt)
addLockToken
in interface Session
public void addLockToken(String lt, boolean notify)
addLockToken(String)
. Additionally
takes a parameter indicating whether the lock manager needs to be
informed.
public String[] getLockTokens()
getLockTokens
in interface Session
public void removeLockToken(String lt)
removeLockToken
in interface Session
public void removeLockToken(String lt, boolean notify)
removeLockToken(String)
. Additionally
takes a parameter indicating whether the lock manager needs to be
informed.
public LockManager getLockManager() throws RepositoryException
RepositoryException
public void dump(PrintStream ps)
dump
in interface Dumpable
ps
- stream to dump state to
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |