public class SessionProvider extends Object implements SessionLifecycleListener
Modifier and Type | Field and Description |
---|---|
static String |
SESSION_PROVIDER
Constant for handlers.
|
Constructor and Description |
---|
SessionProvider(ConversationState userState)
Creates SessionProvider for certain identity.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Calls logout() method for all cached sessions.
|
static SessionProvider |
createAnonimProvider()
Helper for creating Anonymous session provider.
|
static SessionProvider |
createProvider(List<AccessControlEntry> accessList)
Gives a
SessionProvider for a given list of AccessControlEntry . |
static SessionProvider |
createSystemProvider()
Helper for creating System session provider.
|
ManageableRepository |
getCurrentRepository() |
String |
getCurrentWorkspace() |
javax.jcr.Session |
getSession(String workspaceName,
ManageableRepository repository)
Gets the session from an internal cache if a similar session has already been used
or creates a new session and puts it into the internal cache.
|
void |
onCloseSession(ExtendedSession session)
Called when a session is closed.
|
void |
setCurrentRepository(ManageableRepository currentRepository)
Sets the current repository Repository.
|
void |
setCurrentWorkspace(String currentWorkspace)
Sets the current Workspace
|
public static final String SESSION_PROVIDER
public SessionProvider(ConversationState userState)
userState
- public static SessionProvider createSystemProvider()
public static SessionProvider createAnonimProvider()
public static SessionProvider createProvider(List<AccessControlEntry> accessList)
SessionProvider
for a given list of AccessControlEntry
.accessList
- list of AccessControlEntry
SessionProvider
allowing to provide sessions with the
corresponding ACL.public javax.jcr.Session getSession(String workspaceName, ManageableRepository repository) throws javax.jcr.LoginException, javax.jcr.NoSuchWorkspaceException, javax.jcr.RepositoryException
workspaceName
- the workspace namerepository
- the repository instancejavax.jcr.LoginException
- if an error occurs while trying to login to the workspacejavax.jcr.NoSuchWorkspaceException
- if the requested workspace doesn't existjavax.jcr.RepositoryException
- if any error occurspublic void close()
public void onCloseSession(ExtendedSession session)
SessionLifecycleListener
onCloseSession
in interface SessionLifecycleListener
session
- the session instancepublic ManageableRepository getCurrentRepository()
public String getCurrentWorkspace()
public void setCurrentRepository(ManageableRepository currentRepository)
currentRepository
- the current repositorypublic void setCurrentWorkspace(String currentWorkspace)
currentWorkspace
- the current workspaceCopyright © 2003-2017 eXo Platform SAS. All Rights Reserved.