public class TopicConfig extends Object implements IdentifiedDataSerializable
ITopic
.Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_GLOBAL_ORDERING_ENABLED
Default global ordering configuration.
|
Constructor and Description |
---|
TopicConfig()
Creates a TopicConfig.
|
TopicConfig(String name)
Creates a TopicConfig with the given name.
|
TopicConfig(TopicConfig config)
Creates a
TopicConfig by cloning another TopicConfig. |
Modifier and Type | Method and Description |
---|---|
TopicConfig |
addMessageListenerConfig(ListenerConfig listenerConfig)
Adds a message listener to this topic (listens for when messages are added or removed).
|
boolean |
equals(Object o) |
TopicConfigReadOnly |
getAsReadOnly()
Deprecated.
this method will be removed in 4.0; it is meant for internal usage only
|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
List<ListenerConfig> |
getMessageListenerConfigs()
Gets the list of message listeners (listens for when messages are added or removed) for this topic.
|
String |
getName()
Gets the name of the topic, null if nothing is set.
|
int |
hashCode() |
boolean |
isGlobalOrderingEnabled()
Checks if global ordering is enabled (all nodes listening to the same topic
get their messages in the same order), or disabled (nodes get
the messages in the order that the messages are published).
|
boolean |
isMultiThreadingEnabled()
Checks if multi-threaded processing of incoming messages is enabled or not.
|
boolean |
isStatisticsEnabled()
Checks if statistics are enabled for this topic.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
TopicConfig |
setGlobalOrderingEnabled(boolean globalOrderingEnabled)
Enable global ordering (all nodes listening to the same topic
get their messages in the same order), or disable it (nodes get
the messages in the order that the messages are published).
|
TopicConfig |
setMessageListenerConfigs(List<ListenerConfig> listenerConfigs)
Sets the list of message listeners (listens for when messages are added or removed) for this topic.
|
TopicConfig |
setMultiThreadingEnabled(boolean multiThreadingEnabled)
Enable multi-threaded message handling.
|
TopicConfig |
setName(String name)
Sets the name of the topic.
|
TopicConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Enables or disables statistics for this topic.
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public static final boolean DEFAULT_GLOBAL_ORDERING_ENABLED
public TopicConfig()
public TopicConfig(String name)
name
- the name of the Topicpublic TopicConfig(TopicConfig config)
TopicConfig
by cloning another TopicConfig.config
- the TopicConfig to clonepublic TopicConfigReadOnly getAsReadOnly()
public String getName()
public TopicConfig setName(String name)
name
- the topic name to setTopicConfig
IllegalArgumentException
- if name is null
or an empty stringpublic boolean isGlobalOrderingEnabled()
public TopicConfig setGlobalOrderingEnabled(boolean globalOrderingEnabled)
globalOrderingEnabled
- set to true
to enable global ordering, false
to disablepublic boolean isMultiThreadingEnabled()
true
if multi-threading is enabled, false
if disabledpublic TopicConfig setMultiThreadingEnabled(boolean multiThreadingEnabled)
multiThreadingEnabled
- set to true
to enable multi-threaded message processing, false
to disablepublic TopicConfig addMessageListenerConfig(ListenerConfig listenerConfig)
listenerConfig
- the message listener to add to this topicpublic List<ListenerConfig> getMessageListenerConfigs()
public TopicConfig setMessageListenerConfigs(List<ListenerConfig> listenerConfigs)
listenerConfigs
- the list of message listeners for this topicpublic boolean isStatisticsEnabled()
true
if statistics are enabled, false
otherwisepublic TopicConfig setStatisticsEnabled(boolean statisticsEnabled)
statisticsEnabled
- true
to enable statistics for this topic, false
to disablepublic int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.Copyright © 2018 Hazelcast, Inc.. All rights reserved.