public class CqQueryTestListener extends java.lang.Object implements CqStatusListener
| Modifier and Type | Field and Description |
|---|---|
java.util.concurrent.ConcurrentLinkedQueue |
cqEvents |
java.lang.String |
cqName |
protected int |
cqsConnectedCount |
protected int |
cqsDisconnectedCount |
java.util.Set |
creates |
java.util.Set |
destroys |
java.util.Set |
errors |
protected boolean |
eventClose |
protected int |
eventCreateCount |
protected int |
eventDeleteCount |
protected int |
eventErrorCount |
protected int |
eventInvalidateCount |
protected int |
eventQueryDeleteCount |
protected int |
eventQueryInsertCount |
protected int |
eventQueryInvalidateCount |
protected int |
eventQueryUpdateCount |
protected boolean |
eventRegionClear |
protected boolean |
eventRegionInvalidate |
java.util.concurrent.ConcurrentLinkedQueue |
events |
protected int |
eventUpdateCount |
java.util.Set |
invalidates |
protected LogWriter |
logger |
static long |
MAX_TIME |
protected int |
totalEventCount |
java.util.Set |
updates |
static boolean |
usedForUnitTests |
java.lang.String |
userName |
| Constructor and Description |
|---|
CqQueryTestListener(LogWriter logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called when the region containing this callback is closed or destroyed, when the cache is
closed, or when a callback is removed from a region using an
AttributesMutator. |
int |
getCreateEventCount() |
int |
getDeleteEventCount() |
int |
getErrorEventCount() |
void |
getEventHistory() |
java.lang.Object[] |
getEvents() |
int |
getInvalidateEventCount() |
int |
getQueryDeleteEventCount() |
int |
getQueryInsertEventCount() |
int |
getQueryInvalidateEventCount() |
int |
getQueryUpdateEventCount() |
int |
getTotalEventCount() |
int |
getUpdateEventCount() |
void |
onCqConnected()
Called when the cq establishes a connection with a server
|
void |
onCqDisconnected()
Called when the cq loses connection with all servers
|
void |
onError(CqEvent cqEvent)
This method is invoked when there is an error during CQ processing.
|
void |
onEvent(CqEvent cqEvent)
This method is invoked when an event is occurred on the region that satisfied the query
condition of this CQ.
|
void |
printInfo(boolean printKeys) |
boolean |
waitForClose() |
boolean |
waitForCqsConnectedEvents(int total) |
boolean |
waitForCqsDisconnectedEvents(int total) |
boolean |
waitForCreated(java.lang.Object key) |
boolean |
waitForDestroyed(java.lang.Object key) |
boolean |
waitForError(java.lang.String expectedMessage) |
void |
waitForEvents(int creates,
int updates,
int deletes,
int queryInserts,
int queryUpdates,
int queryDeletes,
int totalEvents) |
boolean |
waitForInvalidated(java.lang.Object key) |
boolean |
waitForRegionClear() |
boolean |
waitForRegionInvalidate() |
boolean |
waitForTotalEvents(int total) |
boolean |
waitForUpdated(java.lang.Object key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinit, initializeprotected final LogWriter logger
protected volatile int eventCreateCount
protected volatile int eventUpdateCount
protected volatile int eventDeleteCount
protected volatile int eventInvalidateCount
protected volatile int eventErrorCount
protected volatile int totalEventCount
protected volatile int eventQueryInsertCount
protected volatile int eventQueryUpdateCount
protected volatile int eventQueryDeleteCount
protected volatile int eventQueryInvalidateCount
protected volatile int cqsConnectedCount
protected volatile int cqsDisconnectedCount
protected volatile boolean eventClose
protected volatile boolean eventRegionClear
protected volatile boolean eventRegionInvalidate
public final java.util.Set destroys
public final java.util.Set creates
public final java.util.Set invalidates
public final java.util.Set updates
public final java.util.Set errors
public static final long MAX_TIME
public java.lang.String cqName
public java.lang.String userName
public static boolean usedForUnitTests
public java.util.concurrent.ConcurrentLinkedQueue events
public java.util.concurrent.ConcurrentLinkedQueue cqEvents
public CqQueryTestListener(LogWriter logger)
public void onEvent(CqEvent cqEvent)
CqListeneronEvent in interface CqListenerCqQuery.executeWithInitialResults()public void onError(CqEvent cqEvent)
CqListeneronError in interface CqListenerpublic void onCqDisconnected()
CqStatusListeneronCqDisconnected in interface CqStatusListenerpublic void onCqConnected()
CqStatusListeneronCqConnected in interface CqStatusListenerpublic int getErrorEventCount()
public int getTotalEventCount()
public int getCreateEventCount()
public int getUpdateEventCount()
public int getDeleteEventCount()
public int getInvalidateEventCount()
public int getQueryInsertEventCount()
public int getQueryUpdateEventCount()
public int getQueryDeleteEventCount()
public int getQueryInvalidateEventCount()
public java.lang.Object[] getEvents()
public void close()
CacheCallbackAttributesMutator.
Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
close in interface CacheCallbackRegionService.close(),
Region.close(),
Region.localDestroyRegion(),
Region.destroyRegion(),
AttributesMutatorpublic void printInfo(boolean printKeys)
public boolean waitForCreated(java.lang.Object key)
public boolean waitForTotalEvents(int total)
public boolean waitForDestroyed(java.lang.Object key)
public boolean waitForInvalidated(java.lang.Object key)
public boolean waitForUpdated(java.lang.Object key)
public boolean waitForClose()
public boolean waitForRegionClear()
public boolean waitForRegionInvalidate()
public boolean waitForError(java.lang.String expectedMessage)
public boolean waitForCqsDisconnectedEvents(int total)
public boolean waitForCqsConnectedEvents(int total)
public void waitForEvents(int creates,
int updates,
int deletes,
int queryInserts,
int queryUpdates,
int queryDeletes,
int totalEvents)
public void getEventHistory()