public interface ConnectionParam extends Param
This container of connection parameters is created by
Context.makeConnectionParam()
and it is used by
Context.makeConnection()
.
Modifier and Type | Field and Description |
---|---|
static int |
CONN_TYPE_HTTP_TUNNEL
Connection-transport type-code: to use an HTTP tunnel, over TCP/IP, as
transport.
|
static int |
CONN_TYPE_SOCKS4A
Connection-transport type-code: to use an Socks4A proxy.
|
static int |
CONN_TYPE_SOCKS5
Connection-transport type-code: to use an Socks5 proxy.
|
static int |
CONN_TYPE_TCP
Connection-transport type-code: to use TCP/IP as transport.
|
static int |
USER_TYPE_AUTOTRADER
User-type code: to create a connection on which send data variations
(transaction).
|
static int |
USER_TYPE_CONTROLLER
User-type code: to create a specialized (no more here described)
connection.
|
static int |
USER_TYPE_MASTERSLAVE
User-type code: to create a specialized (no more here described)
connection.
|
static int |
USER_TYPE_MONITOR
User-type code: to create a connection on which request data
(subscriptions and/or queries).
|
static int |
USER_TYPE_TRADER
User-type code: to create a connection on which send data variations
(transaction).
|
static int |
USER_TYPE_VIEW
User-type code: to create a connection on which request data
(subscriptions and queries).
|
Modifier and Type | Method and Description |
---|---|
String |
getAlternativeHost()
Returns the optional alternative requested server-host of a new
connection.
|
int |
getAlternativePort()
Returns the optional alternative requested server-port of a new
connection.
|
int[] |
getApplRevision()
Returns the client version for the new connection.
|
int |
getApplSignature()
Returns the client signature for the new connection.
|
File |
getAuthFile()
Returns the File that contains an authorization key for the new
connection.
|
String |
getAuthKey()
Returns the authorization key for the new connection.
|
String |
getCharSet()
Returns the String that represents the charset
used to code/decode the strings on the new connection.
|
int |
getClientID()
Returns the ClientID for the new connection.
|
boolean |
getCompression()
Returns the requested indication about a compressed transmission for a
new connection.
|
int[] |
getConnType()
Returns the array of connection-transport code of a new connection.
|
String |
getHost()
Returns the requested server-host of a new connection.
|
String |
getPassword()
Returns the requested user-password of a new connection.
|
int |
getPort()
Returns the requested server-port of a new connection.
|
String |
getProxyHost()
Returns the optional requested proxy-host of a new connection.
|
int |
getProxyPort()
Returns the optional requested proxy-port of a new connection.
|
String |
getProxyUserName()
Returns the optional requested proxy-username of a new connection.
|
String |
getService()
Returns the optional market/service name to which the new connection must
talk.
|
boolean |
getTcpNoDelay()
Tests if TCP_NODELAY is enabled.
|
String |
getUserName()
Returns the requested user-name of a new connection.
|
int |
getUserType()
Returns the user-type code of a new connection.
|
void |
setAlternativeHost(String alternativeHost)
Set/replace the optional alternative requested server-host of a new
connection.
|
void |
setAlternativePort(int alternativePort)
Set/replace the optional alternative requested server-port of a new
connection.
|
void |
setApplRevision(int[] applRevision)
Set/replace the client version for the new connection.
|
void |
setApplSignature(int applSignature)
Set/replace the client signature for the new connection.
|
void |
setAuthFile(File file)
Set/replace the File that contains an authorization key for the new
connection.
|
void |
setAuthKey(String key)
Set/replace the authorization key for the new connection.
|
void |
setCharSet(String charSet)
Set/replace the String that represents the charset
used to code/decode the strings on the new connection.
|
void |
setClientID(int clientID)
Set/replace the ClientID for the new connection.
|
void |
setCompression(boolean enable)
Set/replace the requested indication about a compressed transmission for
a new connection.
|
void |
setConnType(int connType)
Set/replace the connection-transport code of a new connection.
|
void |
setConnType(int[] connType)
Set/replace the array of connection-transport code to try for a new
connection.
|
void |
setHost(String host)
Set/replace the requested server-host of a new connection.
|
void |
setPassword(String password)
Set/replace the requested user-password of a new connection.
|
void |
setPort(int port)
Set/replace the requested server-port of a new connection.
|
void |
setProxyHost(String proxyHost)
Set/replace the optional requested proxy-host of a new connection.
|
void |
setProxyPassword(String proxyPassword)
Set/replace the optional requested proxy-password of a new connection.
|
void |
setProxyPort(int proxyPort)
Set/replace the optional requested proxy-port of a new connection.
|
void |
setProxyUserName(String proxyUserName)
Set/replace the optional requested proxy-username of a new connection.
|
void |
setService(String service)
Set/replace the optional market/service name to which the new connection
must talk.
|
void |
setTcpNoDelay(boolean noDelay)
Set the TCP_NODELAY setting.
|
void |
setUserName(String userName)
Set/replace the requested user-name of a new connection.
|
void |
setUserType(int userType)
Set/replace the user-type code of a new connection.
|
static final int USER_TYPE_TRADER
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
This and USER_TYPE_VIEW
values are the most commonly used
values.
static final int USER_TYPE_AUTOTRADER
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
USER_TYPE_TRADER
and USER_TYPE_VIEW
values are the most
commonly used values.
static final int USER_TYPE_MONITOR
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
USER_TYPE_TRADER
and USER_TYPE_VIEW
values are the most
commonly used values.
static final int USER_TYPE_VIEW
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
This and USER_TYPE_TRADER
values are the most commonly used
values.
static final int USER_TYPE_CONTROLLER
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
USER_TYPE_TRADER
and USER_TYPE_VIEW
values are the most
commonly used values.
static final int USER_TYPE_MASTERSLAVE
This value may be set with setUserType(int)
and retrieved by
getUserType()
.
USER_TYPE_TRADER
and USER_TYPE_VIEW
values are the most
commonly used values.
static final int CONN_TYPE_TCP
This value may be set with setConnType(int)
and retrieved by
getConnType()
.
static final int CONN_TYPE_HTTP_TUNNEL
This value may be set with setConnType(int)
and retrieved by
getConnType()
.
static final int CONN_TYPE_SOCKS4A
This value may be set with setConnType(int)
and retrieved by
getConnType()
.
static final int CONN_TYPE_SOCKS5
This value may be set with setConnType(int)
and retrieved by
getConnType()
.
String getHost()
The pair given by this value together with getPort()
describe the
server to which the client must talk.
Connection.open()
null
getHost() != null && getHost().length > 0
who sets this value
,
if you want to use YAS service to find the less loaded
service
int getPort()
The pair given by getHost()
together with this value describe the
server to which the client must talk.
Connection.open()
getPort() > 0
who sets this value
String getAlternativeHost()
The optional pair given by this value together with
getAlternativePort()
describe another server to which the client
must talk in the case the first attempt to the principal server (pair
getHost()
together with getPort()
) failed.
Connection.open()
null
getAlternativeHost() == null
|| getAlternativeHost().length > 0 && getAlternativePort()
> 0
who sets this value
int getAlternativePort()
The optional pair given by getAlternativeHost()
together with this
value describe another server to which the client must talk in the case
the first attempt to the principal server (pair getHost()
together
with getPort()
) failed.
Connection.open()
getAlternativePort == 0
|| getAlternativePort() > 0
&& getAlternativeHost()
!= null
&& getAlternativeHost()
.length > 0
who sets this value
int[] getConnType()
The connection-transport code of a connection describe the transport used on that connection. Possible values are:
CONN_TYPE_TCP
to use the classic TCP/IP transport,
CONN_TYPE_HTTP_TUNNEL
to use a tunnel over HTTP transport,
e.g. used in applet inside HTML pages, or else used to bypass firewall,
CONN_TYPE_SOCKS4A
to use a socks version 4a proxy,
CONN_TYPE_SOCKS5
to use a socks version 5 proxy,
getProxyHost()
together with
getProxyPort()
must be defined.
Connection.open()
CONN_TYPE_TCP
getConnType() == CONN_TYPE_TCP
|| getConnType() == CONN_TYPE_HTTP_TUNNEL
|| getConnType() == CONN_TYPE_SOCKS4A
|| getConnType() == CONN_TYPE_SOCKS5
who sets this value
String getProxyHost()
The optional pair given by this value together with getProxyPort()
describe the proxy used when a non-CONN_TYPE_TCP
connection-transport is used.
Connection.open()
null
getProxyHost() == null
|| getConnType()
!= CONN_TYPE_TCP
&& getProxyHost().length > 0
&& getProxyPort()
> 0
who sets this value
int getProxyPort()
The optional pair given by getProxyHost()
together with this value
describe the proxy used when a non-CONN_TYPE_TCP
connection-transport is used.
Connection.open()
getProxyPort == 0
|| getConnType()
!= CONN_TYPE_TCP
&& getProxyPort() > 0
&& getProxyHost()
!= null
&& getProxyHost()
.length > 0
who sets this value
String getProxyUserName()
Connection.open()
getProxyPort == 0
|| getConnType()
!= CONN_TYPE_TCP
&& getProxyPort() > 0
&& getProxyHost()
!= null
&& getProxyHost()
.length > 0
who sets this value
,
who sets proxy-password
boolean getCompression()
A true
values indicates that the transmission between the
client and the server for this connection must be compressed to save
bandwidth.
Connection.open()
false
true // any value
who sets this value
String getCharSet()
Every time a String
goes from the client to server it's
coded as a bytes-sequence
using the given charset. The behavior of this transformation when the
string cannot be encoded in the given charset is unspecified.
Every time a bytes-sequence goes from the server to the client it's decoded into a String using the given charset. The behavior of this transformation when the given bytes are not valid in the given charset is unspecified.
Please note that the default-value is determined at run-time as "ISO-8859-15" or else "ISO-8859-1" depending on the Java platform on which the clients run:
Please see ISO Latin 9 as compared with ISO Latin 1 to check all differences between the two charsets.
Connection.open()
"ISO-8859-15"
ISO-LATIN-9, if supported by the Java
platform on which the client runs, "ISO-8859-1"
ISO-LATIN-1, otherwise.
getCharSet() != null
&& getCharSet().length > 0
&& new String("Hello World").getBytes(getCharSet()) != null // i.e. no exception thrown
who sets this value
String getService()
Connection.open()
null
getService() == null || getService.length > 0
who sets this value
int getUserType()
The user-type code of a connection describe the activities that can be made on that connection. Possible values are:
USER_TYPE_TRADER
to send transactions on the connection,
USER_TYPE_AUTOTRADER
to send transactions on the
connection,
USER_TYPE_MONITOR
to request data (subscription and/or
queries) on the connection,
USER_TYPE_VIEW
to request data (subscription and/or
queries) on the connection,
USER_TYPE_CONTROLLER
to use in a specially way (not
described here) the connection,
USER_TYPE_MASTERSLAVE
to use in a specially way (not
described here) the connection.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_USERTYPE
failure-code if it does not comply with this value.
Connection.open()
USER_TYPE_VIEW
getUserType() == USER_TYPE_TRADER
|| getUserType() == USER_TYPE_AUTOTRADER
|| getUserType() == USER_TYPE_MONITOR
|| getUserType() == USER_TYPE_VIEW
|| getUserType() == USER_TYPE_CONTROLLER
|| getUserType() == USER_TYPE_MASTERSLAVE
who sets this value
String getUserName()
The pair given by this value together with getPassword()
describe
the user associated to the new connection.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_USERNAME
failure-code if it does not comply with this value.
Connection.open()
null
getUserName() != null && getUserName().length > 0
who sets this value
String getPassword()
The pair given by getUserName()
together with this value describe
the user associated to the new connection.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_PASSWORD
failure-code if it does not comply with this value.
Connection.open()
null
getPassword() != null && getPassword().length > 0
who sets this value
int getClientID()
The ClientID is a positive number that uniquely identifies the client.
This number is automatically used on TransactionID
s of all
Transaction
s sent on this connection.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_CLIENTID
failure-code if it does not comply with this value.
Connection.open()
getClientID() > 0
who sets this value
int[] getApplRevision()
A version is always represented by a three-dimensional array; e.g. the
version 2.0.3 is represented by:
int[] version = {2, 0, 3};
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_REVISION
failure-code if it does not comply with this value.
Connection.open()
{0,0,0}
getApplRevision() != null && getApplRevision().length == 3
&& getApplRevision()[0] >= 0 && getApplRevision()[0] <= 255
&& getApplRevision()[1] >= 0 && getApplRevision()[1] <= 255
&& getApplRevision()[2] >= 0 && getApplRevision()[2] <= 255
who sets this value
int getApplSignature()
A signature is a non-negative number, that may be be required by the service (on the server) that manages the market.
Connection.open()
0
getApplSignature() >= 0
who sets this value
String getAuthKey()
An authorization key (normally given by List S.p.a. in an authorization file is a key that allow the client to open and use successfully a connection with a given server.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_AUTH_KEY
failure-code if it does not comply with this value.
Connection.open()
null
getAuthKey == null
|| getAuthFile()
== null && getAuthKey().length > 0
who sets this value
File getAuthFile()
An authorization file, given by List S.p.a., contains a key that allow the client to open and use successfully a connection with a given server.
The server may subsequently returns a
ConnectionOpenEvent.RESULT_INVALID_AUTH_KEY
failure-code if it does not comply with the authorization key.
Connection.open()
null
getAuthFile() == null
|| getAuthKey()
== null && getAuthFile().canRead()
who sets this value
boolean getTcpNoDelay()
A true
values indicates that Nagle's algorithm is disabled.
Connection.open()
true
true // any value
who sets this value
void setHost(String host) throws IllegalStateException
host
- the requested server-host of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setPort(int port) throws IllegalStateException
port
- the requested server-port of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setAlternativeHost(String alternativeHost) throws IllegalStateException
alternativeHost
- the optional alternative requested server-host of a new
connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their
meaning
void setAlternativePort(int alternativePort) throws IllegalStateException
alternativePort
- the optional alternative requested server-port of a new
connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their
meaning
void setConnType(int connType) throws IllegalStateException
connType
- the connection-transport code of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setConnType(int[] connType) throws IllegalStateException
connType
- array of the connection-transport code of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setProxyHost(String proxyHost) throws IllegalStateException
proxyHost
- the optional requested proxy-host of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setProxyPort(int proxyPort) throws IllegalStateException
proxyPort
- the optional requested proxy-port of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setProxyUserName(String proxyUserName)
proxyUserName
- the optional requested proxy-username of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their
meaning
void setProxyPassword(String proxyPassword)
proxyPassword
- the optional requested proxy-password of a new connection.IllegalStateException
- if this container is already bound.void setCompression(boolean enable) throws IllegalStateException
enable
- the requested indication about a compressed transmission for a
new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setCharSet(String charSet) throws IllegalStateException
charSet
- the String that represents the charset
used to code/decode the strings on the new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setService(String service) throws IllegalStateException
If you set the service, you ask to YAS service (identified by host and port parameters) to establish a connection with the less-loaded service.
You can specifies the double services connection required by ASIA platform using "|" (pipe) character as the separator of the public and private service name, for example: "PUBLMETAMARKET|PRIVMETAMARKET"
service
- the optional market/service name to which the new connection
must talk.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setUserType(int userType) throws IllegalStateException
userType
- the user-type code of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setUserName(String userName) throws IllegalStateException
userName
- the requested user-name of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setPassword(String password) throws IllegalStateException
password
- the requested user-password of a new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setClientID(int clientID) throws IllegalStateException
clientID
- the ClientID for the new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setApplRevision(int[] applRevision) throws IllegalStateException
applRevision
- the client version for the new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setApplSignature(int applSignature) throws IllegalStateException
applSignature
- the client signature for the new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their
meaning
void setAuthKey(String key) throws IllegalStateException
key
- the authorization key for the new connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setAuthFile(File file) throws IllegalStateException
file
- the File that contains an authorization key for the new
connection.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
void setTcpNoDelay(boolean noDelay) throws IllegalStateException
noDelay
- false to disable TCP_NODELAY (enable Nagle's algorithm),
true to enable.IllegalStateException
- if this container is already bound.default/current/acceptable values and their meaning
Submit a bug or feature to FT\API Programming Support