public class NodeQueryCacheEventService extends Object implements QueryCacheEventService<EventData>
QueryCacheEventService
Constructor and Description |
---|
NodeQueryCacheEventService(MapServiceContext mapServiceContext) |
Modifier and Type | Method and Description |
---|---|
String |
addListener(String mapName,
String cacheName,
MapListener listener)
Adds a user-defined listener to a query-cache.
|
String |
addListener(String mapName,
String cacheName,
MapListener listener,
EventFilter filter)
Adds a user-defined listener to a query-cache.
|
boolean |
hasListener(String mapName,
String cacheName)
Returns
true if this query-cache has at least one registered listener otherwise returns false . |
String |
listenPublisher(String mapName,
String cacheName,
ListenerAdapter listenerAdapter)
Adds the listener to listen underlying IMap on all nodes.
|
void |
publish(String mapName,
String cacheName,
EventData eventData,
int orderKey)
Publishes query-cache events locally.
|
boolean |
removeListener(String mapName,
String cacheName,
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 NodeQueryCacheEventService(MapServiceContext mapServiceContext)
public void publish(String mapName, String cacheName, EventData eventData, int orderKey)
QueryCacheEventService
publish
in interface QueryCacheEventService<EventData>
mapName
- underlying map name of query cache.cacheName
- name of the query cache.eventData
- event to publish.orderKey
- use same order key for events which are required to be ordered.public String addListener(String mapName, String cacheName, MapListener listener)
QueryCacheEventService
addListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cache.cacheName
- name of the query-cache.listener
- listener for receiving events.public String listenPublisher(String mapName, String cacheName, ListenerAdapter listenerAdapter)
QueryCacheEventService
listenPublisher
in interface QueryCacheEventService<EventData>
mapName
- underlying map name of query cache.cacheName
- name of the query cache.listenerAdapter
- listener adapter for the query-cache.public boolean removePublisherListener(String mapName, String listenerId)
QueryCacheEventService
removePublisherListener
in interface QueryCacheEventService<EventData>
mapName
- underlying map name which query cache listens.listenerId
- id of registered listenertrue
if listener is de-registered, false
otherwise.public String addListener(String mapName, String cacheName, MapListener listener, EventFilter filter)
QueryCacheEventService
addListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cache.cacheName
- name of the query-cache.listener
- listener for receiving events.filter
- used to filter events.public boolean removeListener(String mapName, String cacheName, String id)
QueryCacheEventService
removeListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cache.cacheName
- name of the query cache.id
- id of listener.true
if listener is removed successfully, false
otherwise.public boolean hasListener(String mapName, String cacheName)
QueryCacheEventService
true
if this query-cache has at least one registered listener otherwise returns false
.hasListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cache.cacheName
- name of the query-cache.true
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<EventData>
name
- listener name.eventData
- the event data.orderKey
- the order key for the event.Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.