|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.jackrabbit.j2ee.RepositoryAccessServlet
This Class implements a servlet that is used as unified mechanism to retrieve a jcr repository either through JNID, RMI or JCRWebdavServer.
Field Summary | |
static String |
INIT_PARAM_LOG4J_CONFIG
|
static String |
INIT_PARAM_MISSING_AUTH_MAPPING
the 'missing-auth-mapping' init parameter |
static String |
INIT_PARAM_REPOSITORY_NAME
the 'repository-name' init parameter |
static String |
INIT_PARAM_RMI_URI
the 'rmi-uri' init parameter |
Constructor Summary | |
RepositoryAccessServlet()
|
Method Summary | |
static Credentials |
getCredentialsFromHeader(javax.servlet.ServletContext ctx,
String authHeader)
Build a Credentials object for the given authorization header. |
static Repository |
getRepository(javax.servlet.ServletContext ctx)
Returns the JSR170 repository |
void |
init()
Initializes this servlet |
static Session |
login(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request)
Simple login to the Repository accessed by this servlet using the
Authorization header present in the given request.
Please note, that no workspace information is provided to the repository
login (Repository.login(javax.jcr.Credentials) ), thus the default
workspace will be selected. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String INIT_PARAM_LOG4J_CONFIG
public static final String INIT_PARAM_REPOSITORY_NAME
public static final String INIT_PARAM_RMI_URI
public static final String INIT_PARAM_MISSING_AUTH_MAPPING
Constructor Detail |
public RepositoryAccessServlet()
Method Detail |
public void init() throws javax.servlet.ServletException
javax.servlet.ServletException
public static Repository getRepository(javax.servlet.ServletContext ctx)
public static Credentials getCredentialsFromHeader(javax.servlet.ServletContext ctx, String authHeader) throws javax.servlet.ServletException, LoginException
Credentials
object for the given authorization header.
The creds may be used to login to the repository. If the specified header
string is null
or not of the required format the behaviour
depends on the INIT_PARAM_MISSING_AUTH_MAPPING
param:
authHeader
- Authorization header as present in the Http request
null
.
javax.servlet.ServletException
- If an IOException occured while decoding the
Authorization header.
LoginException
- if no suitable auth header and missing-auth-mapping
is not presentgetRepository(ServletContext)
public static Session login(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request) throws LoginException, javax.servlet.ServletException
Repository
accessed by this servlet using the
Authorization header present in the given request.
Please note, that no workspace information is provided to the repository
login (Repository.login(javax.jcr.Credentials)
), thus the default
workspace will be selected. In order to provide a specific workspace name,
manual login
is required (see
also getRepository(ServletContext)
).
request
-
Repository.login(javax.jcr.Credentials)
.
javax.servlet.ServletException
LoginException
- if credentials are invalidin order to be able to login to a specific workspace.
,
for a utility method to retrieve
credentials from the Authorization header string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |