CounterExecutionStrategy (Hyperic HQ Plugin API)
Keywords: org.hyperic.hq.events.server.session.CounterExecutionStrategy class

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.events.server.session
Class CounterExecutionStrategy

    java.lang.Object
      org.hyperic.hq.events.server.session.CounterExecutionStrategy

All Implemented Interfaces:
  ExecutionStrategy

    public class CounterExecutionStrategy

extends java.lang.Object
implements ExecutionStrategy

Implementation of `ExecutionStrategy` that fires an `AlertConditionsSatisfiedZEvent` when a certain number of events have occurred within a given time window. Logic originally kept in a CounterTrigger class.

Constructor Summary
`CounterExecutionStrategy(long count, long timeRange, ZeventEnqueuer zeventEnqueuer)`

Method Summary
`void` | `conditionsSatisfied(AlertConditionsSatisfiedZEvent event)` Indicates that all conditions associated with an alert definition have been met
`java.io.Serializable` | `getState()`
`void` | `initialize(java.io.Serializable initialState)` Initializes this strategy

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CounterExecutionStrategy

    public CounterExecutionStrategy(long count,
                                    long timeRange,
                                    ZeventEnqueuer zeventEnqueuer)

Parameters:
  `count` - The number of times the alert conditions must be satisfied
  `timeRange` - The time window (in milliseconds) in which the specified count of alert conditions must be satisfied.
  `zeventEnqueuer` - The `ZeventEnqueuer` to use for sending `AlertConditionsSatisfiedZEvent`s

Method Detail

### conditionsSatisfied

    public void conditionsSatisfied(AlertConditionsSatisfiedZEvent event)

  Description copied from interface: `ExecutionStrategy`
  Indicates that all conditions associated with an alert definition have been met

  Specified by:
    `conditionsSatisfied` in interface `ExecutionStrategy`
  Parameters:
    `event` - An `AlertConditionsSatisfiedZEvent` to process

### getState

    public java.io.Serializable getState()

  Specified by:
    `getState` in interface `ExecutionStrategy`
  Returns:
    Any state held by this strategy that should be persisted between server restarts. May be null if no state saved.

### initialize

    public void initialize(java.io.Serializable initialState)

  Description copied from interface: `ExecutionStrategy`
  Initializes this strategy

  Specified by:
    `initialize` in interface `ExecutionStrategy`
  Parameters:
    `initialState` - Any state that was saved by the strategy with this alertDefinitionId the last time the server was shutdown. May be null if no state saved.

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.