org.apache.geode.cache.util

## Interface GatewayConflictResolver

-     public interface GatewayConflictResolver

  GatewayConflictResolver is a Cache-level plugin that is called upon to decide what to do with events that originate in other systems and arrive through the WAN Gateway. A GatewayConflictResolver is invoked if the current value in a cache entry was established by a different distributed system (with a different distributed-system-id) than an event that is attempting to modify the entry. It is not invoked if the event has the same distributed system ID as the event that last changed the entry.
  Since:
    GemFire 7.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onEvent(TimestampedEntryEvent event, GatewayConflictHelper helper)` This method is invoked when a change is received from another distributed system and the last modification to the affected cache entry did not also come from the same system.

- - ### Method Detail

    - #### onEvent

          void onEvent(TimestampedEntryEvent event,
                       GatewayConflictHelper helper)

      This method is invoked when a change is received from another distributed system and the last modification to the affected cache entry did not also come from the same system.

      The given GatewayConflictHelper can be used to allow the change to be made to the cache, disallow the modification or make a change to the value to be stored in the cache.

      This method is invoked under synchronization on the cache entry in order to prevent it from concurrent modification

      For any two events, all GatewayConflictResolvers must make the same decision on the resolution of the conflict in order to maintain consistency. They must do so regardless of the order of the events.

      Parameters:
        `event` - the event that is in conflict with the current cache state
        `helper` - an object to be used in modifying the course of action for this event