Class MockEventUtil
- java.lang.Object
-
- org.opennms.netmgt.mock.MockEventUtil
-
public abstract class MockEventUtil extends java.lang.Object
Abstract MockEventUtil class.
- Version:
- $Id: $
- Author:
- brozow TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
-
-
Constructor Summary
Constructors Constructor Description MockEventUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Event
createBgpBkTnEvent(java.lang.String source, MockNode node, java.lang.String ipAddr, int peerState)
createBgpBkTnEventstatic Event
createEvent(java.lang.String source, java.lang.String uei, int nodeId, java.lang.String ipAddr, java.lang.String svcName, java.lang.String reason)
createEventstatic EventBuilder
createEventBuilder(java.lang.String source, java.lang.String uei)
createEventBuilderstatic EventBuilder
createEventBuilder(java.lang.String source, java.lang.String uei, int nodeId, java.lang.String ipAddr, java.lang.String svcName, java.lang.String reason)
createEventBuilderstatic Event
createInterfaceDeletedEvent(java.lang.String source, MockInterface iface)
createInterfaceDeletedEventstatic Event
createInterfaceDownEvent(java.lang.String source, MockInterface iface)
createInterfaceDownEventstatic Event
createInterfaceEvent(java.lang.String source, java.lang.String uei, MockInterface iface)
createInterfaceEventstatic EventBuilder
createInterfaceEventBuilder(java.lang.String source, java.lang.String uei, MockInterface iface)
createInterfaceEventBuilderstatic Event
createInterfaceUpEvent(java.lang.String source, MockInterface iface)
createInterfaceUpEventstatic EventBuilder
createNewSuspectEventBuilder(java.lang.String source, java.lang.String uei, java.lang.String ipAddr)
createNewSuspectEventBuilderstatic Event
createNodeAddedEvent(java.lang.String source, MockNode node)
createNodeAddedEventstatic Event
createNodeDeletedEvent(java.lang.String source, MockNode node)
createNodeDeletedEventstatic Event
createNodeDownEvent(java.lang.String source, MockNode node)
createNodeDownEventstatic EventBuilder
createNodeDownEventBuilder(java.lang.String source, MockNode node)
createNodeDownEventBuilderstatic EventBuilder
createNodeDownEventBuilder(java.lang.String source, OnmsNode node)
createNodeDownEventBuilderstatic Event
createNodeDownEventWithReason(java.lang.String source, MockNode node, java.lang.String reason)
createNodeDownEventWithReasonstatic Event
createNodeEvent(java.lang.String source, java.lang.String uei, MockNode node)
createNodeEventstatic EventBuilder
createNodeEventBuilder(java.lang.String source, java.lang.String uei, MockNode node)
createNodeEventBuilderstatic EventBuilder
createNodeEventBuilder(java.lang.String source, java.lang.String uei, OnmsNode node)
createNodeEventBuilderstatic Event
createNodeEventWithReason(java.lang.String source, java.lang.String uei, MockNode node, java.lang.String reason)
createNodeEventWithReasonstatic Event
createNodeGainedInterfaceEvent(java.lang.String source, MockInterface iface)
createNodeGainedInterfaceEventstatic Event
createNodeGainedServiceEvent(java.lang.String source, MockService svc)
createNodeGainedServiceEventstatic Event
createNodeLostServiceEvent(java.lang.String source, MockService svc)
createNodeLostServiceEventstatic Event
createNodeLostServiceEvent(java.lang.String source, MockService svc, java.lang.String reason)
createNodeLostServiceEventstatic Event
createNodeRegainedServiceEvent(java.lang.String source, MockService svc)
createNodeRegainedServiceEventstatic Event
createNodeUpEvent(java.lang.String source, MockNode node)
createNodeUpEventstatic EventBuilder
createNodeUpEventBuilder(java.lang.String source, MockNode node)
createNodeUpEventBuilderstatic EventBuilder
createNodeUpEventBuilder(java.lang.String source, OnmsNode node)
static Event
createOutageCreatedEvent(java.lang.String source, MockService svc, java.lang.String reason)
static Event
createOutageResolvedEvent(java.lang.String source, MockService svc, java.lang.String reason)
static Event
createReparentEvent(java.lang.String source, java.lang.String ipAddr, int oldNode, int newNode)
createReparentEventstatic Event
createResumePollingServiceEvent(java.lang.String source, MockService svc)
createResumePollingServiceEventstatic Event
createServiceDeletedEvent(java.lang.String source, MockService svc)
createServiceDeletedEventstatic Event
createServiceEvent(java.lang.String source, java.lang.String uei, MockService svc, java.lang.String reason)
createServiceEventstatic EventBuilder
createServiceEventBuilder(java.lang.String source, java.lang.String uei, MockService svc, java.lang.String reason)
createServiceEventBuilderstatic Event
createServiceResponsiveEvent(java.lang.String source, MockService svc)
createServiceResponsiveEventstatic Event
createServiceUnresponsiveEvent(java.lang.String source, MockService svc, java.lang.String reason)
createServiceUnresponsiveEventstatic EventBuilder
createServiceUnresponsiveEventBuilder(java.lang.String source, MockService svc, java.lang.String reason)
createServiceUnresponsiveEventBuilderstatic Event
createSuspendPollingServiceEvent(java.lang.String source, MockService svc)
createSuspendPollingServiceEventstatic boolean
eventsMatch(Event e1, Event e2)
Deprecated.UseEventUtils.eventsMatch(Event,Event)
insteadstatic boolean
eventsMatchDeep(Event e1, Event e2)
eventsMatchDeepstatic boolean
eventsMatchDeep(Event e1, Event e2, long toleratedTimestampOffset)
eventsMatchDeepstatic void
printEvent(java.lang.String prefix, Event event)
printEventstatic void
printEvents(java.lang.String prefix, java.util.Collection<Event> events)
printEventsstatic void
setEventTime(Event event, java.util.Date date)
setEventTime
-
-
-
Method Detail
-
createNodeLostServiceEvent
public static Event createNodeLostServiceEvent(java.lang.String source, MockService svc, java.lang.String reason)
createNodeLostServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.reason
- aString
object.- Returns:
- a
Event
object.
-
createOutageCreatedEvent
public static Event createOutageCreatedEvent(java.lang.String source, MockService svc, java.lang.String reason)
-
createOutageResolvedEvent
public static Event createOutageResolvedEvent(java.lang.String source, MockService svc, java.lang.String reason)
-
createNodeLostServiceEvent
public static Event createNodeLostServiceEvent(java.lang.String source, MockService svc)
createNodeLostServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createNodeRegainedServiceEvent
public static Event createNodeRegainedServiceEvent(java.lang.String source, MockService svc)
createNodeRegainedServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createServiceUnresponsiveEvent
public static Event createServiceUnresponsiveEvent(java.lang.String source, MockService svc, java.lang.String reason)
createServiceUnresponsiveEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.reason
- aString
object.- Returns:
- a
Event
object.
-
createServiceUnresponsiveEventBuilder
public static EventBuilder createServiceUnresponsiveEventBuilder(java.lang.String source, MockService svc, java.lang.String reason)
createServiceUnresponsiveEventBuilder
- Parameters:
source
- aString
object.svc
- aMockService
object.reason
- aString
object.- Returns:
- a
EventBuilder
object.
-
createServiceResponsiveEvent
public static Event createServiceResponsiveEvent(java.lang.String source, MockService svc)
createServiceResponsiveEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createNodeGainedServiceEvent
public static Event createNodeGainedServiceEvent(java.lang.String source, MockService svc)
createNodeGainedServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createServiceDeletedEvent
public static Event createServiceDeletedEvent(java.lang.String source, MockService svc)
createServiceDeletedEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createSuspendPollingServiceEvent
public static Event createSuspendPollingServiceEvent(java.lang.String source, MockService svc)
createSuspendPollingServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createResumePollingServiceEvent
public static Event createResumePollingServiceEvent(java.lang.String source, MockService svc)
createResumePollingServiceEvent
- Parameters:
source
- aString
object.svc
- aMockService
object.- Returns:
- a
Event
object.
-
createServiceEvent
public static Event createServiceEvent(java.lang.String source, java.lang.String uei, MockService svc, java.lang.String reason)
createServiceEvent
- Parameters:
source
- aString
object.uei
- aString
object.svc
- aMockService
object.reason
- aString
object.- Returns:
- a
Event
object.
-
createServiceEventBuilder
public static EventBuilder createServiceEventBuilder(java.lang.String source, java.lang.String uei, MockService svc, java.lang.String reason)
createServiceEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.svc
- aMockService
object.reason
- aString
object.- Returns:
- a
EventBuilder
object.
-
createInterfaceDownEvent
public static Event createInterfaceDownEvent(java.lang.String source, MockInterface iface)
createInterfaceDownEvent
- Parameters:
source
- aString
object.iface
- aMockInterface
object.- Returns:
- a
Event
object.
-
createInterfaceUpEvent
public static Event createInterfaceUpEvent(java.lang.String source, MockInterface iface)
createInterfaceUpEvent
- Parameters:
source
- aString
object.iface
- aMockInterface
object.- Returns:
- a
Event
object.
-
createNodeGainedInterfaceEvent
public static Event createNodeGainedInterfaceEvent(java.lang.String source, MockInterface iface)
createNodeGainedInterfaceEvent
- Parameters:
source
- aString
object.iface
- aMockInterface
object.- Returns:
- a
Event
object.
-
createInterfaceDeletedEvent
public static Event createInterfaceDeletedEvent(java.lang.String source, MockInterface iface)
createInterfaceDeletedEvent
- Parameters:
source
- aString
object.iface
- aMockInterface
object.- Returns:
- a
Event
object.
-
createInterfaceEvent
public static Event createInterfaceEvent(java.lang.String source, java.lang.String uei, MockInterface iface)
createInterfaceEvent
- Parameters:
source
- aString
object.uei
- aString
object.iface
- aMockInterface
object.- Returns:
- a
Event
object.
-
createInterfaceEventBuilder
public static EventBuilder createInterfaceEventBuilder(java.lang.String source, java.lang.String uei, MockInterface iface)
createInterfaceEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.iface
- aMockInterface
object.- Returns:
- a
EventBuilder
object.
-
createNodeDownEvent
public static Event createNodeDownEvent(java.lang.String source, MockNode node)
createNodeDownEvent
-
createNodeDownEventBuilder
public static EventBuilder createNodeDownEventBuilder(java.lang.String source, MockNode node)
createNodeDownEventBuilder
- Parameters:
source
- aString
object.node
- aMockNode
object.- Returns:
- a
EventBuilder
object.
-
createNodeDownEventBuilder
public static EventBuilder createNodeDownEventBuilder(java.lang.String source, OnmsNode node)
createNodeDownEventBuilder
- Parameters:
source
- aString
object.node
- aMockNode
object.- Returns:
- a
EventBuilder
object.
-
createNodeDownEventWithReason
public static Event createNodeDownEventWithReason(java.lang.String source, MockNode node, java.lang.String reason)
createNodeDownEventWithReason
-
createNodeUpEventBuilder
public static EventBuilder createNodeUpEventBuilder(java.lang.String source, OnmsNode node)
-
createNodeUpEventBuilder
public static EventBuilder createNodeUpEventBuilder(java.lang.String source, MockNode node)
createNodeUpEventBuilder
- Parameters:
source
- aString
object.node
- aMockNode
object.- Returns:
- a
EventBuilder
object.
-
createNodeUpEvent
public static Event createNodeUpEvent(java.lang.String source, MockNode node)
createNodeUpEvent
-
createNodeAddedEvent
public static Event createNodeAddedEvent(java.lang.String source, MockNode node)
createNodeAddedEvent
-
createNodeDeletedEvent
public static Event createNodeDeletedEvent(java.lang.String source, MockNode node)
createNodeDeletedEvent
-
createNodeEvent
public static Event createNodeEvent(java.lang.String source, java.lang.String uei, MockNode node)
createNodeEvent
-
createNodeEventBuilder
public static EventBuilder createNodeEventBuilder(java.lang.String source, java.lang.String uei, MockNode node)
createNodeEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.node
- aMockNode
object.- Returns:
- a
EventBuilder
object.
-
createNodeEventBuilder
public static EventBuilder createNodeEventBuilder(java.lang.String source, java.lang.String uei, OnmsNode node)
createNodeEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.node
- aMockNode
object.- Returns:
- a
EventBuilder
object.
-
createNodeEventWithReason
public static Event createNodeEventWithReason(java.lang.String source, java.lang.String uei, MockNode node, java.lang.String reason)
createNodeEventWithReason
-
createNewSuspectEventBuilder
public static EventBuilder createNewSuspectEventBuilder(java.lang.String source, java.lang.String uei, java.lang.String ipAddr)
createNewSuspectEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.ipAddr
- aString
object.- Returns:
- a
EventBuilder
object.
-
createBgpBkTnEvent
public static Event createBgpBkTnEvent(java.lang.String source, MockNode node, java.lang.String ipAddr, int peerState)
createBgpBkTnEvent
-
setEventTime
public static void setEventTime(Event event, java.util.Date date)
setEventTime
- Parameters:
event
- aEvent
object.date
- aDate
object.
-
createEvent
public static Event createEvent(java.lang.String source, java.lang.String uei, int nodeId, java.lang.String ipAddr, java.lang.String svcName, java.lang.String reason)
createEvent
- Parameters:
source
- aString
object.uei
- aString
object.nodeId
- a int.ipAddr
- aString
object.svcName
- aString
object.reason
- aString
object.- Returns:
- a
Event
object.
-
createEventBuilder
public static EventBuilder createEventBuilder(java.lang.String source, java.lang.String uei, int nodeId, java.lang.String ipAddr, java.lang.String svcName, java.lang.String reason)
createEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.nodeId
- a int.ipAddr
- aString
object.svcName
- aString
object.reason
- aString
object.- Returns:
- a
EventBuilder
object.
-
createEventBuilder
public static EventBuilder createEventBuilder(java.lang.String source, java.lang.String uei)
createEventBuilder
- Parameters:
source
- aString
object.uei
- aString
object.- Returns:
- a
EventBuilder
object.
-
createReparentEvent
public static Event createReparentEvent(java.lang.String source, java.lang.String ipAddr, int oldNode, int newNode)
createReparentEvent
- Parameters:
source
- aString
object.ipAddr
- aString
object.oldNode
- a int.newNode
- a int.- Returns:
- a
Event
object.
-
eventsMatch
public static boolean eventsMatch(Event e1, Event e2)
Deprecated.UseEventUtils.eventsMatch(Event,Event)
insteadeventsMatch
-
eventsMatchDeep
public static boolean eventsMatchDeep(Event e1, Event e2, long toleratedTimestampOffset)
eventsMatchDeep
-
printEvent
public static void printEvent(java.lang.String prefix, Event event)
printEvent
- Parameters:
prefix
- aString
object.event
- aEvent
object.
-
printEvents
public static void printEvents(java.lang.String prefix, java.util.Collection<Event> events)
printEvents
- Parameters:
prefix
- aString
object.events
- aCollection
object.
-
-