public interface RootConfig extends Config
This represents the root of the configuration object tree and all configuration can be navigated to from this object.
The root configuration can be obtained using
ConfigManager.getConfig()
in any environment or if in a server
environment then ConfigManager.getServerConfig()
can be used to
obtain the more detailed server configuration.
Root properties may be configured in both server side and client side environments and represent the common properties in any Diffusion Java environment.
At the server side most properties can not be changed once the server has started. At the client side most properties should be set before any connection is made as they may be ignored after that point. See individual setters for exceptions to this.
Modifier and Type | Method and Description |
---|---|
MultiplexerConfig |
addMultiplexer(String name)
Add a new multiplexer configuration.
|
String |
getCharset()
Deprecated.
since 5.9
In future releases only UTF-8 will be supported |
int |
getDefaultDeltaMessageCapacity()
Gets the default delta message capacity.
|
int |
getDefaultLoadMessageCapacity()
Gets the default load message capacity.
|
String |
getDefaultMultiplexerDefinition()
Deprecated.
since 5.6 default multiplexer not in use as multiplexer is
configured with xml config
|
FormattingConfig |
getFormatting()
Gets the formatting (e.g dates) configuration.
|
int |
getMaximumMessageSize()
Returns the configured maximum message size.
|
int |
getMessageLengthSize()
Deprecated.
since 5.2 the message length size is always 4 bytes
|
MultiplexerConfig |
getMultiplexer(String name)
Deprecated.
since 5.6 multiplexer configuration is obtained using
ServerConfig.getMultiplexerConfiguration().
|
List<MultiplexerConfig> |
getMultiplexers()
Deprecated.
since 5.6 only one multiplexer is configured
|
int |
getNumberOfReadSelectors()
Deprecated.
since 5.9
this property will be removed in a future release |
ThreadsConfig |
getThreads()
Gets the Threads configuration.
|
TimeoutsConfig |
getTimeouts()
Gets the timeouts configuration.
|
WriteSelectorConfig |
getWriteSelectors()
Deprecated.
write selector configuration is not used since 5.3
|
boolean |
isClient()
Indicates whether a client config.
|
boolean |
isLoggingMessageData()
Is log message data option set?
|
boolean |
isServer()
Indicates whether a server config.
|
void |
setCharset(String charset)
Deprecated.
since 5.9
In future releases only UTF-8 will be supported |
void |
setDefaultDeltaMessageCapacity(int capacity)
Sets the default size for a delta message if not explicitly specified
when creating a message.
|
void |
setDefaultLoadMessageCapacity(int capacity)
Sets the default size for a load message if not explicitly specified when
creating the message.
|
void |
setDefaultMultiplexerDefinition(String name)
Deprecated.
since 5.6 multiplexer is already configured with xml config
|
void |
setLogMessageData(boolean logMessageData)
Sets the log message data option.
|
void |
setMaximumMessageSize(int maxMessageSize)
Sets the maximum message size.
|
void |
setMessageLengthSize(int size)
Deprecated.
since 5.2 the message length size is always 4 bytes
|
void |
setNumberOfReadSelectors(int size)
Deprecated.
since 5.9
this property will be removed in a future release |
boolean isServer()
ServerConfig
)boolean isClient()
@Deprecated void setMessageLengthSize(int size) throws ConfigException
In previous releases, this allowed the number of bytes used by the DPT protocol to encode the message length to be changed. This method is deprecated. In this release the message length size is always 4, and this method has no effect.
size
- message length size - ignoredConfigException
- if unable to set property@Deprecated int getMessageLengthSize()
void setMaximumMessageSize(int maxMessageSize) throws ConfigException
This is used as a safeguard as a size that no inbound message may exceed.
maxMessageSize
- The maximum message size in bytes. This defines the
maximum message size (including headers) that can be received. The
default is 32 KiB.ConfigException
- if the specified maximum message size is invalid.int getMaximumMessageSize()
@Deprecated void setCharset(String charset) throws ConfigException
In future releases only UTF-8 will be supported
This will be used for converting character based data to bytes for transmission in messages when the message itself does not specify a character set.
See Java Encodings for full list.
If this is not specified then "UTF-8" is assumed.
charset
- the character setConfigException
- if unable to set property@Deprecated String getCharset()
In future releases only UTF-8 will be supported
void setDefaultLoadMessageCapacity(int capacity) throws ConfigException
If not specified then 4k is assumed.
capacity
- the default load message capacityConfigException
- if unable to set default load message capacityint getDefaultLoadMessageCapacity()
void setDefaultDeltaMessageCapacity(int capacity) throws ConfigException
If not specified then 1k is assumed.
capacity
- the default message capacityConfigException
- if unable to set default delta message capacityint getDefaultDeltaMessageCapacity()
@Deprecated void setDefaultMultiplexerDefinition(String name) throws ConfigException
This specified the multiplexer definition to use at runtime. If specified then it must represent the name of a configured multiplexer definition.
If not specified then the first definition found will be used and if there are no definitions then one will be created with default values.
name
- multiplexer definition nameConfigException
- if unable to set the property.@Deprecated String getDefaultMultiplexerDefinition()
TimeoutsConfig getTimeouts()
This allows connection timeouts to be configured.
ThreadsConfig getThreads()
This allows concurrency related properties to be configured, including defining thread pools.
@Deprecated List<MultiplexerConfig> getMultiplexers()
@Deprecated MultiplexerConfig getMultiplexer(String name)
name
- the multiplexer nameMultiplexerConfig addMultiplexer(String name) throws ConfigException
name
- the multiplexer nameConfigException
- if unable to add configuration.FormattingConfig getFormatting()
This allows date and time formats to be configured.
@Deprecated WriteSelectorConfig getWriteSelectors()
@Deprecated void setNumberOfReadSelectors(int size) throws ConfigException
this property will be removed in a future release
By default this is set to 1 but can be increased Generally, this should not be changed unless advised by Push support. If changed it must be set before making any outbound connections.
size
- the number of selectors used for I/O operations. This must be
a positive numberConfigException
- if an invalid value is specified@Deprecated int getNumberOfReadSelectors()
this property will be removed in a future release
void setLogMessageData(boolean logMessageData) throws ConfigException
Indicates whether the data part of Messages should be logged as part of routine diagnostic message logging (debug and trace levels). If this is false then credentials message headers will also be hidden.
Default is true.
Moved from LoggingConfig in version 5.5.
logMessageData
- true if message data is to be logged.ConfigException
- if unable to set the propertyboolean isLoggingMessageData()
Moved from LoggingConfig in version 5.5.
Copyright © 2016 Push Technology Ltd. All Rights Reserved.