public final class ChannelNameResolverConfiguration
extends java.lang.Object
ChannelNameResolver
.Constructor and Description |
---|
ChannelNameResolverConfiguration()
Creates a configuration for a channel-name resolver using environment
variables.
|
ChannelNameResolverConfiguration(java.nio.charset.Charset charset,
ErrorHandler errorHandler,
java.lang.Integer defaultServerPort,
java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> tcpAddresses,
java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> udpAddresses,
java.lang.Boolean autoDetermineAddresses,
java.lang.Double maximumSearchPeriod)
Deprecated.
|
ChannelNameResolverConfiguration(java.nio.charset.Charset charset,
ErrorHandler errorHandler,
java.lang.String hostName,
java.lang.String userName,
java.lang.Integer defaultServerPort,
java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> tcpAddresses,
java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> udpAddresses,
java.lang.Boolean autoDetermineAddresses,
java.lang.Double maximumSearchPeriod,
java.lang.Double echoInterval,
java.lang.Integer multicastTimeToLive)
Creates a channel-name resolver configuration using the specified
options.
|
Modifier and Type | Method and Description |
---|---|
java.nio.charset.Charset |
getCharset()
Returns the character set that should be used for encoding and decoding
channel names.
|
int |
getDefaultServerPort()
Returns the TCP and UDP port that should be used when connecting to a
server for name resolution and no port has been specified for this server
explicitly.
|
double |
getEchoInterval()
Returns the interval between two echo requests.
|
ErrorHandler |
getErrorHandler()
Returns the error handler that should be used by the channel-name
resolver.
|
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.
|
double |
getMaximumSearchPeriod()
Returns the maximum search period (in seconds).
|
int |
getMulticastTimeToLive()
Returns the multicast TTL.
|
java.util.Set<java.net.InetSocketAddress> |
getTcpAddresses()
Returns socket addresses of server addresses that should be contacted via
TCP for name resolution.
|
java.util.Set<java.net.InetSocketAddress> |
getUdpAddresses()
Returns socket addresses of server addresses and broadcast addresses that
should be contacted via UDP for name resolution.
|
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.
|
boolean |
isAutoDetermineAddresses()
Returns whether the broadcast addresses for the local interfaces should
also be contacted via UDP, even if they are not explicitly listed in the
set returned by
getUdpAddresses() . |
public ChannelNameResolverConfiguration()
JavaUtilLoggingErrorHandler
. The EPICS_CA_ADDR_LIST
,
EPICS_CA_AUTO_ADDR_LIST
, EPICS_CA_NAME_SERVERS
,
EPICS_CA_SERVER_PORT
,
EPICS_CA_MAX_SEARCH_PERIOD
, EPICS_CA_CONN_TMO
and EPICS_CA_MCAST_TTL
environment variables are used for
initializing the other configuration options. They have exactly the same
meanings and default values as specified by the Channel Access Reference
Manual.public ChannelNameResolverConfiguration(java.nio.charset.Charset charset, ErrorHandler errorHandler, java.lang.Integer defaultServerPort, java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> tcpAddresses, java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> udpAddresses, java.lang.Boolean autoDetermineAddresses, java.lang.Double maximumSearchPeriod)
ChannelNameResolverConfiguration(Charset, ErrorHandler, String, String, Integer, Set, Set, Boolean, Double, Double, Integer)
instead.null
is initialized from its
corresponding environment variable, as the constructor
ChannelNameResolverConfiguration()
does.charset
- character set used to encode and decode channel names. 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.errorHandler
- error handler which is used to log errors that are encountered
by the channel-name resolver or null
if a
JavaUtilLoggingErrorHandler
shall be used.defaultServerPort
- default port to assume for servers if no port is specified
explicitly or null
to use
EPICS_CA_SERVER_PORT
.tcpAddresses
- set of IP-address port pairs of channel name servers that
should be queried via TCP or null
to use
EPICS_CA_NAME_SERVERS
.udpAddresses
- set of IP-address port pairs of channel name servers or
broadcast addresses that should be queried via UDP or
null
to use EPICS_CA_ADDR_LIST
.autoDetermineAddresses
- true
if the broadcast addresses of all local
interfaces should be added to the set of addresses that are
queried via UDP, false
if those addresses should
not be added, and null
if
EPICS_CA_AUTO_ADDR_LIST
should be used.maximumSearchPeriod
- interval of the longest search period (in seconds) or
null
if EPICS_CA_MAX_SEARCH_PERIOD
should be used. The minimum value for this setting is 60. If
it is below 60, it is silently set to 60.java.lang.IllegalArgumentException
- if defaultServerPort
is specified and zero or an
invalid port number and if tcpAddresses
or
udpAddresses
contains an entry with a zero or
invalid port number.public ChannelNameResolverConfiguration(java.nio.charset.Charset charset, ErrorHandler errorHandler, java.lang.String hostName, java.lang.String userName, java.lang.Integer defaultServerPort, java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> tcpAddresses, java.util.Set<Pair<java.net.Inet4Address,java.lang.Integer>> udpAddresses, java.lang.Boolean autoDetermineAddresses, java.lang.Double maximumSearchPeriod, java.lang.Double echoInterval, java.lang.Integer multicastTimeToLive)
null
is initialized from its
corresponding environment variable, as the constructor
ChannelNameResolverConfiguration()
does.charset
- character set used to encode and decode channel names. 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.errorHandler
- error handler which is used to log errors that are encountered
by the channel-name resolver or null
if a
JavaUtilLoggingErrorHandler
shall be 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.defaultServerPort
- default port to assume for servers if no port is specified
explicitly or null
to use
EPICS_CA_SERVER_PORT
.tcpAddresses
- set of IP-address port pairs of channel name servers that
should be queried via TCP or null
to use
EPICS_CA_NAME_SERVERS
.udpAddresses
- set of IP-address port pairs of channel name servers or
broadcast addresses that should be queried via UDP or
null
to use EPICS_CA_ADDR_LIST
.autoDetermineAddresses
- true
if the broadcast addresses of all local
interfaces should be added to the set of addresses that are
queried via UDP, false
if those addresses should
not be added, and null
if
EPICS_CA_AUTO_ADDR_LIST
should be used.maximumSearchPeriod
- interval of the longest search period (in seconds) or
null
if EPICS_CA_MAX_SEARCH_PERIOD
should be used. The minimum value for this setting is 60. If
it is below 60, it is silently set to 60.echoInterval
- interval between sending echo requests to a TCP-based
name-server in seconds. If null
, the
EPICS_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.multicastTimeToLive
- TTL to be used for UDP search packets that are sent to
multicast addresses. If null
the
EPICS_CA_MCAST_TTL
environment variable is used.
If the environment variable is not set or its value is
invalid, a default value of 1 is used. The minimum value for
this setting is 1 and the maximum value is 255.java.lang.IllegalArgumentException
- if defaultServerPort
is specified and zero or an
invalid port number, tcpAddresses
or
udpAddresses
contains an entry with a zero or
invalid port number, or multicastTimeToLive
is
out of range.public java.nio.charset.Charset getCharset()
public double getEchoInterval()
Returns the interval between two echo requests.
Echo requests are sent to a TCP-based name-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.
Unlike for channel-servers, the echo mechanism does not affect the connected state of any name-server. However, sending echo requests when no beacons have been received still makes sense because actually sending some data 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()
ExceptionSafeErrorHandler
.public int getDefaultServerPort()
public java.util.Set<java.net.InetSocketAddress> getTcpAddresses()
public java.util.Set<java.net.InetSocketAddress> getUdpAddresses()
public boolean isAutoDetermineAddresses()
getUdpAddresses()
.true
if the broadcast addresses of all local
interfaces should be used for name resolution, false
if only the explicitly configured address should be used.public double getMaximumSearchPeriod()
public int getMulticastTimeToLive()
public java.lang.String getHostName()
public java.lang.String getUserName()
Copyright © 2014–2017 aquenos GmbH. All rights reserved.