Package com.hazelcast.config
Class WanConsumerConfig
java.lang.Object
com.hazelcast.config.WanConsumerConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class WanConsumerConfig extends Object implements IdentifiedDataSerializable
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
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_PERSIST_WAN_REPLICATED_DATA
-
Constructor Summary
Constructors Constructor Description WanConsumerConfig()
-
Method Summary
Modifier and Type Method Description boolean
equals(Object o)
int
getClassId()
Returns type identifier for this class.String
getClassName()
Returns the fully qualified class name of the class implementingWanConsumer
.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.WanConsumer
getImplementation()
Returns the implementation implementingWanConsumer
.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 streamWanConsumerConfig
setClassName(String className)
Sets the fully qualified class name of the class implementingWanConsumer
.WanConsumerConfig
setImplementation(WanConsumer 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
-
Field Details
-
DEFAULT_PERSIST_WAN_REPLICATED_DATA
public static final boolean DEFAULT_PERSIST_WAN_REPLICATED_DATA
-
-
Constructor Details
-
WanConsumerConfig
public WanConsumerConfig()
-
-
Method Details
-
getProperties
Returns the properties for the custom WAN consumer. -
setProperties
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
Returns the fully qualified class name of the class implementingWanConsumer
.- Returns:
- fully qualified class name
-
setClassName
Sets the fully qualified class name of the class implementingWanConsumer
. The class name may benull
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(WanConsumer)
-
getImplementation
Returns the implementation implementingWanConsumer
.- Returns:
- the implementation for this WAN consumer
-
setImplementation
Sets the implementation for this WAN consumer. The object must implementWanConsumer
. The implementation may benull
in which case the class name or the default processing logic for incoming WAN events will be used.- Parameters:
implementation
- the object implementingWanConsumer
- Returns:
- this config
- See Also:
setClassName(String)
-
isPersistWanReplicatedData
public boolean isPersistWanReplicatedData()- Returns:
true
when persistence of replicated data into backing store is enabled, otherwise returnsfalse
. By default this method returns false.
-
setPersistWanReplicatedData
- Parameters:
persistWanReplicatedData
- settrue
to enable persistence of replicated data into backing store, otherwise setfalse
to disable it. Default value is false.- Returns:
- reference to this
WanReplicationRef
object
-
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- 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 interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode()
-