Package org.opennms.netmgt.dao.mock
Class EventAnticipator
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.EventAnticipator
-
- All Implemented Interfaces:
EventListener
public class EventAnticipator extends Object implements EventListener
- Author:
- brozow
-
-
Constructor Summary
Constructors Constructor Description EventAnticipator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
anticipateEvent(Event event)
void
anticipateEvent(Event event, boolean checkUnanticipatedList)
void
eventProcessed(Event event)
void
eventReceived(Event event)
List<Event>
getAnticipatedEvents()
List<Event>
getAnticipatedEventsReceived()
String
getName()
Return the id of the listenerList<Event>
getUnanticipatedEvents()
boolean
isDiscardUnanticipated()
void
onEvent(IEvent e)
Process a sent event.void
reset()
void
resetAnticipated()
void
resetUnanticipated()
void
setDiscardUnanticipated(boolean discardUnanticipated)
void
verifyAnticipated()
void
verifyAnticipated(long wait, long sleepMiddle, long sleepAfter, int anticipatedSize, int unanticipatedSize)
Collection<Event>
waitForAnticipated(long millis)
-
-
-
Method Detail
-
isDiscardUnanticipated
public boolean isDiscardUnanticipated()
- Returns:
- the discardUnanticipated
-
setDiscardUnanticipated
public void setDiscardUnanticipated(boolean discardUnanticipated)
- Parameters:
discardUnanticipated
- the discardUnanticipated to set
-
anticipateEvent
public void anticipateEvent(Event event)
- Parameters:
event
-
-
anticipateEvent
public void anticipateEvent(Event event, boolean checkUnanticipatedList)
-
eventReceived
public void eventReceived(Event event)
- Parameters:
event
-
-
reset
public void reset()
-
resetUnanticipated
public void resetUnanticipated()
-
resetAnticipated
public void resetAnticipated()
-
waitForAnticipated
public Collection<Event> waitForAnticipated(long millis)
- Parameters:
i
-- Returns:
-
eventProcessed
public void eventProcessed(Event event)
- Parameters:
event
-
-
verifyAnticipated
public void verifyAnticipated(long wait, long sleepMiddle, long sleepAfter, int anticipatedSize, int unanticipatedSize)
-
verifyAnticipated
public void verifyAnticipated()
-
getName
public String getName()
Description copied from interface:EventListener
Return the id of the listener- Specified by:
getName
in interfaceEventListener
- Returns:
- a
String
object.
-
onEvent
public void onEvent(IEvent e)
Description copied from interface:EventListener
Process a sent event.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
e
- aIEvent
object.
-
-