|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.protocol.Endpoint
public class Endpoint
You can use an Endpoint
to describe a server that
your application will be communicating with, by giving the server's
name, host, port, and optionally connection configuration.
PropertyConfiguration conf = new PropertyConfiguration();
conf.setStringsEncoding("windows-1252");
conf.setUseAddp(true);
conf.setAddpClientTimeout(11);
conf.setAddpServerTimeout(12);
conf.setAddpTrace("both");
ConfServerProtocol protocol = new ConfServerProtocol(
new Endpoint("default", HOST, PORT, conf));
protocol.setUserName(username);
protocol.setUserPassword(password);
protocol.setClientName(applicationName);
protocol.setClientApplicationType(applicationType);
protocol.open();
or
PropertyConfiguration conf = new PropertyConfiguration();
conf.set...
protocol.setEndpoint(new Endpoint("default", HOST, PORT, conf)));
protocol.open();
Field Summary | |
---|---|
protected ManagedConfiguration |
connConfig
|
protected static java.lang.String |
defaultPrefix
|
protected boolean |
hasName
|
protected java.lang.String |
host
|
protected java.lang.String |
name
|
protected int |
port
|
protected java.lang.String |
spn
|
protected javax.net.ssl.SSLContext |
sslContext
|
protected SSLExtendedOptions |
sslOptions
|
protected java.lang.String |
tostringPrefix
|
Constructor Summary | |
---|---|
protected |
Endpoint(java.lang.String name)
|
|
Endpoint(java.lang.String name,
ConnectionConfiguration connConf)
Creates "empty" Endpoint for external address resolution with custom connection target definition. It's for usage with custom socket address resolver (see SocketAddressResolver ). |
|
Endpoint(java.lang.String host,
int port)
Creates Endpoint. |
|
Endpoint(java.lang.String host,
int port,
ConnectionConfiguration connConf)
This constructor allows creation of fully configured Endpoint including connection configuration options like TLS properties, ADDP initialization parameters, channel charset encoding, etc. |
|
Endpoint(java.lang.String host,
int port,
ConnectionConfiguration connConf,
boolean tlsEnabled,
javax.net.ssl.SSLContext sslContext,
SSLExtendedOptions sslOptions)
This constructor allows creation of fully configured Endpoint including connection configuration options like ADDP initialization parameters, channel charset encoding, TLS configuration objects etc. |
|
Endpoint(java.lang.String name,
java.lang.String host,
int port)
Creates Endpoint. |
|
Endpoint(java.lang.String name,
java.lang.String host,
int port,
ConnectionConfiguration connConf)
This constructor allows creation of fully configured Endpoint including connection configuration options like TLS properties, ADDP initialization parameters, channel charset encoding, etc. |
|
Endpoint(java.lang.String name,
java.lang.String host,
int port,
ConnectionConfiguration connConf,
boolean tlsEnabled,
javax.net.ssl.SSLContext sslContext,
SSLExtendedOptions sslOptions)
This constructor allows creation of fully configured Endpoint including connection configuration options like ADDP initialization parameters, channel charset encoding, TLS configuration objects etc. |
|
Endpoint(java.lang.String name,
java.net.URI uri)
Creates Endpoint using information from URI. |
|
Endpoint(java.lang.String name,
java.net.URI uri,
boolean tlsEnabled,
javax.net.ssl.SSLContext sslContext,
SSLExtendedOptions sslOptions)
Creates Endpoint using information from URI and additional TLS/SSL parameters. |
|
Endpoint(java.net.URI uri)
Creates Endpoint using information from URI. |
|
Endpoint(java.net.URI uri,
boolean tlsEnabled,
javax.net.ssl.SSLContext sslContext,
SSLExtendedOptions sslOptions)
Creates Endpoint using information from URI and additional TLS/SSL parameters. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
boolean |
equals(java.lang.Object obj)
|
ConnectionConfiguration |
getConfiguration()
Returns configuration object clone. |
java.lang.String |
getHost()
|
java.lang.String |
getName()
|
int |
getPort()
|
java.lang.String |
getSPN()
Gets service principal name. |
javax.net.ssl.SSLContext |
getSSLContext()
|
SSLExtendedOptions |
getSSLOptions()
|
java.net.URI |
getUri()
|
int |
hashCode()
|
boolean |
hasName()
|
protected void |
setEndpointName(java.lang.String name,
java.lang.String host,
int port)
|
Endpoint |
setSPN(java.lang.String SPN)
Sets service principal name. |
java.lang.String |
toString()
|
protected void |
validatePort(int port)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean hasName
protected java.lang.String name
protected java.lang.String host
protected int port
protected javax.net.ssl.SSLContext sslContext
protected SSLExtendedOptions sslOptions
protected volatile java.lang.String spn
protected ManagedConfiguration connConfig
protected java.lang.String tostringPrefix
protected static final java.lang.String defaultPrefix
Constructor Detail |
---|
public Endpoint(java.lang.String host, int port)
host
- connection target host name or IP addressport
- TCP/IP port numberpublic Endpoint(java.lang.String name, java.lang.String host, int port)
name
- name of the endpointhost
- connection target host name or IP addressport
- TCP/IP port numberpublic Endpoint(java.lang.String host, int port, ConnectionConfiguration connConf)
host
- connection target host name or IP addressport
- TCP/IP port numberconnConf
- connection configuration propertiespublic Endpoint(java.lang.String name, java.lang.String host, int port, ConnectionConfiguration connConf)
name
- name of the endpointhost
- connection target host name or IP addressport
- TCP/IP port numberconnConf
- connection configuration propertiespublic Endpoint(java.lang.String host, int port, ConnectionConfiguration connConf, boolean tlsEnabled, javax.net.ssl.SSLContext sslContext, SSLExtendedOptions sslOptions)
host
- connection target host name or IP addressport
- TCP/IP port numberconnConf
- Connection configuration properties. Must not be null.tlsEnabled
- if true, TLS will be started immediately upon connection;
if false, TLS is only started by request from protocolsslContext
- TLS configuration to be used with this Endpoint. Can be null.sslOptions
- Additional TLS options to be used with this Endpoint. Can be null.public Endpoint(java.lang.String name, java.lang.String host, int port, ConnectionConfiguration connConf, boolean tlsEnabled, javax.net.ssl.SSLContext sslContext, SSLExtendedOptions sslOptions)
name
- name of the endpointhost
- connection target host name or IP addressport
- TCP/IP port numberconnConf
- Connection configuration properties. Must not be null.tlsEnabled
- if true, TLS will be started immediately upon connection;
if false, TLS is only started by request from protocolsslContext
- TLS configuration to be used with this Endpoint. Can be null.sslOptions
- Additional TLS options to be used with this Endpoint. Can be null.public Endpoint(java.net.URI uri)
Example:
tcp://localVoice@localhost:5777/?protocol=addp&addp-remote-timeout=5&addp-trace=remote
uri
- URI to construct Endpoint frompublic Endpoint(java.net.URI uri, boolean tlsEnabled, javax.net.ssl.SSLContext sslContext, SSLExtendedOptions sslOptions)
Creates Endpoint using information from URI and additional TLS/SSL parameters.
Any TLS parameters present in URI are ignored.
URI is expected to have following form:
<protocol>::[<protocolName>@]<host>:<port>[/?<configKey>=<configValue>[&<configKey>=<configValue>...]]
Example:
tcp://localVoice@localhost:5777/?protocol=addp&addp-remote-timeout=5&addp-trace=remote
uri
- URI to construct Endpoint fromtlsEnabled
- if true, TLS will be started immediately upon connection;
if false, TLS is only started by request from protocolsslContext
- TLS configuration to be used with this Endpoint. Can be null.sslOptions
- Additional TLS options to be used with this Endpoint. Can be null.public Endpoint(java.lang.String name, java.net.URI uri)
Creates Endpoint using information from URI. The name part of the URI is ignored and one from parameter is used (unless parameter is null).
URI is expected to have following form:
<protocol>::[<protocolName>@]<host>:<port>[/?<configKey>=<configValue>[&<configKey>=<configValue>...]]
Example:
tcp://localVoice@localhost:5777/?protocol=addp&addp-remote-timeout=5&addp-trace=remote
name
- protocol nameuri
- URI to construct Endpoint frompublic Endpoint(java.lang.String name, java.net.URI uri, boolean tlsEnabled, javax.net.ssl.SSLContext sslContext, SSLExtendedOptions sslOptions)
Creates Endpoint using information from URI and additional TLS/SSL parameters.
The name part of the URI is ignored and one from parameter is used (unless parameter is null). Any TLS parameters present in URI are ignored.
URI is expected to have following form:
<protocol>::[<protocolName>@]<host>:<port>[/?<configKey>=<configValue>[&<configKey>=<configValue>...]]
Example:
tcp://localVoice@localhost:5777/?protocol=addp&addp-remote-timeout=5&addp-trace=remote
name
- protocol nameuri
- URI to construct Endpoint fromtlsEnabled
- if true, TLS will be started immediately upon connection;
if false, TLS is only started by request from protocolsslContext
- TLS configuration to be used with this Endpoint. Can be null.sslOptions
- Additional TLS options to be used with this Endpoint. Can be null.public Endpoint(java.lang.String name, ConnectionConfiguration connConf)
SocketAddressResolver
).
name
- name of the connection endpoint.connConf
- connection configuration parameters.protected Endpoint(java.lang.String name)
Method Detail |
---|
protected void validatePort(int port)
public boolean hasName()
public java.lang.String getName()
public java.lang.String getHost()
public int getPort()
public java.net.URI getUri()
public java.lang.String toString()
toString
in class java.lang.Object
public ConnectionConfiguration getConfiguration()
public SSLExtendedOptions getSSLOptions()
public javax.net.ssl.SSLContext getSSLContext()
protected void setEndpointName(java.lang.String name, java.lang.String host, int port)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public Endpoint setSPN(java.lang.String SPN)
SPN
- service principal name.
public java.lang.String getSPN()
#setSPN(String)}
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |