Package org.eclipse.rdf4j.workbench.base
Class AbstractServlet
java.lang.Object
org.eclipse.rdf4j.workbench.base.AbstractServlet
- All Implemented Interfaces:
javax.servlet.Servlet
- Direct Known Subclasses:
AbstractRepositoryServlet
,BaseServlet
,WorkbenchGateway
,WorkbenchServlet
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected AppConfiguration
protected static final String
This response content type is always used for JSONP results.protected static final String
This response content type is used for SPARQL Results XML results in non-browser user agents or other cases where application/xml is not specifically requested.protected static final String
This response content type is used in cases where application/xml is explicitly requested, or in cases where the user agent is known to be a commonly available browser.protected javax.servlet.ServletConfig
protected static final String
This query parameter is only used in cases where the configuration property is not setup explicitly.protected static final String
protected static final String
JSONP property for enabling/disabling jsonp functionality.protected static final Pattern
protected final org.slf4j.Logger
protected static final String
protected static final String
protected static final String
Deprecated.protected static final String
Deprecated.protected static final String
protected static final String
protected static final String
protected static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected QueryResultWriter
checkJSONP
(javax.servlet.http.HttpServletRequest req, OutputStream outputStream) void
destroy()
protected QueryResultFormat
getBooleanResultFormat
(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) protected QueryResultFormat
getJSONPResultFormat
(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) protected QueryResultWriter
getResultWriter
(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp, OutputStream outputStream) javax.servlet.ServletConfig
protected TupleResultBuilder
getTupleResultBuilder
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, OutputStream outputStream) Gets aTupleResultBuilder
based on the Accept header, and sets the result content type to the best available match for that, returning a builder that can be used to write out the results.protected QueryResultFormat
getTupleResultFormat
(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) void
init
(javax.servlet.ServletConfig config) void
service
(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) final void
service
(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)
-
Field Details
-
log
protected final org.slf4j.Logger log -
SERVER_USER
Deprecated.- See Also:
-
SERVER_PASSWORD
Deprecated.- See Also:
-
SERVER_USER_PASSWORD
- See Also:
-
ACCEPT
- See Also:
-
APPLICATION_JAVASCRIPT
This response content type is always used for JSONP results.- See Also:
-
APPLICATION_XML
This response content type is used in cases where application/xml is explicitly requested, or in cases where the user agent is known to be a commonly available browser.- See Also:
-
APPLICATION_SPARQL_RESULTS_XML
This response content type is used for SPARQL Results XML results in non-browser user agents or other cases where application/xml is not specifically requested.- See Also:
-
TEXT_HTML
- See Also:
-
TEXT_PLAIN
- See Also:
-
USER_AGENT
- See Also:
-
MSIE
- See Also:
-
MOZILLA
- See Also:
-
JSONP_ENABLED
JSONP property for enabling/disabling jsonp functionality.- See Also:
-
DEFAULT_JSONP_CALLBACK_PARAMETER
This query parameter is only used in cases where the configuration property is not setup explicitly.- See Also:
-
JSONP_VALIDATOR
-
JSONP_CALLBACK_PARAMETER
- See Also:
-
config
protected javax.servlet.ServletConfig config -
appConfig
-
-
Constructor Details
-
AbstractServlet
public AbstractServlet()
-
-
Method Details
-
getServletConfig
public javax.servlet.ServletConfig getServletConfig()- Specified by:
getServletConfig
in interfacejavax.servlet.Servlet
-
getServletInfo
- Specified by:
getServletInfo
in interfacejavax.servlet.Servlet
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
init
in interfacejavax.servlet.Servlet
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejavax.servlet.Servlet
-
service
public final void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, IOException - Specified by:
service
in interfacejavax.servlet.Servlet
- Throws:
javax.servlet.ServletException
IOException
-
service
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException - Throws:
javax.servlet.ServletException
IOException
-
getTupleResultFormat
protected QueryResultFormat getTupleResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) -
getBooleanResultFormat
protected QueryResultFormat getBooleanResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) -
getJSONPResultFormat
protected QueryResultFormat getJSONPResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) -
getResultWriter
protected QueryResultWriter getResultWriter(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp, OutputStream outputStream) throws UnsupportedQueryResultFormatException, IOException -
getTupleResultBuilder
protected TupleResultBuilder getTupleResultBuilder(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, OutputStream outputStream) throws UnsupportedQueryResultFormatException, IOException Gets aTupleResultBuilder
based on the Accept header, and sets the result content type to the best available match for that, returning a builder that can be used to write out the results.- Parameters:
req
- the current HTTP requestresp
- the current HTTP responseoutputStream
- TODO- Returns:
- a builder that can be used to write out the results
- Throws:
IOException
UnsupportedQueryResultFormatException
-
checkJSONP
protected QueryResultWriter checkJSONP(javax.servlet.http.HttpServletRequest req, OutputStream outputStream) throws IOException - Throws:
IOException
-