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 voidanticipateEvent(Event event)voidanticipateEvent(Event event, boolean checkUnanticipatedList)voideventProcessed(Event event)voideventReceived(Event event)List<Event>getAnticipatedEvents()List<Event>getAnticipatedEventsReceived()StringgetName()Return the id of the listenerList<Event>getUnanticipatedEvents()booleanisDiscardUnanticipated()voidonEvent(IEvent e)Process a sent event.voidreset()voidresetAnticipated()voidresetUnanticipated()voidsetDiscardUnanticipated(boolean discardUnanticipated)voidverifyAnticipated()voidverifyAnticipated(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:EventListenerReturn the id of the listener- Specified by:
 getNamein interfaceEventListener- Returns:
 - a 
Stringobject. 
 
- 
onEvent
public void onEvent(IEvent e)
Description copied from interface:EventListenerProcess a sent event.- Specified by:
 onEventin interfaceEventListener- Parameters:
 e- aIEventobject.
 
 - 
 
 -