public class SlingSessionProvider extends Object implements org.apache.jackrabbit.server.SessionProvider
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 and Description |
---|
SlingSessionProvider() |
Modifier and Type | Method and Description |
---|---|
javax.jcr.Session |
getSession(javax.servlet.http.HttpServletRequest request,
javax.jcr.Repository rep,
String workspace)
Returns the value of the
javax.jcr.Session request
attribute or null 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.
|
public javax.jcr.Session getSession(javax.servlet.http.HttpServletRequest request, javax.jcr.Repository rep, String workspace) throws javax.jcr.LoginException
javax.jcr.Session
request
attribute or null
if the request attribute is not set. If
the request is not authenticated, that is the authentication type is
null
, a LoginException
is thrown to force
authentication.getSession
in interface org.apache.jackrabbit.server.SessionProvider
javax.jcr.LoginException
public void releaseSession(javax.jcr.Session session)
releaseSession
in interface org.apache.jackrabbit.server.SessionProvider
Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.