|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.linkd.EventUtils
public class EventUtils
Provides a collection of utility methods used by the DeleteEvent Processor for dealing with Events
| Constructor Summary | |
|---|---|
EventUtils()
|
|
| Method Summary | |
|---|---|
static void |
addEventListener(EventListener listener,
List ueiList)
Make the given listener object a listener for the list of events referenced in the ueiList. |
static void |
checkEventId(Event e)
Ensures that the event has a database eventId |
static void |
checkHost(Event e)
Ensures the given event has a host |
static void |
checkInterface(Event e)
Ensures the given event has an interface |
static void |
checkNodeId(Event e)
Ensures that the given Event has a node id |
static void |
checkService(Event e)
Ensures that the given event has a service parameter |
static long |
getEventID(Event e)
Get the eventId for the given event |
static long |
getLongParm(Event e,
String parmName,
long defaultValue)
Retrieve the value associated with an event parameter and parse it to a long. |
static long |
getNodeId(Event e)
Return the nodeId of the node associated with and event, or -1 of no node is associated. |
static String |
getParm(Event e,
String parmName)
Return the value of an event parameter of null if it does not exist. |
static String |
getParm(Event e,
String parmName,
String defaultValue)
Retrieve a parameter from and event, returning defaultValue of the parameter is not set. |
static void |
requireParm(Event e,
String parmName)
Throw an exception if an event does have the required parameter |
static void |
sendEvent(Event newEvent,
String callerUei,
long txNo,
boolean isXmlRpcEnabled)
Send an event to the Event manager to be broadcast to interested listeners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventUtils()
| Method Detail |
|---|
public static void addEventListener(EventListener listener,
List ueiList)
listener - the lister to addueiList - the list of events the listener is interested
public static void checkEventId(Event e)
throws InsufficientInformationException
e - the event
InsufficientInformationException - if an event id is not evailable
public static void checkInterface(Event e)
throws InsufficientInformationException
e - the event
InsufficientInformationException - if an interface is not available
public static void checkHost(Event e)
throws InsufficientInformationException
e - the event
InsufficientInformationException - if an interface is not available
public static void checkNodeId(Event e)
throws InsufficientInformationException
e - the event
InsufficientInformationException - if a node id is not available
public static void checkService(Event e)
throws InsufficientInformationException
e - the event to check
InsufficientInformationException - if the event does not have a servicepublic static long getEventID(Event e)
e - the event to get the eventId for
public static long getLongParm(Event e,
String parmName,
long defaultValue)
e - the Event to retrieve the parameter fromparmName - the name of the parameter to retrievedefaultValue - the value to return if the paramter can not be retrieved or
parsed
public static long getNodeId(Event e)
e - the event
public static String getParm(Event e,
String parmName)
e - the Event to get the parameter forparmName - the name of the parameter to retrieve
public static String getParm(Event e,
String parmName,
String defaultValue)
e - The Event to retrieve the parameter fromparmName - the name of the parameter to retrievedefaultValue - the default value to return if the parameter is not set
public static void requireParm(Event e,
String parmName)
throws InsufficientInformationException
e - the event the parameter must reside onparmname - the name of the parameter
InsufficientInformationException - if the paramter is not set on the event or if its value has
no content
public static void sendEvent(Event newEvent,
String callerUei,
long txNo,
boolean isXmlRpcEnabled)
newEvent - the event to sendisXmlRpcEnabled - FIXME
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||