Class WanReplicationConfig

java.lang.Object
com.hazelcast.config.WanReplicationConfig
All Implemented Interfaces:
NamedConfig, DataSerializable, IdentifiedDataSerializable

public class WanReplicationConfig extends Object implements IdentifiedDataSerializable, NamedConfig
Configuration for WAN replication. This configuration is referenced from a IMap or ICache configuration to determine the receivers for the WAN events. Each receiver is defined with a either a WanBatchPublisherConfig or a WanCustomPublisherConfig.

A single WAN replication configuration may consist of several WAN publisher configurations. The built-in WAN publisher implementation should be configured using WanBatchPublisherConfig and custom WAN publisher implementations can be configured using WanCustomPublisherConfig.

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.

See Also:
  • Constructor Details

    • WanReplicationConfig

      public WanReplicationConfig()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface NamedConfig
    • setName

      public WanReplicationConfig setName(@Nonnull String name)
      Sets the name of this WAN replication config. This name is used by the WanReplicationRef configuration.
      Specified by:
      setName in interface NamedConfig
      Parameters:
      name - the WAN replication config name
      Returns:
      this config
      See Also:
    • getConsumerConfig

      public WanConsumerConfig getConsumerConfig()
      Returns the WAN consumer configuration for this WAN replication. The WAN consumer is in charge of consuming (processing) incoming WAN events.
    • setConsumerConfig

      public WanReplicationConfig setConsumerConfig(WanConsumerConfig consumerConfig)
      Sets the WAN consumer configuration for this WAN replication. The WAN consumer is in charge of consuming (processing) incoming WAN events.
      Parameters:
      consumerConfig - the WAN consumer configuration
      Returns:
      this config
    • getCustomPublisherConfigs

      @Nonnull public List<WanCustomPublisherConfig> getCustomPublisherConfigs()
      Returns the list of custom WAN publisher implementations for this WAN replication.
    • setCustomPublisherConfigs

      public WanReplicationConfig setCustomPublisherConfigs(@Nonnull List<WanCustomPublisherConfig> customPublisherConfigs)
      Sets the list of custom WAN publisher implementations for this WAN replication.
      Parameters:
      customPublisherConfigs - publisher configurations
      Returns:
      this config
    • getBatchPublisherConfigs

      @Nonnull public List<WanBatchPublisherConfig> getBatchPublisherConfigs()
      Returns the list of WAN publisher configurations using the built-in batching WAN implementation for this WAN replication.
    • setBatchPublisherConfigs

      public WanReplicationConfig setBatchPublisherConfigs(@Nonnull List<WanBatchPublisherConfig> batchPublisherConfigs)
      Sets the list of WAN publisher configurations using the built-in batching WAN implementation for this WAN replication.
      Parameters:
      batchPublisherConfigs - configurations for the built-in WAN publisher implementation
      Returns:
      this config
    • addBatchReplicationPublisherConfig

      public WanReplicationConfig addBatchReplicationPublisherConfig(WanBatchPublisherConfig config)
      Adds a WAN publisher configuration using the built-in batching WAN implementation to this WAN replication.
      Parameters:
      config - the WAN publisher configuration
      Returns:
      this config
    • addCustomPublisherConfig

      public WanReplicationConfig addCustomPublisherConfig(WanCustomPublisherConfig config)
      Adds a custom WAN publisher implementation configuration to this WAN replication.
      Parameters:
      config - 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
    • getClassId

      public int getClassId()
      Description copied from interface: IdentifiedDataSerializable
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
      getClassId 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