public class SupportUpdateListener extends Object implements UpdateListener, SupportListener
Constructor and Description |
---|
SupportUpdateListener()
Ctor.
|
Modifier and Type | Method and Description |
---|---|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean> |
assertGetAndResetIRPair()
Asserts that there is exactly one insert-stream event and one remove-stream event available and resets.
|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.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.
|
void |
assertInvokedFlagAndReset(boolean expected)
Assert the invoked-flag against the expected value and reset the flag
|
void |
assertNewOldData(Object[][] nameAndValuePairsIStream,
Object[][] nameAndValuePairsRStream)
Asserts name-value pairs of insert and remove stream events
|
void |
assertNotInvoked()
Assert not invoked.
|
com.espertech.esper.common.client.EventBean |
assertOneGetNew()
Asserts that exactly one insert stream event was received not checking remove stream data, and returns the received event.
|
com.espertech.esper.common.client.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.
|
com.espertech.esper.common.client.EventBean |
assertOneGetOld()
Asserts that exactly one remove stream event was received not checking insert stream data, and returns the received event.
|
com.espertech.esper.common.client.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.
|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.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.
|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> |
getAndResetDataListsFlattened()
Returns a pair of insert and remove stream event arrays considering the all invocations, and resets the listener.
|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> |
getAndResetIRPair()
Returns a pair of last-invocation insert and remove stream events and resets
|
com.espertech.esper.common.client.EventBean[] |
getAndResetLastNewData()
Returns the last array of events (insert stream) that were received and resets the listener.
|
com.espertech.esper.common.client.EventBean[] |
getAndResetLastOldData()
Returns the last array of events (insert stream) that were received and resets the listener.
|
com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.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.
|
com.espertech.esper.common.client.EventBean[] |
getLastNewData()
Returns the last array of events (insert stream) that were received.
|
com.espertech.esper.common.client.EventBean[] |
getLastOldData()
Returns the last array of remove-stream events that were received.
|
List<com.espertech.esper.common.client.EventBean[]> |
getNewDataList()
Get a list of all insert-stream event arrays received.
|
com.espertech.esper.common.client.EventBean[] |
getNewDataListFlattened()
Returns an event array that represents all insert-stream events received so far.
|
List<com.espertech.esper.common.client.EventBean[]> |
getOldDataList()
Get a list of all remove-stream event arrays received.
|
com.espertech.esper.common.client.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(com.espertech.esper.common.client.EventBean[] lastNewData)
Set an array of events as the last insert-stream events received.
|
void |
setLastOldData(com.espertech.esper.common.client.EventBean[] lastOldData)
Set an array of events as the last remove-stream events received.
|
void |
update(com.espertech.esper.common.client.EventBean[] newData,
com.espertech.esper.common.client.EventBean[] oldData,
EPStatement statement,
EPRuntime runtime)
Notify that new events are available or old events are removed.
|
void |
waitForInvocation(long msecWait)
Wait for an invocation up to the given 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
- wait timepublic void waitForInvocation(long msecWait, int numberOfNewEvents)
waitForInvocation
in interface SupportListener
msecWait
- to waitnumberOfNewEvents
- in any number of separate invocations required before returningRuntimeException
- when no results or insufficient number of events were receivedpublic void update(com.espertech.esper.common.client.EventBean[] newData, com.espertech.esper.common.client.EventBean[] oldData, EPStatement statement, EPRuntime runtime)
UpdateListener
If the call to update contains new (inserted) events, then the first argument will be a non-empty list and the second will be empty. Similarly, if the call is a notification of deleted events, then the first argument will be empty and the second will be non-empty.
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.statement
- is the statement producing the resultruntime
- is the runtimepublic void assertInvokedFlagAndReset(boolean expected)
SupportListener
assertInvokedFlagAndReset
in interface SupportListener
expected
- expected valuepublic void reset()
reset
in interface SupportListener
public com.espertech.esper.common.client.EventBean[] getLastNewData()
SupportListener
getLastNewData
in interface SupportListener
public com.espertech.esper.common.client.EventBean[] getLastOldData()
SupportListener
getLastOldData
in interface SupportListener
public com.espertech.esper.common.client.EventBean[] getAndResetLastNewData()
SupportListener
getAndResetLastNewData
in interface SupportListener
public com.espertech.esper.common.client.EventBean[] getAndResetLastOldData()
SupportListener
getAndResetLastOldData
in interface SupportListener
public com.espertech.esper.common.client.EventBean assertOneGetNewAndReset()
SupportListener
assertOneGetNewAndReset
in interface SupportListener
public com.espertech.esper.common.client.EventBean assertOneGetOldAndReset()
SupportListener
assertOneGetOldAndReset
in interface SupportListener
public com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean> assertPairGetIRAndReset()
SupportListener
assertPairGetIRAndReset
in interface SupportListener
public com.espertech.esper.common.client.EventBean assertOneGetNew()
SupportListener
assertOneGetNew
in interface SupportListener
public com.espertech.esper.common.client.EventBean assertOneGetOld()
SupportListener
assertOneGetOld
in interface SupportListener
public List<com.espertech.esper.common.client.EventBean[]> getNewDataList()
SupportListener
getNewDataList
in interface SupportListener
public List<com.espertech.esper.common.client.EventBean[]> getOldDataList()
SupportListener
getOldDataList
in interface SupportListener
public boolean isInvoked()
SupportListener
isInvoked
in interface SupportListener
public boolean getAndClearIsInvoked()
SupportListener
getAndClearIsInvoked
in interface SupportListener
public boolean getIsInvokedAndReset()
SupportListener
getIsInvokedAndReset
in interface SupportListener
public void setLastNewData(com.espertech.esper.common.client.EventBean[] lastNewData)
lastNewData
- to storepublic void setLastOldData(com.espertech.esper.common.client.EventBean[] lastOldData)
lastOldData
- to storepublic com.espertech.esper.common.client.EventBean[] getNewDataListFlattened()
SupportListener
getNewDataListFlattened
in interface SupportListener
public com.espertech.esper.common.client.EventBean[] getOldDataListFlattened()
getOldDataListFlattened
in interface SupportListener
public com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> assertInvokedAndReset()
SupportListener
assertInvokedAndReset
in interface SupportListener
public void assertNotInvoked()
public com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> getDataListsFlattened()
SupportListener
getDataListsFlattened
in interface SupportListener
public com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> getAndResetDataListsFlattened()
SupportListener
getAndResetDataListsFlattened
in interface SupportListener
public static boolean[] getInvokedFlagsAndReset(SupportUpdateListener[] listeners)
listeners
- listenerspublic static SupportUpdateListener[] makeListeners(int size)
size
- of arraypublic void assertNewOldData(Object[][] nameAndValuePairsIStream, Object[][] nameAndValuePairsRStream)
SupportListener
assertNewOldData
in interface SupportListener
nameAndValuePairsIStream
- insert-stream assertionsnameAndValuePairsRStream
- remove-stream assertionspublic com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean> assertGetAndResetIRPair()
SupportListener
assertGetAndResetIRPair
in interface SupportListener
public com.espertech.esper.common.internal.collection.UniformPair<com.espertech.esper.common.client.EventBean[]> getAndResetIRPair()
SupportListener
getAndResetIRPair
in interface SupportListener
Copyright © 2005–2020. All rights reserved.