com.hazelcast.config

## Class WanConsumerConfig

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

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

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

  Config for processing WAN events received from a target cluster. You can configure certain behaviour when processing incoming WAN events or even configure your own implementation for a WAN consumer. A custom WAN consumer allows you to define custom processing logic and is usually used in combination with a custom WAN publisher. A custom consumer is optional and you may simply omit defining it which will cause the default processing logic to be used.

  NOTE: EE only

  See Also:
    `WanReplicationConfig.setWanConsumerConfig(WanConsumerConfig)`, `WanPublisherConfig.setClassName(String)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEFAULT_PERSIST_WAN_REPLICATED_DATA`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WanConsumerConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getClassName()` Returns the fully qualified class name of the class implementing WanReplicationConsumer.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `Object` | `getImplementation()` Returns the implementation implementing WanReplicationConsumer.
    `Map<String,Comparable>` | `getProperties()` Returns the properties for the custom WAN consumer.
    `int` | `hashCode()`
    `boolean` | `isPersistWanReplicatedData()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `WanConsumerConfig` | `setClassName(String className)` Sets the fully qualified class name of the class implementing WanReplicationConsumer.
    `WanConsumerConfig` | `setImplementation(Object implementation)` Sets the implementation for this WAN consumer.
    `WanConsumerConfig` | `setPersistWanReplicatedData(boolean persistWanReplicatedData)`
    `WanConsumerConfig` | `setProperties(Map<String,Comparable> properties)` Sets the properties for the custom WAN consumer.
    `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`

- - ### Field Detail

    - #### DEFAULT_PERSIST_WAN_REPLICATED_DATA

          public static final boolean DEFAULT_PERSIST_WAN_REPLICATED_DATA

      See Also:
        `isPersistWanReplicatedData()`, Constant Field Values

  - ### Constructor Detail

    - #### WanConsumerConfig

          public WanConsumerConfig()

  - ### Method Detail

    - #### getProperties

          public Map<String,Comparable> getProperties()

      Returns the properties for the custom WAN consumer.

    - #### setProperties

          public WanConsumerConfig setProperties(Map<String,Comparable> properties)

      Sets the properties for the custom WAN consumer. These properties are accessible when initalizing the WAN consumer.
      Parameters:
        `properties` - the properties for the WAN consumer
      Returns:
        this config

    - #### getClassName

          public String getClassName()

      Returns the fully qualified class name of the class implementing WanReplicationConsumer.
      Returns:
        fully qualified class name

    - #### setClassName

          public WanConsumerConfig setClassName(String className)

      Sets the fully qualified class name of the class implementing WanReplicationConsumer. The class name may be `null` in which case the implementation or the default processing logic for incoming WAN events will be used.
      Parameters:
        `className` - fully qualified class name
      Returns:
        this config
      See Also:
        `setImplementation(Object)`

    - #### getImplementation

          public Object getImplementation()

      Returns the implementation implementing WanReplicationConsumer.
      Returns:
        the implementation for this WAN consumer

    - #### setImplementation

          public WanConsumerConfig setImplementation(Object implementation)

      Sets the implementation for this WAN consumer. The object must implement WanReplicationConsumer. The implementation may be `null` in which case the class name or the default processing logic for incoming WAN events will be used.
      Parameters:
        `implementation` - the object implementing WanReplicationConsumer
      Returns:
        this config
      See Also:
        `setClassName(String)`

    - #### isPersistWanReplicatedData

          public boolean isPersistWanReplicatedData()

      Returns:
        `true` when persistence of replicated data into backing store is enabled, otherwise returns `false`. By default this method returns false.

    - #### setPersistWanReplicatedData

          public WanConsumerConfig setPersistWanReplicatedData(boolean persistWanReplicatedData)

      Parameters:
        `persistWanReplicatedData` - set `true` to enable persistence of replicated data into backing store, otherwise set `false` to disable it. Default value is false.
      Returns:
        reference to this `WanReplicationRef` object

    - #### 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 © 2020. All rights reserved.