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.Session
getSession
(javax.servlet.http.HttpServletRequest request, javax.jcr.Repository rep, String workspace) Returns the value of thejavax.jcr.Session
request attribute ornull
if the request attribute is not set.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.
-
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.Session
request attribute ornull
if the request attribute is not set. If the request is not authenticated, that is the authentication type isnull
, aLoginException
is thrown to force authentication.- Specified by:
getSession
in 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:
releaseSession
in interfaceorg.apache.jackrabbit.server.SessionProvider
-