Platform SDK Java 8.5 API Reference

com.genesyslab.platform.commons.protocol
Class Endpoint

java.lang.Object
  extended by com.genesyslab.platform.commons.protocol.Endpoint
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
WildcardEndpoint

public class Endpoint
extends java.lang.Object
implements java.lang.Cloneable

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.

Example of connection configuration initialization:

   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

hasName

protected boolean hasName

name

protected java.lang.String name

host

protected java.lang.String host

port

protected int port

sslContext

protected javax.net.ssl.SSLContext sslContext

sslOptions

protected SSLExtendedOptions sslOptions

spn

protected volatile java.lang.String spn

connConfig

protected ManagedConfiguration connConfig

tostringPrefix

protected java.lang.String tostringPrefix

defaultPrefix

protected static final java.lang.String defaultPrefix
See Also:
Constant Field Values
Constructor Detail

Endpoint

public Endpoint(java.lang.String host,
                int port)
Creates Endpoint.

Parameters:
host - connection target host name or IP address
port - TCP/IP port number

Endpoint

public Endpoint(java.lang.String name,
                java.lang.String host,
                int port)
Creates Endpoint.

Parameters:
name - name of the endpoint
host - connection target host name or IP address
port - TCP/IP port number

Endpoint

public 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.

Parameters:
host - connection target host name or IP address
port - TCP/IP port number
connConf - connection configuration properties

Endpoint

public 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.

Parameters:
name - name of the endpoint
host - connection target host name or IP address
port - TCP/IP port number
connConf - connection configuration properties

Endpoint

public 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.

Parameters:
host - connection target host name or IP address
port - TCP/IP port number
connConf - 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 protocol
sslContext - TLS configuration to be used with this Endpoint. Can be null.
sslOptions - Additional TLS options to be used with this Endpoint. Can be null.

Endpoint

public 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.

Parameters:
name - name of the endpoint
host - connection target host name or IP address
port - TCP/IP port number
connConf - 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 protocol
sslContext - TLS configuration to be used with this Endpoint. Can be null.
sslOptions - Additional TLS options to be used with this Endpoint. Can be null.

Endpoint

public Endpoint(java.net.URI uri)
Creates Endpoint using information from URI. 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

Parameters:
uri - URI to construct Endpoint from

Endpoint

public 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

Parameters:
uri - URI to construct Endpoint from
tlsEnabled - if true, TLS will be started immediately upon connection; if false, TLS is only started by request from protocol
sslContext - TLS configuration to be used with this Endpoint. Can be null.
sslOptions - Additional TLS options to be used with this Endpoint. Can be null.

Endpoint

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

Parameters:
name - protocol name
uri - URI to construct Endpoint from

Endpoint

public 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

Parameters:
name - protocol name
uri - URI to construct Endpoint from
tlsEnabled - if true, TLS will be started immediately upon connection; if false, TLS is only started by request from protocol
sslContext - TLS configuration to be used with this Endpoint. Can be null.
sslOptions - Additional TLS options to be used with this Endpoint. Can be null.

Endpoint

public 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).

Parameters:
name - name of the connection endpoint.
connConf - connection configuration parameters.

Endpoint

protected Endpoint(java.lang.String name)
Method Detail

validatePort

protected void validatePort(int port)

hasName

public boolean hasName()

getName

public java.lang.String getName()

getHost

public java.lang.String getHost()

getPort

public int getPort()

getUri

public java.net.URI getUri()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getConfiguration

public ConnectionConfiguration getConfiguration()
Returns configuration object clone. It can be parsed from query string of Endpoint created with URI or can be initially passed to Endpoint constructor.

Returns:
configuration object or null

getSSLOptions

public SSLExtendedOptions getSSLOptions()
Returns:
Extended SSL options to be used with this Endpoint

getSSLContext

public javax.net.ssl.SSLContext getSSLContext()
Returns:
SSLContext instance to be used with this Endpoint

setEndpointName

protected void setEndpointName(java.lang.String name,
                               java.lang.String host,
                               int port)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

setSPN

public Endpoint setSPN(java.lang.String SPN)
Sets service principal name.

Parameters:
SPN - service principal name.
Returns:
this

getSPN

public java.lang.String getSPN()
Gets service principal name.

Returns:
service principal name or null if not assigned
See Also:
#setSPN(String)}

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.