com.hazelcast.wan

## Interface WanReplicationService

- All Superinterfaces:
    CoreService, StatisticsAwareService<LocalWanStats>

      public interface WanReplicationService
      extends CoreService, StatisticsAwareService<LocalWanStats>

  This is the WAN replications service API core interface. The WanReplicationService needs to be capable of creating the actual `WanReplicationPublisher` instances to replicate values to other clusters over the wide area network, so it has to deal with long delays, slow uploads and higher latencies.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `SERVICE_NAME` Service name.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `AddWanConfigResult` | `addWanReplicationConfig(WanReplicationConfig wanConfig)` Adds a new `WanReplicationConfig` to the cluster.
    `void` | `addWanReplicationConfigLocally(WanReplicationConfig wanConfig)` Adds a new `WanReplicationConfig` to this member and creates the `WanReplicationPublisher`s specified in the config.
    `void` | `checkWanReplicationQueues(String name)`
    `void` | `clearQueues(String wanReplicationName, String targetGroupName)` Clears WAN replication queues of the given wanReplicationName for the given target.
    `void` | `consistencyCheck(String wanReplicationName, String targetGroupName, String mapName)` Initiate WAN consistency check for a specific map.
    `com.hazelcast.wan.impl.DistributedServiceWanEventCounters` | `getReceivedEventCounters(String serviceName)` Returns a counter of received and processed WAN replication events.
    `com.hazelcast.wan.impl.DistributedServiceWanEventCounters` | `getSentEventCounters(String wanReplicationName, String targetGroupName, String serviceName)` Returns a counter of sent and processed WAN replication events.
    `WanReplicationPublisher` | `getWanReplicationPublisher(String name)` Creates a new `WanReplicationPublisher` by the given name.
    `WanSyncState` | `getWanSyncState()` Returns current status of WAN sync operation or `null` when there is no status.
    `void` | `pause(String wanReplicationName, String targetGroupName)` Pauses WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
    `void` | `removeWanEventCounters(String serviceName, String dataStructureName)` Removes all WAN event counters for the given `serviceName` and `dataStructureName`.
    `void` | `resume(String wanReplicationName, String targetGroupName)` Resumes WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
    `void` | `shutdown()` Starts the shutdown process of the WAN replication service.
    `void` | `stop(String wanReplicationName, String targetGroupName)` Stops WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
    `void` | `syncAllMaps(String wanReplicationName, String targetGroupName)` Initiate wan sync for all maps.
    `void` | `syncMap(String wanReplicationName, String targetGroupName, String mapName)` Initiate wan sync for a specific map.

    - ### Methods inherited from interface com.hazelcast.spi.StatisticsAwareService

      `getStats`

- - ### Field Detail

    - #### SERVICE_NAME

          static final String SERVICE_NAME

      Service name.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getWanReplicationPublisher

          WanReplicationPublisher getWanReplicationPublisher(String name)

      Creates a new `WanReplicationPublisher` by the given name. If the name already exists, returns the previous instance.
      Parameters:
        `name` - name of the WAN replication configuration
      Returns:
        instance of the corresponding replication publisher

    - #### shutdown

          void shutdown()

      Starts the shutdown process of the WAN replication service.

    - #### pause

          void pause(String wanReplicationName,
                     String targetGroupName)

      Pauses WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
      Parameters:
        `wanReplicationName` - name of WAN replication configuration
        `targetGroupName` - WAN target cluster group name
      Throws:
        `UnsupportedOperationException` - if called on an OS instance

    - #### stop

          void stop(String wanReplicationName,
                    String targetGroupName)

      Stops WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
      Parameters:
        `wanReplicationName` - name of WAN replication configuration
        `targetGroupName` - WAN target cluster group name
      Throws:
        `UnsupportedOperationException` - if called on an OS instance

    - #### resume

          void resume(String wanReplicationName,
                      String targetGroupName)

      Resumes WAN replication for the given `wanReplicationName` and `targetGroupName` on this hazelcast instance.
      Parameters:
        `wanReplicationName` - name of WAN replication configuration
        `targetGroupName` - WAN target cluster group name
      Throws:
        `UnsupportedOperationException` - if called on an OS instance

    - #### checkWanReplicationQueues

          void checkWanReplicationQueues(String name)

    - #### syncMap

          void syncMap(String wanReplicationName,
                       String targetGroupName,
                       String mapName)

      Initiate wan sync for a specific map. NOTE: not supported on OS, only on EE
      Parameters:
        `wanReplicationName` - the name of the wan replication config
        `targetGroupName` - the group name on the target cluster
        `mapName` - the map name
      Throws:
        `UnsupportedOperationException` - if the operation is not supported (not EE)
        `InvalidConfigurationException` - if there is no WAN replication config for `wanReplicationName`
        `SyncFailedException` - if there is a anti-entropy request in progress

    - #### syncAllMaps

          void syncAllMaps(String wanReplicationName,
                           String targetGroupName)

      Initiate wan sync for all maps. NOTE: not supported on OS, only on EE
      Parameters:
        `wanReplicationName` - the name of the wan replication config
        `targetGroupName` - the group name on the target cluster
      Throws:
        `UnsupportedOperationException` - if the operation is not supported (not EE)
        `InvalidConfigurationException` - if there is no WAN replication config for `wanReplicationName`
        `SyncFailedException` - if there is a anti-entropy request in progress

    - #### consistencyCheck

          void consistencyCheck(String wanReplicationName,
                                String targetGroupName,
                                String mapName)

      Initiate WAN consistency check for a specific map. NOTE: not supported on OS, only on EE
      Parameters:
        `wanReplicationName` - the name of the wan replication config
        `targetGroupName` - the group name on the target cluster
        `mapName` - the map name
      Throws:
        `UnsupportedOperationException` - if the operation is not supported (not EE)
        `InvalidConfigurationException` - if there is no WAN replication config for `wanReplicationName`
        `SyncFailedException` - if there is a anti-entropy request in progress

    - #### clearQueues

          void clearQueues(String wanReplicationName,
                           String targetGroupName)

      Clears WAN replication queues of the given wanReplicationName for the given target.
      Parameters:
        `wanReplicationName` - the name of the wan replication config
        `targetGroupName` - the target cluster group name
      Throws:
        `UnsupportedOperationException` - if invoked on OS

    - #### addWanReplicationConfigLocally

          void addWanReplicationConfigLocally(WanReplicationConfig wanConfig)

      Adds a new `WanReplicationConfig` to this member and creates the `WanReplicationPublisher`s specified in the config. This method can also accept WAN configs with an existing WAN replication name. Such configs will be merged into the existing WAN replication config by adding publishers with publisher IDs which are not already part of the existing configuration.
      Throws:
        `UnsupportedOperationException` - if invoked on OS

    - #### addWanReplicationConfig

          AddWanConfigResult addWanReplicationConfig(WanReplicationConfig wanConfig)

      Adds a new `WanReplicationConfig` to the cluster. This method can also accept WAN configs with an existing WAN replication name. Such configs will be merged into the existing WAN replication config by adding publishers with publisher IDs which are not already part of the existing configuration. The return value is a best-effort guess at the result of adding WAN replication config based on the existing local WAN replication config. An exact result is difficult to calculate since not all members might have the same existing configuration and there might be a concurrent request to add overlapping WAN replication config.
      Parameters:
        `wanConfig` - the WAN replication config to add
      Returns:
        a best-effort guess at the result of adding WAN replication config
      Throws:
        `UnsupportedOperationException` - if invoked on OS
      See Also:
        `addWanReplicationConfigLocally(WanReplicationConfig)`

    - #### getWanSyncState

          WanSyncState getWanSyncState()

      Returns current status of WAN sync operation or `null` when there is no status.

    - #### getReceivedEventCounters

          com.hazelcast.wan.impl.DistributedServiceWanEventCounters getReceivedEventCounters(String serviceName)

      Returns a counter of received and processed WAN replication events.
      Parameters:
        `serviceName` - the name of the service for the WAN events
      Returns:
        the WAN event counter

    - #### getSentEventCounters

          com.hazelcast.wan.impl.DistributedServiceWanEventCounters getSentEventCounters(String wanReplicationName,
                                                                                         String targetGroupName,
                                                                                         String serviceName)

      Returns a counter of sent and processed WAN replication events.
      Parameters:
        `wanReplicationName` - the name of the wan replication config
        `targetGroupName` - the target cluster group name
        `serviceName` - the name of the service for the WAN events
      Returns:
        the WAN event counter

    - #### removeWanEventCounters

          void removeWanEventCounters(String serviceName,
                                      String dataStructureName)

      Removes all WAN event counters for the given `serviceName` and `dataStructureName`.
      Parameters:
        `serviceName` - the name of the service for the WAN events
        `dataStructureName` - the distributed object name

Copyright © 2020. All rights reserved.