|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.jcr.ext.common.SessionProvider
public class SessionProvider
Created by The eXo Platform SAS .
Provides JCR Session for client program. Usually it is per client thread object Session creates
with Repository.login(..) method and then can be stored in some cache if neccessary.
close() and
getSession() methods.SessionLifecycleListener.onCloseSession() implementation also is synchronized.
To logout all cached Session use close() method.
SessionProvider instance can handle
getSession(), getCurrentRepository(), setCurrentRepository(),
getCurrentWorkspace(), setCurrentWorkspace() methods after close() method
call.
| Field Summary | |
|---|---|
static java.lang.String |
SESSION_PROVIDER
Constant for handlers. |
| Constructor Summary | |
|---|---|
SessionProvider(org.exoplatform.services.security.ConversationState userState)
Creates SessionProvider for certain identity. |
|
| Method Summary | |
|---|---|
void |
close()
Logout all cached Sessions. |
static SessionProvider |
createAnonimProvider()
Helper for creating Anonymous session provider. |
static SessionProvider |
createSystemProvider()
Helper for creating System session provider. |
ManageableRepository |
getCurrentRepository()
Return current Repository. |
java.lang.String |
getCurrentWorkspace()
Return current Workspace. |
javax.jcr.Session |
getSession(java.lang.String workspaceName,
ManageableRepository repository)
Gets the session from internal cache or creates and caches new one. |
void |
onCloseSession(ExtendedSession session)
|
void |
setCurrentRepository(ManageableRepository currentRepository)
Set current Repository. |
void |
setCurrentWorkspace(java.lang.String currentWorkspace)
Set current Workspace. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SESSION_PROVIDER
| Constructor Detail |
|---|
public SessionProvider(org.exoplatform.services.security.ConversationState userState)
userState - ConversationState, existing user state| Method Detail |
|---|
public static SessionProvider createSystemProvider()
public static SessionProvider createAnonimProvider()
public javax.jcr.Session getSession(java.lang.String workspaceName,
ManageableRepository repository)
throws javax.jcr.LoginException,
javax.jcr.NoSuchWorkspaceException,
javax.jcr.RepositoryException
workspaceName - workspace namerepository - ManageableRepository, repository instance
javax.jcr.LoginException - login error
javax.jcr.NoSuchWorkspaceException - if no workspace name is null
javax.jcr.RepositoryException - Repository errorpublic void close()
public void onCloseSession(ExtendedSession session)
onCloseSession in interface SessionLifecycleListenerpublic ManageableRepository getCurrentRepository()
public java.lang.String getCurrentWorkspace()
public void setCurrentRepository(ManageableRepository currentRepository)
currentRepository - ManageableRepositorypublic void setCurrentWorkspace(java.lang.String currentWorkspace)
currentWorkspace - String
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||