java.lang.Object
org.apache.jena.fuseki.servlets.ActionExecLib
Functions relating to
HttpAction
objects, including the standard execute with logging process (execAction(org.apache.jena.fuseki.servlets.HttpAction, org.apache.jena.fuseki.servlets.ActionProcessor)
)-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRequestId
(jakarta.servlet.http.HttpServletResponse response, long id) Helper method for attaching a request ID to a response as a headerstatic HttpAction
allocHttpAction
(DataAccessPoint dap, org.slf4j.Logger log, ActionCategory category, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Returns a fresh HTTP Action for this request.static long
allocRequestId
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Helper method which gets a unique request ID and appends it as a header to the responsestatic void
decCounter
(CounterSet counters, CounterName name) static void
decCounter
(Counters counters, CounterName name) Decrement counterstatic boolean
execAction
(HttpAction action, Supplier<ActionProcessor> processor) execAction, allowing for a choice ofActionProcessor
within the logging and error handling.static void
execAction
(HttpAction action, ActionProcessor processor) Standard execution lifecycle for a SPARQL Request.static void
incCounter
(CounterSet counters, CounterName name) static void
incCounter
(Counters counters, CounterName name) Increment counterstatic void
initResponse
(HttpAction action) Set headers for the response.static void
logNoResponse
(HttpAction action) Log when we don't handle this request.static void
logRequest
(HttpAction action) Log anHttpAction
request.static void
logResponse
(HttpAction action) Log anHttpAction
response.
-
Constructor Details
-
ActionExecLib
public ActionExecLib()
-
-
Method Details
-
allocHttpAction
public static HttpAction allocHttpAction(DataAccessPoint dap, org.slf4j.Logger log, ActionCategory category, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Returns a fresh HTTP Action for this request.- Parameters:
dap
-request
- HTTP requestresponse
- HTTP response- Returns:
- a new HTTP Action
-
execAction
Standard execution lifecycle for a SPARQL Request.startRequest(HttpAction)
- initial statistics,
ActionLifecycle.validate(HttpAction)
request,ActionLifecycle.execute(HttpAction)
request,- completion/error statistics,
finishRequest(HttpAction)
ServletAction
for special case likeSPARQL_QueryGeneral
which directly holds theActionProcessor
andServletProcessor
for administration actions.Return false if the ActionProcessor is null.
- Parameters:
action
-processor
-
-
execAction
execAction, allowing for a choice ofActionProcessor
within the logging and error handling. Return false if there was no ActionProcessor to handle the action. -
allocRequestId
public static long allocRequestId(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Helper method which gets a unique request ID and appends it as a header to the response- Parameters:
request
- HTTP Requestresponse
- HTTP Response- Returns:
- Request ID
-
addRequestId
public static void addRequestId(jakarta.servlet.http.HttpServletResponse response, long id) Helper method for attaching a request ID to a response as a header- Parameters:
response
- Responseid
- Request ID
-
logRequest
Log anHttpAction
request. -
logResponse
Log anHttpAction
response. This includes a message to the action log and also on to the standard format Combined NCSA log. -
logNoResponse
Log when we don't handle this request. -
initResponse
Set headers for the response. -
incCounter
Increment counter -
decCounter
Decrement counter -
incCounter
-
decCounter
-