public class SupportUpdateListener extends java.lang.Object implements UpdateListener
Constructor and Description |
---|
SupportUpdateListener()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
UniformPair<EventBean[]> |
assertInvokedAndReset()
Returns a pair of insert and remove stream event arrays considering the last invocation only,
asserting that only a single invocation occured, and resetting the listener.
|
EventBean |
assertOneGetNew()
Asserts that exactly one insert stream event was received not checking remove stream data, and returns the received event.
|
EventBean |
assertOneGetNewAndReset()
Asserts that exactly one insert stream event was received and no remove stream events, resets the listener clearing all state and returns the received event.
|
EventBean |
assertOneGetOld()
Asserts that exactly one remove stream event was received not checking insert stream data, and returns the received event.
|
EventBean |
assertOneGetOldAndReset()
Asserts that exactly one remove stream event was received and no insert stream events, resets the listener clearing all state and returns the received event.
|
UniformPair<EventBean> |
assertPairGetIRAndReset()
Asserts that exactly one insert stream event and exactly one remove stream event was received, resets the listener clearing all state and returns the received events as a pair.
|
boolean |
getAndClearIsInvoked()
Returns true if the listener was invoked at least once and clears the invocation flag.
|
UniformPair<EventBean[]> |
getAndResetDataListsFlattened()
Returns a pair of insert and remove stream event arrays considering the all invocations, and resets the listener.
|
EventBean[] |
getAndResetLastNewData()
Returns the last array of events (insert stream) that were received and resets the listener.
|
EventBean[] |
getAndResetLastOldData()
Returns the last array of events (insert stream) that were received and resets the listener.
|
UniformPair<EventBean[]> |
getDataListsFlattened()
Returns a pair of insert and remove stream event arrays considering the all invocations.
|
static boolean[] |
getInvokedFlagsAndReset(SupportUpdateListener[] listeners)
For multiple listeners, return the invoked flags and reset each listener
|
boolean |
getIsInvokedAndReset()
Returns true if the listener was invoked at least once and clears the invocation flag.
|
EventBean[] |
getLastNewData()
Returns the last array of events (insert stream) that were received.
|
EventBean[] |
getLastOldData()
Returns the last array of remove-stream events that were received.
|
java.util.List<EventBean[]> |
getNewDataList()
Get a list of all insert-stream event arrays received.
|
EventBean[] |
getNewDataListFlattened()
Returns an event array that represents all insert-stream events received so far.
|
java.util.List<EventBean[]> |
getOldDataList()
Get a list of all remove-stream event arrays received.
|
EventBean[] |
getOldDataListFlattened()
Returns an event array that represents all remove-stream events received so far.
|
boolean |
isInvoked()
Returns true if the listener was invoked at least once.
|
static SupportUpdateListener[] |
makeListeners(int size)
Produce an array of listeners
|
void |
reset()
Reset listener, clearing all associated state.
|
void |
setLastNewData(EventBean[] lastNewData)
Set an array of events as the last insert-stream events received.
|
void |
setLastOldData(EventBean[] lastOldData)
Set an array of events as the last remove-stream events received.
|
void |
update(EventBean[] newData,
EventBean[] oldData)
Notify that new events are available or old events are removed.
|
void |
waitForInvocation(long msecWait)
Wait for the listener invocation for up to the given number of milliseconds.
|
void |
waitForInvocation(long msecWait,
int numberOfNewEvents)
Wait for the listener invocation for up to the given number of milliseconds.
|
public void waitForInvocation(long msecWait)
msecWait
- to waitjava.lang.RuntimeException
- when no results were receivedpublic void waitForInvocation(long msecWait, int numberOfNewEvents)
msecWait
- to waitnumberOfNewEvents
- in any number of separate invocations required before returningjava.lang.RuntimeException
- when no results or insufficient number of events were receivedpublic void update(EventBean[] newData, EventBean[] oldData)
UpdateListener
Either the newEvents or oldEvents will be non-null. This method won't be called with both arguments being null (unless using output rate limiting or force-output options), but either one could be null. The same is true for zero-length arrays. Either newEvents or oldEvents will be non-empty. If both are non-empty, then the update is a modification notification.
update
in interface UpdateListener
newData
- is any new events. This will be null or empty if the update is for old events only.oldData
- is any old events. This will be null or empty if the update is for new events only.public void reset()
public EventBean[] getLastNewData()
public EventBean[] getLastOldData()
public EventBean[] getAndResetLastNewData()
public EventBean[] getAndResetLastOldData()
public EventBean assertOneGetNewAndReset()
public EventBean assertOneGetOldAndReset()
public UniformPair<EventBean> assertPairGetIRAndReset()
public EventBean assertOneGetNew()
public EventBean assertOneGetOld()
public java.util.List<EventBean[]> getNewDataList()
public java.util.List<EventBean[]> getOldDataList()
public boolean isInvoked()
public boolean getAndClearIsInvoked()
public boolean getIsInvokedAndReset()
public void setLastNewData(EventBean[] lastNewData)
lastNewData
- to storepublic void setLastOldData(EventBean[] lastOldData)
lastOldData
- to storepublic EventBean[] getNewDataListFlattened()
public EventBean[] getOldDataListFlattened()
public UniformPair<EventBean[]> assertInvokedAndReset()
public UniformPair<EventBean[]> getDataListsFlattened()
public UniformPair<EventBean[]> getAndResetDataListsFlattened()
public static boolean[] getInvokedFlagsAndReset(SupportUpdateListener[] listeners)
listeners
- listenerspublic static SupportUpdateListener[] makeListeners(int size)
size
- of array