Class ActionExecLib

java.lang.Object
org.apache.jena.fuseki.servlets.ActionExecLib

public class ActionExecLib extends Object
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 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 request
      response - HTTP response
      Returns:
      a new HTTP Action
    • execAction

      public static void execAction(HttpAction action, ActionProcessor processor)
      Standard execution lifecycle for a SPARQL Request. Common process for handling HTTP requests with logging and Java error handling. This is the case where the ActionProcessor is defined by or is the servlet directly outside the Fuseki dispatch process (ServletAction for special case like SPARQL_QueryGeneral which directly holds the ActionProcessor and ServletProcessor for administration actions.

      Return false if the ActionProcessor is null.

      Parameters:
      action -
      processor -
    • execAction

      public static boolean execAction(HttpAction action, Supplier<ActionProcessor> processor)
      execAction, allowing for a choice of ActionProcessor 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 Request
      response - 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 - Response
      id - Request ID
    • logRequest

      public static void logRequest(HttpAction action)
      Log an HttpAction request.
    • logResponse

      public static void logResponse(HttpAction action)
      Log an HttpAction response. This includes a message to the action log and also on to the standard format Combined NCSA log.
    • logNoResponse

      public static void logNoResponse(HttpAction action)
      Log when we don't handle this request.
    • initResponse

      public static void initResponse(HttpAction action)
      Set headers for the response.
    • incCounter

      public static void incCounter(Counters counters, CounterName name)
      Increment counter
    • decCounter

      public static void decCounter(Counters counters, CounterName name)
      Decrement counter
    • incCounter

      public static void incCounter(CounterSet counters, CounterName name)
    • decCounter

      public static void decCounter(CounterSet counters, CounterName name)