Class AlarmQueryServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public class AlarmQueryServlet
    extends javax.servlet.http.HttpServlet
    This servlet takes a large and specific request parameter set and maps it to the more robust "filter" parameter set of the AlarmFilterControllervia a redirect.
    Since:
    1.8.1
    Version:
    $Id: $
    Author:
    Lawrence Karnowski , OpenNMS
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Extracts the key parameters from the parameter set, translates them into filter-based parameters, and then passes the modified parameter set to the AlarmFilterController.
      protected AfterFirstEventTimeFilter getAfterFirstEventTimeFilter​(javax.servlet.http.HttpServletRequest request)
      getAfterFirstEventTimeFilter
      protected AfterLastEventTimeFilter getAfterLastEventTimeFilter​(javax.servlet.http.HttpServletRequest request)
      getAfterLastEventTimeFilter
      protected BeforeFirstEventTimeFilter getBeforeFirstEventTimeFilter​(javax.servlet.http.HttpServletRequest request)
      getBeforeFirstEventTimeFilter
      protected BeforeLastEventTimeFilter getBeforeLastEventTimeFilter​(javax.servlet.http.HttpServletRequest request)
      getBeforeLastEventTimeFilter
      protected java.util.Date getDateFromRequest​(javax.servlet.http.HttpServletRequest request, java.lang.String prefix)
      getDateFromRequest
      protected java.lang.String[] getRequiredDateFields​(java.lang.String prefix)
      getRequiredDateFields
      void init()
      init
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • IGNORE_LIST

        protected static java.lang.String[] IGNORE_LIST
        The list of parameters that are extracted by this servlet and not passed on to the AlarmFilterController.
      • redirectUrl

        protected java.lang.String redirectUrl
        The URL for the AlarmFilterController. The default is "list." This URL is a sibling URL, so it is relative to the URL directory that was used to call this servlet (usually "alarm/").
    • Constructor Detail

      • AlarmQueryServlet

        public AlarmQueryServlet()
    • Method Detail

      • init

        public void init()
                  throws javax.servlet.ServletException

        init

        Overrides:
        init in class javax.servlet.GenericServlet
        Throws:
        javax.servlet.ServletException - if any.
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest request,
                          javax.servlet.http.HttpServletResponse response)
                   throws javax.servlet.ServletException,
                          java.io.IOException
        Extracts the key parameters from the parameter set, translates them into filter-based parameters, and then passes the modified parameter set to the AlarmFilterController.
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • getBeforeFirstEventTimeFilter

        protected BeforeFirstEventTimeFilter getBeforeFirstEventTimeFilter​(javax.servlet.http.HttpServletRequest request)

        getBeforeFirstEventTimeFilter

        Parameters:
        request - a HttpServletRequest object.
        Returns:
        a BeforeFirstEventTimeFilter object.
      • getAfterFirstEventTimeFilter

        protected AfterFirstEventTimeFilter getAfterFirstEventTimeFilter​(javax.servlet.http.HttpServletRequest request)

        getAfterFirstEventTimeFilter

        Parameters:
        request - a HttpServletRequest object.
        Returns:
        a AfterFirstEventTimeFilter object.
      • getBeforeLastEventTimeFilter

        protected BeforeLastEventTimeFilter getBeforeLastEventTimeFilter​(javax.servlet.http.HttpServletRequest request)

        getBeforeLastEventTimeFilter

        Parameters:
        request - a HttpServletRequest object.
        Returns:
        a BeforeLastEventTimeFilter object.
      • getAfterLastEventTimeFilter

        protected AfterLastEventTimeFilter getAfterLastEventTimeFilter​(javax.servlet.http.HttpServletRequest request)

        getAfterLastEventTimeFilter

        Parameters:
        request - a HttpServletRequest object.
        Returns:
        a AfterLastEventTimeFilter object.
      • getDateFromRequest

        protected java.util.Date getDateFromRequest​(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String prefix)
                                             throws MissingParameterException

        getDateFromRequest

        Parameters:
        request - a HttpServletRequest object.
        prefix - a String object.
        Returns:
        a Date object.
        Throws:
        MissingParameterException - if any.
      • getRequiredDateFields

        protected java.lang.String[] getRequiredDateFields​(java.lang.String prefix)

        getRequiredDateFields

        Parameters:
        prefix - a String object.
        Returns:
        an array of String objects.