org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts
Class AlertDefUtil

java.lang.Object
  extended by org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts.AlertDefUtil

public final class AlertDefUtil
extends Object

Utility class for dealing with rendering alert definition conditions.


Constructor Summary
AlertDefUtil()
           
 
Method Summary
static String formatAlertConditionForDisplay(org.rhq.core.domain.alert.AlertCondition cond, javax.servlet.http.HttpServletRequest request)
           
static List<AlertConditionBean> getAlertConditionBeanList(org.rhq.core.domain.auth.Subject subject, javax.servlet.http.HttpServletRequest request, Set<org.rhq.core.domain.alert.AlertCondition> conds)
          Converts the list of alert conditions into a list of AlertConditionBean objects.
static org.rhq.core.domain.alert.AlertDefinition getAlertDefinition(javax.servlet.http.HttpServletRequest request)
          Deprecated. 
static String getAlertRecoveryInfo(org.rhq.core.domain.alert.Alert alert, int resourceId)
           
static List<OptionItem> getControlActions(org.rhq.core.domain.auth.Subject subject, Integer id, ResourceForm.FormContext context)
          Returns a List of LabelValueBean objects whose labels and values are both set to the string of the control actions for the passed-in resource.
static long getSecondsConsideringUnits(Integer duration, org.rhq.core.domain.alert.AlertDampening.TimeUnits units)
           
static void setAlertDampeningRequestAttributes(javax.servlet.http.HttpServletRequest request, org.rhq.core.domain.alert.AlertDefinition alertDefinition)
          Sets the following request attributes based on what's contained in the AlertConditionValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertDefUtil

public AlertDefUtil()
Method Detail

getSecondsConsideringUnits

public static long getSecondsConsideringUnits(Integer duration,
                                              org.rhq.core.domain.alert.AlertDampening.TimeUnits units)

getAlertConditionBeanList

public static List<AlertConditionBean> getAlertConditionBeanList(org.rhq.core.domain.auth.Subject subject,
                                                                 javax.servlet.http.HttpServletRequest request,
                                                                 Set<org.rhq.core.domain.alert.AlertCondition> conds)
Converts the list of alert conditions into a list of AlertConditionBean objects.

Parameters:
subject -
conds - @return List of AlertConditionBean objects

formatAlertConditionForDisplay

public static String formatAlertConditionForDisplay(org.rhq.core.domain.alert.AlertCondition cond,
                                                    javax.servlet.http.HttpServletRequest request)

setAlertDampeningRequestAttributes

public static void setAlertDampeningRequestAttributes(javax.servlet.http.HttpServletRequest request,
                                                      org.rhq.core.domain.alert.AlertDefinition alertDefinition)
Sets the following request attributes based on what's contained in the AlertConditionValue.

Parameters:
request - the http request
alertDef -

getAlertDefinition

@Deprecated
public static org.rhq.core.domain.alert.AlertDefinition getAlertDefinition(javax.servlet.http.HttpServletRequest request)
                                                                    throws javax.servlet.ServletException
Deprecated. 

Retrieve the alert definition from either the request or from the bizapp as necessary. First check to see if the alertDef is already in the request attributes. If it is, return it. If not, look for an "ad" parameter and then get the alert definition from the bizapp and return it.

Throws:
javax.servlet.ServletException

getControlActions

public static List<OptionItem> getControlActions(org.rhq.core.domain.auth.Subject subject,
                                                 Integer id,
                                                 ResourceForm.FormContext context)
                                          throws Exception
Returns a List of LabelValueBean objects whose labels and values are both set to the string of the control actions for the passed-in resource.

Throws:
Exception

getAlertRecoveryInfo

public static String getAlertRecoveryInfo(org.rhq.core.domain.alert.Alert alert,
                                          int resourceId)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.