org.opennms.web.alarm
Class AlarmSeverityChangeServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.opennms.web.alarm.AlarmSeverityChangeServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class AlarmSeverityChangeServlet
extends HttpServlet

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).

Author:
Jeff Gehlbach , OpenNMS
See Also:
Serialized Form

Field Summary
static String CLEAR_ACTION
           
static String ESCALATE_ACTION
           
protected  String redirectSuccess
          The URL to redirect the client to in case of success.
 
Constructor Summary
AlarmSeverityChangeServlet()
           
 
Method Summary
 void doPost(HttpServletRequest request, HttpServletResponse response)
          Adjust the severity of the alarms specified in the POST and then redirect the client to an appropriate URL for display.
protected  String getRedirectString(HttpServletRequest request)
          Convenience method for dynamically creating the redirect URL if necessary.
 void init()
          Looks up the redirect.success parameter in the servlet's config.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, 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

ESCALATE_ACTION

public static final String ESCALATE_ACTION
See Also:
Constant Field Values

CLEAR_ACTION

public static final String CLEAR_ACTION
See Also:
Constant Field Values

redirectSuccess

protected String redirectSuccess
The URL to redirect the client to in case of success.

Constructor Detail

AlarmSeverityChangeServlet

public AlarmSeverityChangeServlet()
Method Detail

init

public void init()
          throws ServletException
Looks up the redirect.success parameter in the servlet's config. If not present, this servlet will throw an exception so it will be marked unavailable.

Overrides:
init in class GenericServlet
Throws:
ServletException

doPost

public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
            throws ServletException,
                   IOException
Adjust the severity of the alarms specified in the POST and then redirect the client to an appropriate URL for display.

Overrides:
doPost in class HttpServlet
Throws:
ServletException
IOException

getRedirectString

protected String getRedirectString(HttpServletRequest request)
Convenience method for dynamically creating the redirect URL if necessary.



Copyright © 2009. All Rights Reserved.