Class SlingSessionProvider
java.lang.Object
org.apache.sling.jcr.webdav.impl.helper.SlingSessionProvider
- All Implemented Interfaces:
org.apache.jackrabbit.server.SessionProvider
public class SlingSessionProvider
extends Object
implements org.apache.jackrabbit.server.SessionProvider
The
SlingSessionProvider is a Jackrabbit WebDAV server
SessionProvider which returns the session stored as the
javax.jcr.Session request attribute. This request attribute is
set by the Sling Authenticator when the request is authenticated. If the
request is not authenticated, the request attribute is not set and hence no
session is returned.
This class expects an authenticated request, which is identified by the
request authentication type to not be null. Otherwise the
getSession(HttpServletRequest, Repository, String) method throws a
LoginException to force authentication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.jcr.SessiongetSession(javax.servlet.http.HttpServletRequest request, javax.jcr.Repository rep, String workspace) Returns the value of thejavax.jcr.Sessionrequest attribute ornullif the request attribute is not set.voidreleaseSession(javax.jcr.Session session) Does nothing as the session is taken from the Sling request and hence the session will be released by Sling.
-
Constructor Details
-
SlingSessionProvider
public SlingSessionProvider()
-
-
Method Details
-
getSession
public javax.jcr.Session getSession(javax.servlet.http.HttpServletRequest request, javax.jcr.Repository rep, String workspace) throws javax.jcr.LoginException Returns the value of thejavax.jcr.Sessionrequest attribute ornullif the request attribute is not set. If the request is not authenticated, that is the authentication type isnull, aLoginExceptionis thrown to force authentication.- Specified by:
getSessionin interfaceorg.apache.jackrabbit.server.SessionProvider- Throws:
javax.jcr.LoginException
-
releaseSession
public void releaseSession(javax.jcr.Session session) Does nothing as the session is taken from the Sling request and hence the session will be released by Sling.- Specified by:
releaseSessionin interfaceorg.apache.jackrabbit.server.SessionProvider
-