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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected AppConfigurationprotected static final StringThis response content type is always used for JSONP results.protected static final StringThis 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 StringThis 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.ServletConfigprotected static final StringThis query parameter is only used in cases where the configuration property is not setup explicitly.protected static final Stringprotected static final StringJSONP property for enabling/disabling jsonp functionality.protected static final Patternprotected final org.slf4j.Loggerprotected static final Stringprotected static final Stringprotected static final StringDeprecated.protected static final StringDeprecated.protected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected QueryResultWritercheckJSONP(javax.servlet.http.HttpServletRequest req, OutputStream outputStream) voiddestroy()protected QueryResultFormatgetBooleanResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) protected QueryResultFormatgetJSONPResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) protected QueryResultWritergetResultWriter(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp, OutputStream outputStream) javax.servlet.ServletConfigprotected TupleResultBuildergetTupleResultBuilder(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, OutputStream outputStream) Gets aTupleResultBuilderbased 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 QueryResultFormatgetTupleResultFormat(javax.servlet.http.HttpServletRequest req, javax.servlet.ServletResponse resp) voidinit(javax.servlet.ServletConfig config) voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) final voidservice(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:
getServletConfigin interfacejavax.servlet.Servlet
-
getServletInfo
- Specified by:
getServletInfoin interfacejavax.servlet.Servlet
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException - Specified by:
initin interfacejavax.servlet.Servlet- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejavax.servlet.Servlet
-
service
public final void service(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, IOException - Specified by:
servicein interfacejavax.servlet.Servlet- Throws:
javax.servlet.ServletExceptionIOException
-
service
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException - Throws:
javax.servlet.ServletExceptionIOException
-
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 aTupleResultBuilderbased 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:
IOExceptionUnsupportedQueryResultFormatException
-
checkJSONP
protected QueryResultWriter checkJSONP(javax.servlet.http.HttpServletRequest req, OutputStream outputStream) throws IOException - Throws:
IOException
-