Class AlarmSeverityChangeController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    public class AlarmSeverityChangeController
    extends org.springframework.web.servlet.mvc.AbstractController
    implements org.springframework.beans.factory.InitializingBean
    This servlet receives an HTTP POST with a list of alarms to escalate or clear, and then it redirects the client to a URL for display. The target URL is configurable in the servlet config (web.xml file).
    Since:
    1.8.1
    Version:
    $Id: $
    Author:
    Jeff Gehlbach , OpenNMS , Jeff Gehlbach , OpenNMS
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CLEAR_ACTION
      Constant CLEAR_ACTION="2"
      static java.lang.String ESCALATE_ACTION
      Constant ESCALATE_ACTION="1"
      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()
      afterPropertiesSet
      protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Adjust the severity of the alarms specified in the POST and then redirect the client to an appropriate URL for display.
      void setAlarmRepository​(AlarmRepository webAlarmRepository)
      setWebAlarmRepository
      void setRedirectView​(java.lang.String redirectView)
      setRedirectView
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getCacheControl, getCacheSeconds, getSupportedMethods, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
      • Methods inherited from class java.lang.Object

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

      • ESCALATE_ACTION

        public static final java.lang.String ESCALATE_ACTION
        Constant ESCALATE_ACTION="1"
        See Also:
        Constant Field Values
      • CLEAR_ACTION

        public static final java.lang.String CLEAR_ACTION
        Constant CLEAR_ACTION="2"
        See Also:
        Constant Field Values
    • Constructor Detail

      • AlarmSeverityChangeController

        public AlarmSeverityChangeController()
    • Method Detail

      • setRedirectView

        public void setRedirectView​(java.lang.String redirectView)

        setRedirectView

        Parameters:
        redirectView - a String object.
      • setAlarmRepository

        public void setAlarmRepository​(AlarmRepository webAlarmRepository)

        setWebAlarmRepository

        Parameters:
        webAlarmRepository - a AlarmRepository object.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception

        afterPropertiesSet

        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception - if any.
      • handleRequestInternal

        protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request,
                                                                                     javax.servlet.http.HttpServletResponse response)
                                                                              throws java.lang.Exception
        Adjust the severity of the alarms specified in the POST and then redirect the client to an appropriate URL for display.
        Specified by:
        handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        java.lang.Exception