Class StatusPageHandler

java.lang.Object
de.elo.utils.webapp.status.StatusPageHandler
Direct Known Subclasses:
IXClientServletHandler

public class StatusPageHandler
extends java.lang.Object
This class is the bridge between a HttpServlet class and the classes of this package.

The function service(Request, Response, StatusDataCallback) is the main method of this class. Its purpose is to render the status page and handle predefined actions like modifying the logging level.

HttpServlet derived classes should override the HttpServlet.service function and forward requests to an instance of StatusPageHandler.

The service method of the StatusPageHandler evaluates requests with parameters: __cmd__, __loglevel__ and __mode__.

See Also:
StatusPageServletExample
  • Field Details

  • Constructor Details

  • Method Details

    • printStatus

      public void printStatus​(StatusPageHandler.Response resp, boolean isAuth, boolean htmlNotText, StatusPageHandler.StatusDataCallback callback) throws java.io.IOException
      This function prints the status page.
      Parameters:
      resp - HttpServletResponse resp
      isAuth - Authentication was successfully
      htmlNotText - true for HTML output, false for plain text output
      callback - StatusDataCallback object
      Throws:
      java.io.IOException
    • service

      public boolean service​(StatusPageHandler.Request req, StatusPageHandler.Response resp, StatusPageHandler.StatusDataCallback callback) throws java.io.IOException
      Called from the Servlet.service method to handle known commands.
      Parameters:
      req - Wrapper for HttpServletRequest
      resp - Wrapper fro HttpServletResponse
      callback - StatusDataCallback StatusData
      Returns:
      true, if the message was processed.
      Throws:
      ServletException
      java.io.IOException
    • setLogLevel

      public void setLogLevel​(java.lang.String logger, java.lang.String reportLevel)
      Modifies the report level of the root logger.
      Parameters:
      logger - Logger name, null or empty for root logger.
      reportLevel - one of "DEBUG", "INFO", "WARN", "ERROR"
    • getLogLevel

      public java.lang.String getLogLevel()
      Returns the report level of the root logger.
      Returns:
      "DEBUG", "INFO", "WARN", "ERROR"