public abstract class EventUtils extends Object
Abstract EventUtils class.
Constructor and Description |
---|
EventUtils() |
Modifier and Type | Method and Description |
---|---|
static Event |
createInterfaceDeletedEvent(String source,
int nodeId,
InetAddress addr)
Construct an interfaceDeleted event for an interface.
|
static Event |
createNodeAddedEvent(String source,
int nodeId,
String nodeLabel,
OnmsNode.NodeLabelSource labelSource)
createNodeAddedEvent
|
static Event |
createNodeCategoryMembershipChangedEvent(String source,
Integer nodeId,
String nodeLabel) |
static Event |
createNodeDeletedEvent(String source,
int nodeId,
String hostName,
String nodeLabel)
This method is responsible for generating a nodeDeleted event and sending
it to eventd..
|
static Event |
createNodeGainedInterfaceEvent(String source,
int nodeId,
InetAddress ifaddr)
createNodeGainedInterfaceEvent
|
static Event |
createNodeGainedServiceEvent(String source,
int nodeId,
InetAddress ifaddr,
String service,
String nodeLabel,
OnmsNode.NodeLabelSource labelSource,
String sysName,
String sysDescr)
createNodeGainedServiceEvent
|
static Event |
createNodeUpdatedEvent(String source,
Integer nodeId,
String nodeLabel,
OnmsNode.NodeLabelSource labelSource,
String rescanExisting)
createNodeUpdatedEvent
|
static Event |
createServiceDeletedEvent(String source,
int nodeId,
InetAddress addr,
String service)
Constructs a serviceDeleted Event for the nodeId, ipAddr, serviceName
triple
|
static boolean |
eventsMatch(Event e1,
Event e2)
eventsMatch
|
static int |
getIntParm(Event e,
String parmName,
int defaultValue)
Retrieve the value associated with an event parameter and parse it to an
int.
|
static long |
getLongParm(Event e,
String parmName,
long defaultValue)
Retrieve the value associated with an event parameter and parse it to a
long.
|
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 String |
toString(Collection<Parm> parms) |
static String |
toString(Event event)
toString
|
static String |
toString(Snmp snmp)
toString
|
static String |
toString(Value value)
toString
|
public static Event createNodeAddedEvent(String source, int nodeId, String nodeLabel, OnmsNode.NodeLabelSource labelSource)
createNodeAddedEvent
public static Event createNodeGainedInterfaceEvent(String source, int nodeId, InetAddress ifaddr)
createNodeGainedInterfaceEvent
source
- a String
object.nodeId
- a int.ifaddr
- a InetAddress
object.Event
object.public static Event createNodeGainedServiceEvent(String source, int nodeId, InetAddress ifaddr, String service, String nodeLabel, OnmsNode.NodeLabelSource labelSource, String sysName, String sysDescr)
createNodeGainedServiceEvent
public static Event createNodeDeletedEvent(String source, int nodeId, String hostName, String nodeLabel)
source
- A string representing the source of the eventnodeId
- Nodeid of the node got deleted.hostName
- the Host server name.nodeLabel
- the node label of the deleted node.Event
object.public static Event createInterfaceDeletedEvent(String source, int nodeId, InetAddress addr)
source
- the source of the eventnodeId
- the nodeId of the node the interface resides inipAddr
- the ipAdddr of the eventpublic static Event createServiceDeletedEvent(String source, int nodeId, InetAddress addr, String service)
source
- the source of the eventnodeId
- the nodeId that the service resides onipAddr
- the interface that the service resides onservice
- the name of the service that was deletedpublic 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
parsedpublic static int getIntParm(Event e, String parmName, int 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
parsedpublic 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 String getParm(Event e, String parmName)
e
- the Event to get the parameter forparmName
- the name of the parameter to retrievepublic static Event createNodeUpdatedEvent(String source, Integer nodeId, String nodeLabel, OnmsNode.NodeLabelSource labelSource, String rescanExisting)
createNodeUpdatedEvent
public static Event createNodeCategoryMembershipChangedEvent(String source, Integer nodeId, String nodeLabel)
public static String toString(Collection<Parm> parms)
Copyright © 2015. All rights reserved.