Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.ui.action.resource.common.monitor.alerts
Class AlertDefUtil

    java.lang.Object
      org.hyperic.hq.ui.action.resource.common.monitor.alerts.AlertDefUtil

    public class AlertDefUtil

extends java.lang.Object

Utility class for dealing with rendering alert definition conditions.

Constructor Summary
`AlertDefUtil()`

Method Summary
`static java.util.List` | `getAlertConditionBeanList(int sessionID, javax.servlet.http.HttpServletRequest request, org.hyperic.hq.bizapp.shared.MeasurementBoss mb, AlertConditionValue[] acvList, boolean template)` Converts the list of alert conditions into a list of AlertConditionBean objects.
`static AlertDefinitionValue` | `getAlertDefinition(javax.servlet.http.HttpServletRequest request, int sessionID, org.hyperic.hq.bizapp.shared.EventsBoss eb)` Retrieve the alert definition from either the request or from the bizapp as necessary.
`static java.util.List` | `getControlActions(int sessionID, AppdefEntityID adeId, org.hyperic.hq.bizapp.shared.ControlBoss cb)` 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 java.lang.Long[]` | `getDurationAndUnits(java.lang.Long seconds)` Return the duration and units for the passed-in number of seconds.
`static long` | `getSecondsConsideringUnits(long duration, int units)` Converts the duration and units into a number of seconds.
`static ActionValue` | `getSyslogActionValue(AlertDefinitionValue adv)`
`static void` | `prepareSyslogActionForm(AlertDefinitionValue adv, SyslogActionForm form)`
`static void` | `setEnablementRequestAttributes(javax.servlet.http.HttpServletRequest request, AlertDefinitionValue adv)` 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(long duration,
                                                  int units)

  Converts the duration and units into a number of seconds.

  Parameters:
    `duration` - duration
    `units` - one of `org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_MINUTES, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_HOURS, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_DAYS, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_WEEKS`
  Returns:
    the number of seconds

### getDurationAndUnits

    public static java.lang.Long[] getDurationAndUnits(java.lang.Long seconds)

  Return the duration and units for the passed-in number of seconds. The first element of the returned array will be the duration. The second element in the returned array will be one of `org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_SECONDS, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_MINUTES, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_HOURS, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_DAYS, org.hyperic.hq.ui.Constants.ALERT_ACTION_ENABLE_UNITS_WEEKS`.

  Parameters:
    `seconds` - number of seconds (will be updated)
  Returns:
    two-element Long array

### getAlertConditionBeanList

    public static java.util.List getAlertConditionBeanList(int sessionID,
                                                           javax.servlet.http.HttpServletRequest request,
                                                           org.hyperic.hq.bizapp.shared.MeasurementBoss mb,
                                                           AlertConditionValue[] acvList,
                                                           boolean template)

  Converts the list of alert conditions into a list of AlertConditionBean objects.

  Parameters:
    `acvList` - the list of alert conditions to convert
  Returns:
    List of AlertConditionBean objects

### setEnablementRequestAttributes

    public static void setEnablementRequestAttributes(javax.servlet.http.HttpServletRequest request,
                                                      AlertDefinitionValue adv)

  Sets the following request attributes based on what's contained in the AlertConditionValue.
  - enableActionsResource - resource bundle key for display
  - enableActionsHowLong - how long
  - enableActionsHowLongUnits - units (i.e. -- ALERT_ACTION_ENABLE_UNITS_WEEKS)
  - enableActionsHowMany - number of times condition occurs

  Parameters:
    `request` - the http request
    `adv` - the condition

### getAlertDefinition

    public static AlertDefinitionValue getAlertDefinition(javax.servlet.http.HttpServletRequest request,
                                                          int sessionID,
                                                          org.hyperic.hq.bizapp.shared.EventsBoss eb)
                                                   throws SessionNotFoundException,
                                                          SessionTimeoutException,
                                                          javax.naming.NamingException,
                                                          javax.ejb.CreateException,
                                                          SystemException,
                                                          javax.ejb.FinderException,
                                                          java.rmi.RemoteException,
                                                          PermissionException,
                                                          ParameterNotFoundException

  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:
    `SessionNotFoundException`
    `SessionTimeoutException`
    `javax.naming.NamingException`
    `javax.ejb.CreateException`
    `SystemException`
    `javax.ejb.FinderException`
    `java.rmi.RemoteException`
    `PermissionException`
    `ParameterNotFoundException`

### getSyslogActionValue

    public static ActionValue getSyslogActionValue(AlertDefinitionValue adv)

### prepareSyslogActionForm

    public static void prepareSyslogActionForm(AlertDefinitionValue adv,
                                               SyslogActionForm form)
                                        throws EncodingException

  Throws:
    `EncodingException`

### getControlActions

    public static java.util.List getControlActions(int sessionID,
                                                   AppdefEntityID adeId,
                                                   org.hyperic.hq.bizapp.shared.ControlBoss cb)
                                            throws SessionNotFoundException,
                                                   SessionTimeoutException,
                                                   AppdefEntityNotFoundException,
                                                   PluginNotFoundException,
                                                   PermissionException,
                                                   java.rmi.RemoteException,
                                                   GroupNotCompatibleException

  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:
    `java.rmi.RemoteException`
    `PermissionException`
    `PluginNotFoundException`
    `AppdefEntityNotFoundException`
    `SessionTimeoutException`
    `SessionNotFoundException`
    `GroupNotCompatibleException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.