com.hazelcast.config

## Class WanReplicationConfig

- java.lang.Object
- - com.hazelcast.config.WanReplicationConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned

      public class WanReplicationConfig
      extends Object
      implements IdentifiedDataSerializable, com.hazelcast.nio.serialization.impl.Versioned

  Configuration for WAN replication. This configuration is referenced from an IMap or ICache configuration to determine the receivers for the WAN events. Each receiver is defined with a `WanPublisherConfig`.

  A single WAN replication configuration may consist of several `WAN publisher configurations`. You may consider each WAN publisher configuration as a single target cluster or a single external system. The WAN subsystem will track replication for each publisher separately. Having multiple publishers in a single WAN replication config simplifies simultaneous publication of map and cache events to multiple target systems.

  In addition to defining publishers, you may optionally configure a WAN consumer. The WAN consumer is in charge of consuming (processing) incoming WAN events. Usually when defining a custom consumer you need to define a custom WAN publisher as well.

  NOTE: Implements Versioned since it serialized WanConsumerConfig directly by invoking writeData. This means that, even though WanConsumerConfig is Versioned, the version will not be injected.

  See Also:
    `MapConfig.setWanReplicationRef(com.hazelcast.config.WanReplicationRef)`, `CacheConfig.setWanReplicationRef(com.hazelcast.config.WanReplicationRef)`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WanReplicationConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `WanReplicationConfig` | `addWanPublisherConfig(WanPublisherConfig wanPublisherConfig)` Adds a WAN publisher configuration to this WAN replication.
    `boolean` | `equals(Object o)`
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `String` | `getName()`
    `WanConsumerConfig` | `getWanConsumerConfig()` Returns the `WAN consumer configuration` for this WAN replication.
    `List<WanPublisherConfig>` | `getWanPublisherConfigs()` Returns the list of configured WAN publisher targets for this WAN replication.
    `int` | `hashCode()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `WanReplicationConfig` | `setName(String name)` Sets the name of this WAN replication config.
    `WanReplicationConfig` | `setWanConsumerConfig(WanConsumerConfig wanConsumerConfig)` Sets the `WAN consumer configuration` for this WAN replication.
    `void` | `setWanPublisherConfigs(List<WanPublisherConfig> wanPublisherConfigs)` Sets the list of configured WAN publisher targets for this WAN replication.
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### WanReplicationConfig

          public WanReplicationConfig()

  - ### Method Detail

    - #### getName

          public String getName()

    - #### setName

          public WanReplicationConfig setName(String name)

      Sets the name of this WAN replication config. This name is used by the `WanReplicationRef` configuration.
      Parameters:
        `name` - the WAN replication config name
      Returns:
        this config
      See Also:
        `WanReplicationRef.getName()`

    - #### getWanConsumerConfig

          public WanConsumerConfig getWanConsumerConfig()

      Returns the `WAN consumer configuration` for this WAN replication. The WAN consumer is in charge of consuming (processing) incoming WAN events.

    - #### setWanConsumerConfig

          public WanReplicationConfig setWanConsumerConfig(WanConsumerConfig wanConsumerConfig)

      Sets the `WAN consumer configuration` for this WAN replication. The WAN consumer is in charge of consuming (processing) incoming WAN events.
      Parameters:
        `wanConsumerConfig` - the WAN consumer configuration
      Returns:
        this config

    - #### getWanPublisherConfigs

          public List<WanPublisherConfig> getWanPublisherConfigs()

      Returns the list of configured WAN publisher targets for this WAN replication.

    - #### setWanPublisherConfigs

          public void setWanPublisherConfigs(List<WanPublisherConfig> wanPublisherConfigs)

      Sets the list of configured WAN publisher targets for this WAN replication.
      Parameters:
        `wanPublisherConfigs` - WAN publisher list

    - #### addWanPublisherConfig

          public WanReplicationConfig addWanPublisherConfig(WanPublisherConfig wanPublisherConfig)

      Adds a WAN publisher configuration to this WAN replication.
      Parameters:
        `wanPublisherConfig` - the WAN publisher configuration
      Returns:
        this config

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2019. All rights reserved.