public abstract class EventUtils extends Object
Constructor and Description |
---|
EventUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addEventListener(EventListener listener,
List<String> 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 |
checkInterfaceOrIfIndex(Event e)
Ensures the given event has an interface or ifIndex
|
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 boolean |
isNonIpInterface(String intf)
Is the given interface a non-IP interface
|
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
|
public static void addEventListener(EventListener listener, List<String> ueiList)
listener
- the lister to addueiList
- the list of events the listener is interestedpublic static void checkEventId(Event e) throws InsufficientInformationException
e
- the eventInsufficientInformationException
- if an event id is not availablepublic static void checkInterface(Event e) throws InsufficientInformationException
e
- the eventInsufficientInformationException
- if an interface is not availablepublic static boolean isNonIpInterface(String intf)
intf
- the interfacepublic static void checkInterfaceOrIfIndex(Event e) throws InsufficientInformationException
e
- the eventInsufficientInformationException
- if neither an interface nor an ifIndex is availablepublic static void checkHost(Event e) throws InsufficientInformationException
e
- the eventInsufficientInformationException
- if an interface is not availablepublic static void checkNodeId(Event e) throws InsufficientInformationException
e
- the eventInsufficientInformationException
- if a node id is not availablepublic static void checkService(Event e) throws InsufficientInformationException
e
- the event to checkInsufficientInformationException
- if the event does not have a servicepublic static long getEventID(Event e)
e
- the event to get the eventId forpublic 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 parameter can not be retrieved or
parsedpublic static long getNodeId(Event e)
e
- the eventpublic static String getParm(Event e, String parmName)
e
- the Event to get the parameter forparmName
- the name of the parameter to retrievepublic 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 setpublic static void requireParm(Event e, String parmName) throws InsufficientInformationException
e
- the event the parameter must reside onparmName
- a String
object.InsufficientInformationException
- if the parameter is not set on the event or if its value has
no contentpublic static void sendEvent(Event newEvent, String callerUei, long txNo, boolean isXmlRpcEnabled)
newEvent
- the event to sendisXmlRpcEnabled
- whether or not an XMLRPC event should be sentcallerUei
- a String
object.txNo
- a long.Copyright © 2015. All Rights Reserved.