use of com.hazelcast.map.impl.DataAwareEntryEvent in project hazelcast by hazelcast.
the class EventPublisherHelper method createIMapEvent.
public static IMapEvent createIMapEvent(EventData eventData, EventFilter filter, Member member, SerializationService serializationService) {
String source = eventData.getSource();
int eventType = eventData.getEventType();
if (eventType == EventLostEvent.EVENT_TYPE) {
LocalEntryEventData localEventData = (LocalEntryEventData) eventData;
int partitionId = localEventData.getPartitionId();
return new EventLostEvent(source, null, partitionId);
}
if (eventType == EntryEventType.CLEAR_ALL.getType() || eventType == EntryEventType.EVICT_ALL.getType()) {
LocalCacheWideEventData localCacheWideEventData = (LocalCacheWideEventData) eventData;
int numberOfEntriesAffected = localCacheWideEventData.getNumberOfEntriesAffected();
return new MapEvent(source, null, eventType, numberOfEntriesAffected);
}
LocalEntryEventData localEntryEventData = (LocalEntryEventData) eventData;
Data dataKey = localEntryEventData.getKeyData();
Data dataNewValue = localEntryEventData.getValueData();
Data dataOldValue = localEntryEventData.getOldValueData();
boolean includeValue = isIncludeValue(filter);
return new DataAwareEntryEvent(member, eventType, source, dataKey, (includeValue ? dataNewValue : null), (includeValue ? dataOldValue : null), null, serializationService);
}
Aggregations