Class ActionExecLib

    • Constructor Detail

      • ActionExecLib

        public ActionExecLib()
    • Method Detail

      • allocHttpAction

        public static HttpAction allocHttpAction​(DataAccessPoint dap,
                                                 org.slf4j.Logger log,
                                                 ActionCategory category,
                                                 javax.servlet.http.HttpServletRequest request,
                                                 javax.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 boolean execAction​(HttpAction action,
                                         java.util.function.Supplier<ActionProcessor> processor)
        execAction, allowing for a choice of ActionProcessor within the logging and error handling.
      • allocRequestId

        public static long allocRequestId​(javax.servlet.http.HttpServletRequest request,
                                          javax.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​(javax.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
      • 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