Package org.apache.jackrabbit.server
Class SessionProviderImpl
- java.lang.Object
-
- org.apache.jackrabbit.server.SessionProviderImpl
-
- All Implemented Interfaces:
SessionProvider
public class SessionProviderImpl extends Object implements SessionProvider
This class implements a default session provider based on a givencredentials provider. Additionally, since Jackrabbit 2.4, if another session provider is available as the "org.apache.jackrabbit.server.SessionProvider" request attribute, then that provider is asked first for a session before the default credential-based login mechanism is used.
-
-
Constructor Summary
Constructors Constructor Description SessionProviderImpl(CredentialsProvider cp)Creates a new SessionProvider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SessiongetSession(javax.servlet.http.HttpServletRequest request, Repository repository, String workspace)Provides the repository session suitable for the given request.voidreleaseSession(Session session)Informs this provider that the session acquired by a previousSessionProvider.getSession(javax.servlet.http.HttpServletRequest, javax.jcr.Repository, java.lang.String)call is no longer needed.
-
-
-
Constructor Detail
-
SessionProviderImpl
public SessionProviderImpl(CredentialsProvider cp)
Creates a new SessionProvider- Parameters:
cp-
-
-
Method Detail
-
getSession
public Session getSession(javax.servlet.http.HttpServletRequest request, Repository repository, String workspace) throws LoginException, RepositoryException, javax.servlet.ServletException
Provides the repository session suitable for the given request.- Specified by:
getSessionin interfaceSessionProviderrepository- the repository to loginworkspace- the workspace name- Returns:
- the session or null
- Throws:
LoginException- if the credentials are invalidjavax.servlet.ServletException- if an error occursRepositoryException
-
releaseSession
public void releaseSession(Session session)
Informs this provider that the session acquired by a previousSessionProvider.getSession(javax.servlet.http.HttpServletRequest, javax.jcr.Repository, java.lang.String)call is no longer needed.- Specified by:
releaseSessionin interfaceSessionProvider
-
-