public class NodeQueryCacheEventService extends Object implements QueryCacheEventService<EventData>
QueryCacheEventService
Constructor and Description |
---|
NodeQueryCacheEventService(MapServiceContext mapServiceContext,
ContextMutexFactory mutexFactory) |
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.
|
String |
addPublisherListener(String mapName,
String cacheId,
ListenerAdapter listenerAdapter)
Adds the listener to listen underlying IMap on all nodes.
|
boolean |
hasListener(String mapName,
String cacheId)
Returns
true if this query-cache has at least one registered
user defined listener otherwise returns false . |
void |
publish(String mapName,
String cacheId,
EventData eventData,
int orderKey,
Extractors extractors)
Publishes query-cache events locally.
|
void |
removeAllListeners(String mapName,
String cacheId)
Removes all user defined listeners associated to supplied
cacheId |
boolean |
removeListener(String mapName,
String cacheId,
String listenerId)
Removes listener from this event service.
|
boolean |
removePublisherListener(String mapName,
String cacheId,
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, ContextMutexFactory mutexFactory)
public void publish(String mapName, String cacheId, EventData eventData, int orderKey, Extractors extractors)
QueryCacheEventService
publish
in interface QueryCacheEventService<EventData>
mapName
- underlying map name of query cachecacheId
- ID of the query cacheeventData
- event to publishorderKey
- use same order key for events which are required to be orderedextractors
- extractors for the query cachepublic String addListener(String mapName, String cacheId, MapListener listener)
QueryCacheEventService
addListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cachecacheId
- ID of the query-cachelistener
- listener for receiving eventspublic String addPublisherListener(String mapName, String cacheId, ListenerAdapter listenerAdapter)
QueryCacheEventService
addPublisherListener
in interface QueryCacheEventService<EventData>
mapName
- underlying map name of query cachecacheId
- ID of the query cachelistenerAdapter
- listener adapter for the query-cachepublic boolean removePublisherListener(String mapName, String cacheId, String listenerId)
QueryCacheEventService
removePublisherListener
in interface QueryCacheEventService<EventData>
mapName
- underlying map name which query cache listenscacheId
- ID of the query cachelistenerId
- ID of registered listenertrue
if listener is de-registered, false
otherwisepublic String addListener(String mapName, String cacheId, MapListener listener, EventFilter filter)
QueryCacheEventService
addListener
in interface QueryCacheEventService<EventData>
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 listenerId)
QueryCacheEventService
removeListener
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cachecacheId
- ID of the query cachelistenerId
- registration ID of listenertrue
if listener is removed successfully, false
otherwisepublic void removeAllListeners(String mapName, String cacheId)
QueryCacheEventService
cacheId
removeAllListeners
in interface QueryCacheEventService<EventData>
mapName
- underlying IMap name of query-cachecacheId
- ID of the query cachepublic boolean hasListener(String mapName, String cacheId)
QueryCacheEventService
true
if this query-cache has at least one registered
user defined listener otherwise returns false
.hasListener
in interface QueryCacheEventService<EventData>
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<EventData>
name
- listener nameeventData
- the event dataorderKey
- the order key for the eventCopyright © 2021 Hazelcast, Inc.. All Rights Reserved.