Class AbstractServlet
java.lang.Object
org.eclipse.rdf4j.workbench.base.AbstractServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet
- Direct Known Subclasses:
AbstractRepositoryServlet, 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 jakarta.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(jakarta.servlet.http.HttpServletRequest req, OutputStream outputStream) voiddestroy()protected QueryResultFormatgetBooleanResultFormat(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) protected QueryResultFormatgetJSONPResultFormat(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) protected QueryResultWritergetResultWriter(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp, OutputStream outputStream) jakarta.servlet.ServletConfigprotected TupleResultBuildergetTupleResultBuilder(jakarta.servlet.http.HttpServletRequest req, jakarta.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(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) voidinit(jakarta.servlet.ServletConfig config) voidservice(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) final voidservice(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp)
-
Field Details
-
log
protected final org.slf4j.Logger log -
SERVER_USER
-
SERVER_PASSWORD
-
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 jakarta.servlet.ServletConfig config -
appConfig
-
-
Constructor Details
-
AbstractServlet
public AbstractServlet()
-
-
Method Details
-
getServletConfig
public jakarta.servlet.ServletConfig getServletConfig()- Specified by:
getServletConfigin interfacejakarta.servlet.Servlet
-
getServletInfo
- Specified by:
getServletInfoin interfacejakarta.servlet.Servlet
-
init
public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException - Specified by:
initin interfacejakarta.servlet.Servlet- Throws:
jakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroyin interfacejakarta.servlet.Servlet
-
service
public final void service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp) throws jakarta.servlet.ServletException, IOException - Specified by:
servicein interfacejakarta.servlet.Servlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
service
public void service(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws jakarta.servlet.ServletException, IOException - Throws:
jakarta.servlet.ServletExceptionIOException
-
getTupleResultFormat
protected QueryResultFormat getTupleResultFormat(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) -
getBooleanResultFormat
protected QueryResultFormat getBooleanResultFormat(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) -
getJSONPResultFormat
protected QueryResultFormat getJSONPResultFormat(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp) -
getResultWriter
protected QueryResultWriter getResultWriter(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.ServletResponse resp, OutputStream outputStream) throws UnsupportedQueryResultFormatException, IOException -
getTupleResultBuilder
protected TupleResultBuilder getTupleResultBuilder(jakarta.servlet.http.HttpServletRequest req, jakarta.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(jakarta.servlet.http.HttpServletRequest req, OutputStream outputStream) throws IOException - Throws:
IOException
-