public final class ChannelAccessClientConfiguration
extends java.lang.Object
ChannelAccessClient
.Constructor and Description |
---|
ChannelAccessClientConfiguration()
Creates a configuration for a Channel Access client that uses default
values for all options.
|
ChannelAccessClientConfiguration(java.nio.charset.Charset charset,
java.lang.String hostName,
java.lang.String userName,
java.lang.Integer maxPayloadReceiveSize,
java.lang.Integer maxPayloadSendSize,
java.lang.Double echoInterval,
java.lang.Long cidBlockReuseTime,
ChannelAccessEventMask defaultEventMask,
ErrorHandler errorHandler,
BeaconDetectorConfiguration beaconDetectorConfiguration,
ChannelNameResolverConfiguration resolverConfiguration)
Creates a configuration for a Channel Access client using the specified
options.
|
ChannelAccessClientConfiguration(java.nio.charset.Charset charset,
java.lang.String hostName,
java.lang.String userName,
java.lang.Integer maxPayloadReceiveSize,
java.lang.Integer maxPayloadSendSize,
java.lang.Long cidBlockReuseTime,
ChannelAccessEventMask defaultEventMask,
ErrorHandler errorHandler,
BeaconDetectorConfiguration beaconDetectorConfiguration,
ChannelNameResolverConfiguration resolverConfiguration)
|
Modifier and Type | Method and Description |
---|---|
BeaconDetectorConfiguration |
getBeaconDetectorConfiguration()
Returns the configuration for the
BeaconDetector used by the
client. |
java.nio.charset.Charset |
getCharset()
Returns the character set that should be used for encoding and decoding
strings.
|
long |
getCIDBlockReuseTime()
Returns the time that a CID is blocked from being reused after the
corresponding channel has been destroyed.
|
ChannelAccessEventMask |
getDefaultEventMask()
Returns the default event mask.
|
double |
getEchoInterval()
Returns the interval between two echo requests.
|
ErrorHandler |
getErrorHandler()
Returns the error handler that is used by all client components, unless
there is a component-specific configuration that defines its own error
handler.
|
java.lang.String |
getHostName()
Returns the host name that shall be used as the identification of the
local machine when connecting to a Channel Access server.
|
int |
getMaxPayloadReceiveSize()
Returns the maximum payload size for message received via TCP (in bytes).
|
int |
getMaxPayloadSendSize()
Returns the maximum payload size for message sent via TCP (in bytes).
|
ChannelNameResolverConfiguration |
getResolverConfiguration()
Returns the configuration for the
ChannelNameResolver used by the
client. |
java.lang.String |
getUserName()
Returns the user name that shall be used as the identification of the
user when connecting to a Channel Access server.
|
public ChannelAccessClientConfiguration()
null
for
all parameters of the
ChannelAccessClientConfiguration(Charset, String, String, Integer, Integer, Double, Long, ChannelAccessEventMask, ErrorHandler, BeaconDetectorConfiguration, ChannelNameResolverConfiguration)
constructor.public ChannelAccessClientConfiguration(java.nio.charset.Charset charset, java.lang.String hostName, java.lang.String userName, java.lang.Integer maxPayloadReceiveSize, java.lang.Integer maxPayloadSendSize, java.lang.Long cidBlockReuseTime, ChannelAccessEventMask defaultEventMask, ErrorHandler errorHandler, BeaconDetectorConfiguration beaconDetectorConfiguration, ChannelNameResolverConfiguration resolverConfiguration)
ChannelAccessClientConfiguration(Charset, String, String, Integer, Integer, Double, Long, ChannelAccessEventMask, ErrorHandler, BeaconDetectorConfiguration, ChannelNameResolverConfiguration)
instead.null
is passed for an option, the default value
for this option is used.charset
- character set used to encode and decode strings. If this
parameter is null
the UTF-8 character set is
used. If the UTF-8 character set is not available on this
platform, the platform's default character set is used.hostName
- host name identifying the client computer when connecting to a
server. If null
the host name is determined
automatically using the HostNameUtil.getHostName()
method. If the host name cannot be determined automatically,
the special string "<unknown host>" is used.userName
- user name identifying the user when connecting to a server. If
null
the user name is determined automatically
using the UserNameUtil.getUserName()
method. If the
user name cannot be determined automatically, the empty string
is used.maxPayloadReceiveSize
- maximum size of the payload of a message received via TCP (in
bytes). This effectively limits the number of elements that
can be transferred from the server in a get operation for a
channel. Must be at least 16384 bytes. If null
a
default value of 2147483616 is used, unless the
EPICS_CA_AUTO_ARRAY_BYTES
environment variable is
set to NO
. In that case, the
EPICS_CA_MAX_ARRAY_BYTES
environment variable is
used and if it is not set or its value is invalid, a default
value of 16384 bytes is used.maxPayloadSendSize
- maximum size of the payload of a message sent via TCP (in
bytes). This effectively limits the number of elements that
can be transferred to the server in a put operation for a
channel. Must be at least 16384 bytes. If null
a
default value of 2147483616 is used, unless the
EPICS_CA_AUTO_ARRAY_BYTES
environment variable is
set to NO
. In that case, the
EPICS_CA_MAX_ARRAY_BYTES
environment variable is
used and if it is not set or its value is invalid, a default
value of 16384 bytes is used.cidBlockReuseTime
- time that a CID is blocked from being used again in
milliseconds. If null
a default value of 900000
milliseconds (15 minutes) is used. After destroying a channel,
the CID may not be reused for some time because there might
still be late responses to old search requests, which would be
used for the wrong channel if the CID was reused too early. A
value of 0 (or a negative value) means that CIDs can be reused
immediately.defaultEventMask
- default event mask to use when creating monitors. If
null
an event mask of
DBE_VALUE|DBE_ALARM
is used. May not be
DBE_NONE
.errorHandler
- error handler to use for handling all errors in the client or
null
if the default error handler (
JavaUtilLoggingErrorHandler
) should be used.beaconDetectorConfiguration
- configuration for the BeaconDetector
that should be
used or null
to use a configuration with default
settings. If this parameter is null
, the
configuration that is created will use the specified
errorHandler
.resolverConfiguration
- configuration for the ChannelNameResolver
that should
be used or null
to use a configuration with
default settings. If this parameter is null
, the
configuration that is created will use the specified
charset
and errorHandler
.java.lang.IllegalArgumentException
- if maxPayloadReceiveSize
or
maxPayloadSendSize
are less than 16384 or
greater than 2147483616 or defaultEventMask
is
ChannelAccessEventMask.DBE_NONE
.public ChannelAccessClientConfiguration(java.nio.charset.Charset charset, java.lang.String hostName, java.lang.String userName, java.lang.Integer maxPayloadReceiveSize, java.lang.Integer maxPayloadSendSize, java.lang.Double echoInterval, java.lang.Long cidBlockReuseTime, ChannelAccessEventMask defaultEventMask, ErrorHandler errorHandler, BeaconDetectorConfiguration beaconDetectorConfiguration, ChannelNameResolverConfiguration resolverConfiguration)
null
is passed for an option, the default value
for this option is used.charset
- character set used to encode and decode strings. If this
parameter is null
the UTF-8 character set is
used. If the UTF-8 character set is not available on this
platform, the platform's default character set is used.hostName
- host name identifying the client computer when connecting to a
server. If null
the host name is determined
automatically using the HostNameUtil.getHostName()
method. If the host name cannot be determined automatically,
the special string "<unknown host>" is used.userName
- user name identifying the user when connecting to a server. If
null
the user name is determined automatically
using the UserNameUtil.getUserName()
method. If the
user name cannot be determined automatically, the empty string
is used.maxPayloadReceiveSize
- maximum size of the payload of a message received via TCP (in
bytes). This effectively limits the number of elements that
can be transferred from the server in a get operation for a
channel. Must be at least 16384 bytes. If null
a
default value of 2147483616 is used, unless the
EPICS_CA_AUTO_ARRAY_BYTES
environment variable is
set to NO
. In that case, the
EPICS_CA_MAX_ARRAY_BYTES
environment variable is
used and if it is not set or its value is invalid, a default
value of 16384 bytes is used.maxPayloadSendSize
- maximum size of the payload of a message sent via TCP (in
bytes). This effectively limits the number of elements that
can be transferred to the server in a put operation for a
channel. Must be at least 16384 bytes. If null
a
default value of 2147483616 is used, unless the
EPICS_CA_AUTO_ARRAY_BYTES
environment variable is
set to NO
. In that case, the
EPICS_CA_MAX_ARRAY_BYTES
environment variable is
used and if it is not set or its value is invalid, a default
value of 16384 bytes is used.echoInterval
- interval between sending echo requests to a server in seconds.
If null
, theEPICS_CA_CONN_TMO
environment variable is used. If the environment variable is
not set or its value is invalid, a default value of 30 seconds
is used.cidBlockReuseTime
- time that a CID is blocked from being used again in
milliseconds. If null
a default value of 900000
milliseconds (15 minutes) is used. After destroying a channel,
the CID may not be reused for some time because there might
still be late responses to old search requests, which would be
used for the wrong channel if the CID was reused too early. A
value of 0 (or a negative value) means that CIDs can be reused
immediately.defaultEventMask
- default event mask to use when creating monitors. If
null
an event mask of
DBE_VALUE|DBE_ALARM
is used. May not be
DBE_NONE
.errorHandler
- error handler to use for handling all errors in the client or
null
if the default error handler (
JavaUtilLoggingErrorHandler
) should be used.beaconDetectorConfiguration
- configuration for the BeaconDetector
that should be
used or null
to use a configuration with default
settings. If this parameter is null
, the
configuration that is created will use the specified
errorHandler
.resolverConfiguration
- configuration for the ChannelNameResolver
that should
be used or null
to use a configuration with
default settings. If this parameter is null
, the
configuration that is created will use the specified
charset
, errorHandler
. and
echoInterval
.java.lang.IllegalArgumentException
- if maxPayloadReceiveSize
or
maxPayloadSendSize
are less than 16384,
echoInterval
is less than 100, or
defaultEventMask
is
ChannelAccessEventMask.DBE_NONE
.public java.nio.charset.Charset getCharset()
public java.lang.String getHostName()
public java.lang.String getUserName()
public int getMaxPayloadReceiveSize()
ChannelAccessConstants.MESSAGE_SIZE_ALIGNMENT
.public int getMaxPayloadSendSize()
ChannelAccessConstants.MESSAGE_SIZE_ALIGNMENT
.public ChannelAccessEventMask getDefaultEventMask()
ChannelAccessMonitor
if no event mask is specified explicitly.public long getCIDBlockReuseTime()
public double getEchoInterval()
Returns the interval between two echo requests.
Echo requests are sent to a Channel Access server in order to ensure that the connection is still working. If a beacon packet from the same server is received, this is considered proof that the network connection is okay and thus no echo request is sent. For this reason, this setting should be chosen to be at least two times as large as the max. interval between sending two beacons.
When an echo request is sent and no reply is received promptly, the Channel Access channels associated with the respective server are put into the disconnected state. The server connection itself, however, is not closed. If the connection recovers, the channels are put back into the connected state. The connection is only closed by the underlying operating system. However, sending an echo request can be useful in this context because sending any data at all might help the operating system in detecting that the TCP connection has been interrupted.
The minimum for this setting is 0.1 seconds.
public ErrorHandler getErrorHandler()
public BeaconDetectorConfiguration getBeaconDetectorConfiguration()
BeaconDetector
used by the
client.public ChannelNameResolverConfiguration getResolverConfiguration()
ChannelNameResolver
used by the
client.Copyright © 2014–2017 aquenos GmbH. All rights reserved.