Class RepositoryInterceptor
java.lang.Object
org.eclipse.rdf4j.http.server.ServerInterceptor
org.eclipse.rdf4j.http.server.repository.RepositoryInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.HandlerInterceptor
Interceptor for repository requests. Should not be a singleton bean! Configure as inner bean in openrdf-servlet.xml
- Author:
- Herko ter Horst, Arjohn Kampman
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RepositorygetRepository(javax.servlet.http.HttpServletRequest request) static RepositoryConnectiongetRepositoryConnection(javax.servlet.http.HttpServletRequest request) Obtain a newRepositoryConnectionwith suitable parser/writer configuration for handling the incoming HTTP request.static StringgetRepositoryID(javax.servlet.http.HttpServletRequest request) protected StringDetermine the thread name to use.booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse respons, Object handler) voidprotected voidsetRequestAttributes(javax.servlet.http.HttpServletRequest request) Set attributes for this request.Methods inherited from class org.eclipse.rdf4j.http.server.ServerInterceptor
afterCompletion, cleanUpResourcesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
postHandle
-
Constructor Details
-
RepositoryInterceptor
public RepositoryInterceptor()
-
-
Method Details
-
setRepositoryManager
-
preHandle
public boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse respons, Object handler) throws Exception - Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Overrides:
preHandlein classServerInterceptor- Throws:
Exception
-
getThreadName
Description copied from class:ServerInterceptorDetermine the thread name to use. Called before the request is forwarded to a handler.- Specified by:
getThreadNamein classServerInterceptor- Returns:
- a name that makes sense based on the request
-
setRequestAttributes
protected void setRequestAttributes(javax.servlet.http.HttpServletRequest request) throws ClientHTTPException, ServerHTTPException Description copied from class:ServerInterceptorSet attributes for this request. Called before the request is forwarded to a handler. By default, this method does nothing.- Overrides:
setRequestAttributesin classServerInterceptor- Parameters:
request- the request- Throws:
ClientHTTPException- if it was impossible to set one or more attributes due to a bad request on the part of the clientServerHTTPException- if it was impossible to set one or more attributes due to an internal error
-
getRepositoryID
-
getRepository
-
getRepositoryConnection
public static RepositoryConnection getRepositoryConnection(javax.servlet.http.HttpServletRequest request) Obtain a newRepositoryConnectionwith suitable parser/writer configuration for handling the incoming HTTP request. The caller of this method is responsible for closing the connection.- Parameters:
request- theHttpServletRequestfor which aRepositoryConnectionis to be returned- Returns:
- a configured
RepositoryConnection
-