public EventWrapper(EntryEvent ee, int type) {
   this.event = ee;
   this.key = ee.getKey();
   this.val = ee.getNewValue();
   this.arg = ee.getCallbackArgument();
   this.type = type;
 }
 @Override
 public void afterCreate(EntryEvent event) {
   final String regionName = event.getRegion().getName();
   final Object key = event.getKey();
   final Object newValue = event.getNewValue();
   log.debug("In region [" + regionName + "] created key [" + key + "] value [" + newValue + "]");
 }
 public static void assertCallbackArgs() {
   assertEquals("putAllCallbackArg", putAllevent1.getCallbackArgument());
   assertEquals("putAllCallbackArg", putAllevent2.getCallbackArgument());
   assertEquals("putAllCallbackArg", putAllevent3.getCallbackArgument());
   assertEquals("putAllCallbackArg", putAllevent4.getCallbackArgument());
   assertEquals("putAllCallbackArg", putAllevent5.getCallbackArgument());
 }
 @Override
 public void afterDestroy(EntryEvent event) {
   final String regionName = event.getRegion().getName();
   final Object key = event.getKey();
   final Object newValue = event.getNewValue();
   System.out.println("In region " + regionName + " destroyed key " + key + " value " + newValue);
 }
 public void afterCreate(EntryEvent event) {
   boolean shouldNotify = false;
   Object key = event.getKey();
   if (key.equals(PUTALL_KEY1)) {
     putAllReceivedCount++;
     putAlleventId1 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
     putAllevent1 = event;
   } else if (key.equals(PUTALL_KEY2)) {
     putAllReceivedCount++;
     putAlleventId2 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
     putAllevent2 = event;
   } else if (key.equals(PUTALL_KEY3)) {
     putAllReceivedCount++;
     putAlleventId3 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
     putAllevent3 = event;
   } else if (key.equals(PUTALL_KEY4)) {
     putAllReceivedCount++;
     putAlleventId4 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
     putAllevent4 = event;
   } else if (key.equals(PUTALL_KEY5)) {
     putAllReceivedCount++;
     putAlleventId5 = (EventID) assertThreadIdToSequenceIdMapHasEntryId();
     putAllevent5 = event;
   }
   if (putAllReceivedCount == 5) {
     shouldNotify = true;
   }
   if (shouldNotify) {
     synchronized (lockObject) {
       receivedOperation = true;
       lockObject.notify();
     }
   }
 }
 @Override
 public void afterUpdate(EntryEvent event) {
   final String regionName = event.getRegion().getName();
   final Object key = event.getKey();
   final Object newValue = event.getNewValue();
   final Object oldValue = event.getOldValue();
   System.out.println(
       "In region "
           + regionName
           + " updated key "
           + key
           + " oldValue "
           + oldValue
           + "new value "
           + newValue);
 }
  private void handleUpdates(EntryEvent event) {

    Object obj = event.getNewValue();
    if (obj instanceof PdxInstance) {
      updateDeviceLocation((String) ((PdxInstance) obj).getField("deviceId"));
    } else {
      updateDeviceLocation(((DeviceDistance) obj).getDeviceId());
    }
  };
 public void afterUpdate(EntryEvent event) {
   logCall("afterUpdate", event);
   if (EventPRObserver.recoveryInProgress) {
     if (event.isOriginRemote()) {
       afterUpdateCount_isRemote++;
     } else {
       afterUpdateCount_isNotRemote++;
     }
   }
 }
 public void afterCreate(EntryEvent event) {
   logCall("afterCreate", event);
   if (EventPRObserver.recoveryInProgress) {
     Operation op = event.getOperation();
     if (event.isOriginRemote()) {
       if (op.isPutAll()) {
         afterCreatePutAllCount_isRemote++;
       } else {
         afterCreateCount_isRemote++;
       }
     } else {
       if (op.isPutAll()) {
         afterCreatePutAllCount_isNotRemote++;
       } else {
         afterCreateCount_isNotRemote++;
       }
     }
   }
 }
 public void afterCreate(EntryEvent event) {
   getLogWriter().fine(" entered after created with " + event.getKey());
   boolean shouldNotify = false;
   Object key = event.getKey();
   if (key.equals(PUTALL_KEY1)) {
     putAllReceivedCount++;
     putAlleventId1 = ((EntryEventImpl) event).getEventId();
     assertNotNull(putAlleventId1);
     putAllevent1 = event;
   } else if (key.equals(PUTALL_KEY2)) {
     putAllReceivedCount++;
     putAlleventId2 = ((EntryEventImpl) event).getEventId();
     assertNotNull(putAlleventId2);
     putAllevent2 = event;
   } else if (key.equals(PUTALL_KEY3)) {
     putAllReceivedCount++;
     putAlleventId3 = ((EntryEventImpl) event).getEventId();
     assertNotNull(putAlleventId3);
     putAllevent3 = event;
   } else if (key.equals(PUTALL_KEY4)) {
     putAllReceivedCount++;
     putAlleventId4 = ((EntryEventImpl) event).getEventId();
     assertNotNull(putAlleventId4);
     putAllevent4 = event;
   } else if (key.equals(PUTALL_KEY5)) {
     putAllReceivedCount++;
     putAlleventId5 = ((EntryEventImpl) event).getEventId();
     assertNotNull(putAlleventId5);
     putAllevent5 = event;
   }
   if (putAllReceivedCount == 5) {
     shouldNotify = true;
   }
   if (shouldNotify) {
     synchronized (lockObject) {
       receivedOperation = true;
       lockObject.notify();
     }
   }
 }
  private void registerPI(EntryEvent event) {

    Object obj = event.getNewValue();
    String piId = null;
    if (obj instanceof PdxInstance) {
      piId = (String) ((PdxInstance) obj).getField("piId");
    } else {
      piId = ((DeviceDistance) obj).getPiId();
    }

    if (GeodeClient.getInstance().getPILocation(piId) == null) {
      GeodeClient.getInstance().setPILocation(new DeviceLocation(piId, 0, 0));
    }
  }
 @Override
 public void afterCreate(EntryEvent<SensorAnomalyKey, SensorAnomaly> event) {
   SensorAnomalyKey key = event.getKey();
   SensorAnomaly anomaly = event.getNewValue();
   LOG.error("afterCreate: key={}, anomaly={}", key, anomaly);
 }
 @Override
 public void afterDestroy(EntryEvent event) {
   final String regionName = event.getRegion().getName();
   final Object key = event.getKey();
   log.debug("In region [" + regionName + "] destroyed key [" + key + "]");
 }