Package com.hazelcast.config
Class WanConsumerConfig
- java.lang.Object
-
- com.hazelcast.config.WanConsumerConfig
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public class WanConsumerConfig extends java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getClassId()
Returns type identifier for this class.java.lang.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
.java.util.Map<java.lang.String,java.lang.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(java.lang.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(java.util.Map<java.lang.String,java.lang.Comparable> properties)
Sets the properties for the custom WAN consumer.java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Method Detail
-
getProperties
public java.util.Map<java.lang.String,java.lang.Comparable> getProperties()
Returns the properties for the custom WAN consumer.
-
setProperties
public WanConsumerConfig setProperties(java.util.Map<java.lang.String,java.lang.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 java.lang.String getClassName()
Returns the fully qualified class name of the class implementingWanConsumer
.- Returns:
- fully qualified class name
-
setClassName
public WanConsumerConfig setClassName(@Nonnull java.lang.String className)
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
public WanConsumer getImplementation()
Returns the implementation implementingWanConsumer
.- Returns:
- the implementation for this WAN consumer
-
setImplementation
public WanConsumerConfig setImplementation(@Nonnull WanConsumer implementation)
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
public WanConsumerConfig setPersistWanReplicatedData(boolean persistWanReplicatedData)
- 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
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
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-