org.hyperic.hq.events.ext
Class RegisteredTriggers
java.lang.Object
org.hyperic.hq.events.ext.RegisteredTriggers
- All Implemented Interfaces:
- RegisterableTriggerRepository
public class RegisteredTriggers
- extends java.lang.Object
- implements RegisterableTriggerRepository
Repository of in memory triggers for event processing
Field Summary |
static java.lang.Integer |
KEY_ALL
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KEY_ALL
public static final java.lang.Integer KEY_ALL
getInterestedTriggers
public java.util.Collection getInterestedTriggers(java.lang.Class eventClass,
java.lang.Integer instanceId)
- Specified by:
getInterestedTriggers
in interface RegisterableTriggerRepository
- Parameters:
eventClass
- The event classinstanceId
- The id of the source instance of the event
- Returns:
- The
RegisterableTriggerInterface
s interested in the event
addTrigger
public void addTrigger(RegisterableTriggerInterface trigger)
- Specified by:
addTrigger
in interface RegisterableTriggerRepository
- Parameters:
trigger
- The trigger to add to the repository
removeTrigger
public void removeTrigger(java.lang.Integer triggerId)
- Specified by:
removeTrigger
in interface RegisterableTriggerRepository
- Parameters:
triggerId
- The trigger to remove from the repository
getTriggerById
public RegisterableTriggerInterface getTriggerById(java.lang.Integer triggerId)
- Specified by:
getTriggerById
in interface RegisterableTriggerRepository
- Parameters:
triggerId
- The trigger ID
- Returns:
- The
RegisterableTriggerInterface
with the specified ID or null if none exists
setTriggersEnabled
public void setTriggersEnabled(java.util.Collection triggerIds,
boolean enabled)
- Description copied from interface:
RegisterableTriggerRepository
- Enables or disables triggers. Should be called when the alert definition is enabled or disabled.
Disabled triggers will not be returned from calls to getInterestedTriggers, and therefore will not receive events from the RegisteredDispatcher
- Specified by:
setTriggersEnabled
in interface RegisterableTriggerRepository
- Parameters:
triggerIds
- The triggers that should be enabled or disabledenabled
- true if triggers should be enabled
isInitialized
public boolean isInitialized()
- Specified by:
isInitialized
in interface RegisterableTriggerRepository
- Returns:
- true if the repository has been intialized. This typically occurs shortly after server startup, before the event is processed.
Repository contents should be re-created from database.
getAndInitialize
public static RegisteredTriggers getAndInitialize()
- Will block if the Triggers are not initialized.
getInstance
public static RegisteredTriggers getInstance()
reset
public static void reset()
getInterestedTriggers
public static java.util.Collection getInterestedTriggers(AbstractEvent event)
isTriggerInterested
public static boolean isTriggerInterested(AbstractEvent event)
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.