Class EventQueryServlet

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

    public class EventQueryServlet
    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 servlet via a redirect.
    Author:
    Lawrence Karnowski , OpenNMS
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static String[] IGNORE_LIST
      The list of parameters that are extracted by this servlet and not passed on to the servlet.
      protected String redirectUrl
      The URL for the servlet.
    • 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 event filter.
      protected AfterDateFilter getAfterDateFilter​(javax.servlet.http.HttpServletRequest request)
      getAfterDateFilter
      protected BeforeDateFilter getBeforeDateFilter​(javax.servlet.http.HttpServletRequest request)
      getBeforeDateFilter
      protected Date getDateFromRequest​(javax.servlet.http.HttpServletRequest request, String prefix)
      getDateFromRequest
      protected String[] getRequiredDateFields​(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
    • Field Detail

      • IGNORE_LIST

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

        protected String redirectUrl
        The URL for the servlet. 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 "event/").
    • Constructor Detail

      • EventQueryServlet

        public EventQueryServlet()
    • 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,
                          IOException
        Extracts the key parameters from the parameter set, translates them into filter-based parameters, and then passes the modified parameter set to the event filter.
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • getBeforeDateFilter

        protected BeforeDateFilter getBeforeDateFilter​(javax.servlet.http.HttpServletRequest request)

        getBeforeDateFilter

        Parameters:
        request - a HttpServletRequest object.
        Returns:
        a BeforeDateFilter object.
      • getAfterDateFilter

        protected AfterDateFilter getAfterDateFilter​(javax.servlet.http.HttpServletRequest request)

        getAfterDateFilter

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

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

        getDateFromRequest

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

        protected String[] getRequiredDateFields​(String prefix)

        getRequiredDateFields

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