public class EtSystemOpenConfig
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
broadcastIP
Broadcast address.
|
Constructor and Description |
---|
EtSystemOpenConfig()
No arg constructor.
|
EtSystemOpenConfig(EtSystemOpenConfig config)
Constructor to create a new EtSystemOpenConfig object from another.
|
EtSystemOpenConfig(java.lang.String etName,
int uPort,
java.lang.String hostName)
Constructor for broadcasting on all subnets.
|
EtSystemOpenConfig(java.lang.String etName,
int uPort,
java.lang.String hostName,
java.util.Collection<java.lang.String> bAddrs)
Constructor for broadcasting on given subnets.
|
EtSystemOpenConfig(java.lang.String etName,
java.lang.String hostName)
Constructor for broadcasting on all subnets.
|
EtSystemOpenConfig(java.lang.String etName,
java.lang.String hostName,
java.util.Collection<java.lang.String> bAddrs,
java.util.Collection<java.lang.String> mAddrs,
boolean remoteOnly,
int method,
int tPort,
int uPort,
int mPort,
int ttlNum,
int policy)
Most general constructor for creating a new EtSystemOpenConfig object.
|
EtSystemOpenConfig(java.lang.String etName,
java.lang.String hostName,
java.util.Collection<java.lang.String> mAddrs,
int mPort,
int ttlNum)
Constructor for multicasting.
|
EtSystemOpenConfig(java.lang.String etName,
java.lang.String hostName,
java.util.Collection<java.lang.String> mAddrs,
int uPort,
int mPort,
int ttlNum)
Constructor for multicasting.
|
EtSystemOpenConfig(java.lang.String etName,
java.lang.String hostName,
int tPort)
Constructor for connecting directly to tcp server.
|
Modifier and Type | Method and Description |
---|---|
void |
addBroadcastAddr(java.lang.String addr)
Adds a broadcast address to the set.
|
void |
addMulticastAddr(java.lang.String addr)
Adds a multicast address to the set.
|
void |
broadcasting(boolean on)
Set true if we're broadcasting to find ET system.
|
java.util.HashSet<java.lang.String> |
getBroadcastAddrs()
Gets multicast addresses.
|
java.lang.String |
getEtName()
Gets the ET system name.
|
java.lang.String |
getHost()
Gets the ET system host name or general location of ET system.
|
java.util.HashSet<java.lang.String> |
getMulticastAddrs()
Gets multicast addresses.
|
int |
getMulticastPort()
Gets port number to multicast to.
|
int |
getNetworkContactMethod()
Gets the means used to contact an ET system.
|
java.lang.String |
getNetworkInterface()
Get the network interface used for connecting to the ET system.
|
int |
getNumMulticastAddrs()
Gets the number of multicast addresses.
|
int |
getResponsePolicy()
Gets policy on what to do about multiple responding ET systems to a
broadcast or multicast.
|
int |
getTcpPort()
Gets TCP server port number of the ET system.
|
int |
getTcpRecvBufSize()
Get the TCP send buffer size in bytes.
|
int |
getTcpSendBufSize()
Get the TCP receive buffer size in bytes.
|
int |
getTTL()
Gets time-to-live value for multicasting.
|
int |
getUdpPort()
Gets UDP port number for broadcasting or sending udp packets to known hosts.
|
long |
getWaitTime()
If no ET system is available, the number of milliseconds we wait while trying to open it.
|
boolean |
isBroadcasting()
Are we broadcasting to find ET system?
|
boolean |
isConnectRemotely()
Are we going to connect to an ET system remotely only (=true), or will
we also try to use memory mapping and JNI with local C-based ET systems?
|
boolean |
isNoDelay()
Get the TCP no-delay setting.
|
void |
removeMulticastAddr(java.lang.String addr)
Removes a multicast address from the set.
|
boolean |
selfConsistent()
Determine if vital parameters are set and all settings are self consistent.
|
void |
setBroadcastAddrs(java.util.Collection<java.lang.String> addrs)
Sets the collection of broadcast addresses.
|
void |
setConnectRemotely(boolean connectRemotely)
Sets whether we going to connect to an ET system remotely only (=true), or whether
we will try to use memory mapping and JNI with local C-based ET systems.
|
void |
setEtName(java.lang.String etName)
Sets the ET system name.
|
void |
setHost(java.lang.String hostName)
Sets the ET system host name or broad/multicast destination.
|
void |
setMulticastAddrs(java.util.Collection<java.lang.String> addrs)
Sets the collection of multicast addresses.
|
void |
setMulticastPort(int port)
Sets the port number to multicast to.
|
void |
setNetworkContactMethod(int method)
Sets the means or method of contacting an ET system.
|
void |
setNetworkInterface(java.lang.String networkInterface)
Set the network interface (in dotted-decimal format) used for connecting to the ET system.
|
void |
setNoDelay(boolean noDelay)
Set the TCP no-delay setting.
|
void |
setResponsePolicy(int policy)
Sets the policy on what to do about multiple responding ET systems to a
broadcast or multicast.
|
void |
setTcpPort(int port)
Sets the TCP server port number of the ET system.
|
void |
setTcpRecvBufSize(int tcpRecvBufSize)
Set the TCP receive buffer size in bytes.
|
void |
setTcpSendBufSize(int tcpSendBufSize)
Set the TCP send buffer size in bytes.
|
void |
setTTL(int ttlNum)
Sets the time-to-live value for multicasting.
|
void |
setUdpPort(int port)
Sets the UDP port number for broadcasting and sending udp packets to known hosts.
|
void |
setWaitTime(long waitTime)
If no ET system is available, set the number of milliseconds we wait while trying to open it.
|
java.lang.String |
toString()
Method to create a string representation of this object
|
public static final java.lang.String broadcastIP
public EtSystemOpenConfig()
public EtSystemOpenConfig(java.lang.String etName, java.lang.String hostName, java.util.Collection<java.lang.String> bAddrs, java.util.Collection<java.lang.String> mAddrs, boolean remoteOnly, int method, int tPort, int uPort, int mPort, int ttlNum, int policy) throws org.jlab.coda.et.exception.EtException
etName
- ET system namehostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
bAddrs
- collection of broadcast addresses (as Strings) to broadcast on in order to
find ET system. If = null, set to list of all local subnets' broadcast addresses.mAddrs
- collection of multicast addresses (as Strings) to multicast to in order to
find ET system. If = null, set to default which is a list containing only
EtConstants.multicastAddr = 239.200.0.0.remoteOnly
- true
if talking to ET system only through sockets
(as if remote), or false
if also using JNI/shared memory
for talking to local C-based ET systemsmethod
- means used to contact an ET system over the network:
EtConstants.broadcast
, EtConstants.multicast
,
EtConstants.direct
, or EtConstants.broadAndMulticast
tPort
- TCP server port number of the ET system. If = 0, set to default which is
EtConstants.serverPort = 11111.uPort
- UDP port number for broadcasting or sending udp packets to known hosts.
If = 0, set to default which is EtConstants.broadcastPort = 11111.mPort
- Port number to multicast to. If = 0, set to default which is
EtConstants.multicastPort = 11112.ttlNum
- Time-to_live value for multicasting. If = 0, set to default which is 32.policy
- policy on what to do about multiple responding ET systems to
a broadcast or multicast: EtConstants.policyFirst
,
EtConstants.policyLocal
, or EtConstants.policyError
org.jlab.coda.et.exception.EtException
- if null, blank, or too-long etName;
if null or blank hostName;
if method value is not valid;
if method is direct and no actual host name was specified;
if port numbers are < 1024 or > 65535 (except if = 0 which uses default value);
if ttl is < 0 or > 254;
if policy value is not validpublic EtSystemOpenConfig(java.lang.String etName, java.lang.String hostName) throws org.jlab.coda.et.exception.EtException
etName
- ET system namehostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
org.jlab.coda.et.exception.EtException
- if args are null or blank;public EtSystemOpenConfig(java.lang.String etName, int uPort, java.lang.String hostName) throws org.jlab.coda.et.exception.EtException
etName
- ET system nameuPort
- UDP port number to broadcasting to.
If = 0, set to default which is EtConstants.broadcastPort = 11111.hostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
org.jlab.coda.et.exception.EtException
- if no broadcast addresses were specified;
if port number is < 1024 or > 65535public EtSystemOpenConfig(java.lang.String etName, int uPort, java.lang.String hostName, java.util.Collection<java.lang.String> bAddrs) throws org.jlab.coda.et.exception.EtException
etName
- ET system nameuPort
- UDP port number to broadcasting to.
If = 0, set to default which is EtConstants.broadcastPort = 11111.hostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
bAddrs
- collection of broadcast addresses (as Strings) to broadcast on in order to
find ET system. If = null, set to list of all local subnets' broadcast addresses.org.jlab.coda.et.exception.EtException
- if no broadcast addresses were specified;
if port number is < 1024 or > 65535public EtSystemOpenConfig(java.lang.String etName, java.lang.String hostName, java.util.Collection<java.lang.String> mAddrs, int mPort, int ttlNum) throws org.jlab.coda.et.exception.EtException
etName
- ET system namehostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
mAddrs
- collection of multicast addresses (as Strings) to multicast to in order to
find ET system. If = null, set to default which is a list containing only
EtConstants.multicastAddr = 239.200.0.0.mPort
- Port number to multicast to. If = 0, set to default which is
EtConstants.multicastPort = 11112.ttlNum
- Time-to_live value for multicasting. If = 0, set to default which is 32.org.jlab.coda.et.exception.EtException
- if no multicast addresses were specified;
if port number is < 1024 or > 65535;
if ttl is < 0 or > 254public EtSystemOpenConfig(java.lang.String etName, java.lang.String hostName, java.util.Collection<java.lang.String> mAddrs, int uPort, int mPort, int ttlNum) throws org.jlab.coda.et.exception.EtException
etName
- ET system namehostName
- may open an ET system on the given host which could be the:
1) actual ET system's host name,
2) dotted decimal address of ET system's host, or
3) general location of ET system such as EtConstants.hostAnywhere
,
EtConstants.hostLocal
, or EtConstants.hostRemote
mAddrs
- collection of multicast addresses (as Strings) to multicast to in order to
find ET system. If = null, set to default which is a list containing only
EtConstants.multicastAddr = 239.200.0.0.uPort
- UDP port number for broadcasting or sending udp packets to known hosts.
If = 0, set to default which is EtConstants.broadcastPort = 11111.mPort
- Port number to multicast to. If = 0, set to default which is
EtConstants.multicastPort = 11112.ttlNum
- Time-to_live value for multicasting. If = 0, set to default which is 32.org.jlab.coda.et.exception.EtException
- if no multicast addresses were specified;
if port numbers are < 1024 or > 65535, or ttl is < 0 or > 254public EtSystemOpenConfig(java.lang.String etName, java.lang.String hostName, int tPort) throws org.jlab.coda.et.exception.EtException
etName
- ET system namehostName
- ET system host nametPort
- TCP server port number of the ET system. If = 0, set to default which is
EtConstants.serverPort = 11111.org.jlab.coda.et.exception.EtException
- if no actual host name was specified;
if port number is < 1024 or > 65535public EtSystemOpenConfig(EtSystemOpenConfig config)
config
- EtSystemOpenConfig object from which to create a new configurationpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean selfConsistent()
true
if setting are self consistent, else false
public java.lang.String getEtName()
public java.lang.String getHost()
public java.util.HashSet<java.lang.String> getBroadcastAddrs()
public java.util.HashSet<java.lang.String> getMulticastAddrs()
public int getNetworkContactMethod()
public int getResponsePolicy()
public int getUdpPort()
public int getTcpPort()
public int getMulticastPort()
public int getTTL()
public int getNumMulticastAddrs()
public boolean isBroadcasting()
public void broadcasting(boolean on)
public boolean isConnectRemotely()
true
if connecting to ET system remotely only, else false
public long getWaitTime()
public java.lang.String getNetworkInterface()
public int getTcpSendBufSize()
public int getTcpRecvBufSize()
public boolean isNoDelay()
public void setEtName(java.lang.String etName)
etName
- ET system namepublic void setHost(java.lang.String hostName)
EtConstants.hostAnywhere
,
EtConstants.hostLocal
/"localhost", or EtConstants.hostRemote
.hostName
- system host name or broad/multicast destinationpublic void removeMulticastAddr(java.lang.String addr)
addr
- multicast address to be removedpublic void setConnectRemotely(boolean connectRemotely)
connectRemotely
- true
if connecting to ET system remotely only, else false
public void setWaitTime(long waitTime)
waitTime
- the number of milliseconds we wait while trying to open ET systempublic void addBroadcastAddr(java.lang.String addr) throws org.jlab.coda.et.exception.EtException
addr
- broadcast address to be addedorg.jlab.coda.et.exception.EtException
- if the address is not a broadcast addresspublic void setBroadcastAddrs(java.util.Collection<java.lang.String> addrs) throws org.jlab.coda.et.exception.EtException
addrs
- collection of broadcast addresses (as Strings) or nullorg.jlab.coda.et.exception.EtException
- if one of the addresses is not a broadcast addresspublic void addMulticastAddr(java.lang.String addr) throws org.jlab.coda.et.exception.EtException
addr
- multicast address to be addedorg.jlab.coda.et.exception.EtException
- if the address is not a multicast addresspublic void setMulticastAddrs(java.util.Collection<java.lang.String> addrs) throws org.jlab.coda.et.exception.EtException
addrs
- collection of multicast addresses (as Strings) or nullorg.jlab.coda.et.exception.EtException
- if one of the addresses is not a multicast addresspublic void setNetworkContactMethod(int method) throws org.jlab.coda.et.exception.EtException
EtConstants.broadcast
for broadcasting, EtConstants.multicast
for multicasting, EtConstants.direct
for connecting directly to the
ET tcp server, and EtConstants.broadAndMulticast
for using both
broadcasting and multicasting.method
- means or method of contacting an ET systemorg.jlab.coda.et.exception.EtException
- if the argument has a bad valuepublic void setResponsePolicy(int policy) throws org.jlab.coda.et.exception.EtException
EtConstants.policyFirst
which chooses the first ET system to
respond, EtConstants.policyLocal
which chooses the first local ET
system to respond and if none then the first response, or
EtConstants.policyError
which throws an EtTooManyException
exception.policy
- policy on what to do about multiple responding ET systemsorg.jlab.coda.et.exception.EtException
- if the argument has a bad value or if the policy says to choose a local
ET system but the host is set to chose a remote system.public void setUdpPort(int port) throws org.jlab.coda.et.exception.EtException
port
- UDP port number for broadcasting and sending udp packets to known hosts;
set to 0 for default = EtConstants.broadcastPort
.org.jlab.coda.et.exception.EtException
- if the port number is < 1024 or > 65535public void setTcpPort(int port) throws org.jlab.coda.et.exception.EtException
port
- TCP server port number of the ET system;
set to 0 for default = EtConstants.serverPort
.org.jlab.coda.et.exception.EtException
- if the port number is < 1024 or > 65535public void setMulticastPort(int port) throws org.jlab.coda.et.exception.EtException
port
- port number to multicast to;
set to 0 for default = EtConstants.multicastPort
.org.jlab.coda.et.exception.EtException
- if the port number is < 1024 or > 65535public void setTTL(int ttlNum) throws org.jlab.coda.et.exception.EtException
ttlNum
- time-to-live value for multicasting (-1 < ttl < 255);
set to 0 for default = EtConstants.multicastTTL
.org.jlab.coda.et.exception.EtException
- if the port number is < 0 or > 254public void setNetworkInterface(java.lang.String networkInterface) throws org.jlab.coda.et.exception.EtException
networkInterface
- the network interface used for connecting to the ET system,
or null if none specified. Address may be either a specific
or broadcast IP dotted-decimal.org.jlab.coda.et.exception.EtException
- if the interface is not in dotted-decimal format or is an invalid IP address.public void setTcpSendBufSize(int tcpSendBufSize) throws org.jlab.coda.et.exception.EtException
tcpSendBufSize
- TCP send buffer size in bytesorg.jlab.coda.et.exception.EtException
- if the argument is less than 0public void setTcpRecvBufSize(int tcpRecvBufSize) throws org.jlab.coda.et.exception.EtException
tcpRecvBufSize
- TCP receive buffer size in bytesorg.jlab.coda.et.exception.EtException
- if the argument is less than 0public void setNoDelay(boolean noDelay)
noDelay
- TCP no-delay setting