public class ClientQueryCacheEventService extends Object implements QueryCacheEventService
QueryCacheEventService
Constructor and Description |
---|
ClientQueryCacheEventService(ClientContext clientContext) |
Modifier and Type | Method and Description |
---|---|
String |
addListener(String mapName,
String cacheId,
MapListener listener)
Adds a user-defined listener to a query-cache.
|
String |
addListener(String mapName,
String cacheId,
MapListener listener,
EventFilter filter)
Adds a user-defined listener to a query-cache.
|
boolean |
hasListener(String mapName,
String cacheId)
Returns
true if this query-cache has at least one registered listener otherwise returns false . |
String |
listenPublisher(String mapName,
String cacheId,
ListenerAdapter adapter)
Adds the listener to listen underlying IMap on all nodes.
|
void |
publish(String mapName,
String cacheId,
Object event,
int orderKey)
Publishes query-cache events locally.
|
boolean |
removeListener(String mapName,
String cacheId,
String id)
Removes listener from this event service.
|
boolean |
removePublisherListener(String mapName,
String listenerId)
Removes listener from underlying IMap
|
void |
sendEventToSubscriber(String name,
Object eventData,
int orderKey)
Only sends events which wrap data to be put in a query cache.
|
public ClientQueryCacheEventService(ClientContext clientContext)
public boolean hasListener(String mapName, String cacheId)
QueryCacheEventService
true
if this query-cache has at least one registered listener otherwise returns false
.hasListener
in interface QueryCacheEventService
mapName
- underlying IMap name of query-cachecacheId
- id of the query-cachetrue
if this query-cache has at least one registered listener otherwise returns false
public void sendEventToSubscriber(String name, Object eventData, int orderKey)
QueryCacheEventService
sendEventToSubscriber
in interface QueryCacheEventService
name
- listener nameeventData
- the event dataorderKey
- the order key for the eventpublic void publish(String mapName, String cacheId, Object event, int orderKey)
QueryCacheEventService
publish
in interface QueryCacheEventService
mapName
- underlying map name of query cachecacheId
- id of the query cacheevent
- event to publishorderKey
- use same order key for events which are required to be orderedpublic String listenPublisher(String mapName, String cacheId, ListenerAdapter adapter)
QueryCacheEventService
listenPublisher
in interface QueryCacheEventService
mapName
- underlying map name of query cachecacheId
- id of the query cacheadapter
- listener adapter for the query-cachepublic boolean removePublisherListener(String mapName, String listenerId)
QueryCacheEventService
removePublisherListener
in interface QueryCacheEventService
mapName
- underlying map name which query cache listenslistenerId
- ID of registered listenertrue
if listener is de-registered, false
otherwisepublic String addListener(String mapName, String cacheId, MapListener listener)
QueryCacheEventService
addListener
in interface QueryCacheEventService
mapName
- underlying IMap name of query-cachecacheId
- id of the query-cachelistener
- listener for receiving eventspublic String addListener(String mapName, String cacheId, MapListener listener, EventFilter filter)
QueryCacheEventService
addListener
in interface QueryCacheEventService
mapName
- underlying IMap name of query-cachecacheId
- id of the query-cachelistener
- listener for receiving eventsfilter
- used to filter eventspublic boolean removeListener(String mapName, String cacheId, String id)
QueryCacheEventService
removeListener
in interface QueryCacheEventService
mapName
- underlying IMap name of query-cachecacheId
- id of the query cacheid
- ID of listenertrue
if listener is removed successfully, false
otherwiseCopyright © 2017 Hazelcast, Inc.. All Rights Reserved.