|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Connection
Allows for direct communication with a server using TCP/IP. This low-level
connection is encapsulated by the Channel
classes, such as
ClientChannel
.
The Channel
classes present a message-based interface to your
applications.
Field Summary | |
---|---|
static java.lang.String |
BACKUP_BIND_PORT_KEY
Constant for ConnectionConfiguration that specifies port from which connection should be made (bind to) for backup server. |
static java.lang.String |
BIND_HOST_KEY
Constant for ConnectionConfiguration that specifies host from which connection should be made (bind to). |
static java.lang.String |
BIND_PORT_KEY
Constant for ConnectionConfiguration that specifies port from which connection should be made (bind to). |
static java.lang.String |
CONNECTION_TIMEOUT_KEY
Integer value. |
static java.lang.String |
DEFAULT_ENABLE_IPV6
|
static java.lang.String |
DEFAULT_IP_VERSION
|
static int |
DEFAULT_OPERATION_TIMEOUT
|
static java.lang.String |
ENABLE_IPV6_KEY
Turns IPv6 support on/off. |
static java.lang.String |
IP_VERSION_4_6
|
static java.lang.String |
IP_VERSION_6_4
|
static java.lang.String |
IP_VERSION_KEY
Constant for ConnectionConfiguration to specify order in which connection attempts will be made to IPv6 and IPv4 addresses. |
static java.lang.String |
KEEP_ALIVE_KEY
Boolean value. |
static java.lang.String |
LAZY_PARSING_ENABLED_KEY
Optional. |
static java.lang.String |
OPERATION_TIMEOUT_KEY
Integer value. |
static java.lang.String |
REUSE_ADDRESS_KEY
Boolean value. |
static java.lang.String |
SSL_KEYSTORE_PASS
Deprecated. Key store password is supported via callback handler |
static java.lang.String |
SSL_KEYSTORE_PATH_KEY
Deprecated. Use tls-cert and tls-key options |
static java.lang.String |
STR_ATTR_ENCODING_NAME_KEY
Constant for ConnectionConfiguration that specifies encoding for string attributes. |
static java.lang.String |
TLS_KEY
Constant for ConnectionConfiguration that specifies whether connection should be secured with TLS. |
static java.lang.String |
TLS_VERSION_KEY
Deprecated. |
Method Summary | |
---|---|
void |
close()
Closes connection to the server. |
void |
configure(ConnectionConfiguration config)
Configures or reconfigures this connection's additional parameters. |
void |
forceClose()
Closes the connection without waiting for pending messages. |
ConnectionState |
getConnectionState()
Returns connection state of this connection. |
java.lang.String |
getHost()
Gets host of the connection. |
long |
getId()
Gets the connection id. |
com.genesyslab.platform.commons.connection.interceptor.Interceptor |
getInterceptor()
Returns interceptor of this connection. |
java.lang.String |
getLocalBindHost()
Gets the local bind host assigned by setLocalBindHost(String) . |
java.lang.Integer |
getLocalBindPort()
Gets the local bind port assigned by setLocalBindPort(Integer) . |
java.net.InetSocketAddress |
getLocalEndPoint()
Gets current local InetSocketAddress of socket, if it is created. |
MessagePackager |
getMessagePackager()
|
MessageTransport |
getMessageTransport()
|
int |
getPort()
Gets port of the connection. |
java.net.InetSocketAddress |
getRemoteEndPoint()
Gets current remote InetSocketAddress of socket, if it is created. |
long |
getUnsetBytes()
Gets amount of unsent bytes. |
java.lang.String |
getUri()
Gets address of the connection. |
boolean |
hasUnsetBytes()
Checks if some unsent bytes have been ramained. |
void |
open()
Opens network connection to the server. |
void |
setConnectionHandler(ConnectionHandler connectionHandler)
Sets connection handler to receive notifications about connection events. |
void |
setContext(ConnectionContext ctx)
Sets the connection context. |
void |
setInvoker(AsyncInvoker invoker)
Connection can use invoker (if it's set) to parse messages. |
void |
setLocalBindHost(java.lang.String host)
Sets the local bind host which is used when the connection is getting opened. |
void |
setLocalBindPort(java.lang.Integer port)
Sets the local bind port which is used when the connection is getting opened. |
void |
setMessagePackager(MessagePackager packager)
|
void |
setMessageTransport(MessageTransport transport)
|
Field Detail |
---|
static final java.lang.String BIND_HOST_KEY
static final java.lang.String BIND_PORT_KEY
static final java.lang.String BACKUP_BIND_PORT_KEY
static final java.lang.String OPERATION_TIMEOUT_KEY
static final int DEFAULT_OPERATION_TIMEOUT
static final java.lang.String CONNECTION_TIMEOUT_KEY
static final java.lang.String REUSE_ADDRESS_KEY
static final java.lang.String KEEP_ALIVE_KEY
static final java.lang.String ENABLE_IPV6_KEY
static final java.lang.String DEFAULT_ENABLE_IPV6
static final java.lang.String IP_VERSION_KEY
static final java.lang.String IP_VERSION_4_6
static final java.lang.String IP_VERSION_6_4
static final java.lang.String DEFAULT_IP_VERSION
static final java.lang.String STR_ATTR_ENCODING_NAME_KEY
@Deprecated static final java.lang.String TLS_VERSION_KEY
static final java.lang.String TLS_KEY
ConnectionContext
class.
static final java.lang.String SSL_KEYSTORE_PATH_KEY
keytool -genkey -keysize 512 -validity 3650
-keyalg RSA -dname "CN=somename.com, OU=XXX CA, O=SomeName Inc, L=Kyiv, S=Kyiv, C=UA"
-keypass somepass -storepass somepass -keystore storename.cert
SSL_KEYSTORE_PASS
,
Constant Field Valuesstatic final java.lang.String SSL_KEYSTORE_PASS
SSL_KEYSTORE_PATH_KEY
,
Constant Field Valuesstatic final java.lang.String LAZY_PARSING_ENABLED_KEY
Method Detail |
---|
void open()
void close()
void forceClose()
ConnectionState getConnectionState()
java.lang.String getUri()
java.lang.String getHost()
int getPort()
void setConnectionHandler(ConnectionHandler connectionHandler)
connectionHandler
- connection handler implementationvoid configure(ConnectionConfiguration config)
config
- Connection parametersvoid setContext(ConnectionContext ctx)
ctx
- connection contextcom.genesyslab.platform.commons.connection.interceptor.Interceptor getInterceptor()
void setMessagePackager(MessagePackager packager)
MessagePackager getMessagePackager()
void setMessageTransport(MessageTransport transport)
MessageTransport getMessageTransport()
void setInvoker(AsyncInvoker invoker)
invoker
- async invokerjava.net.InetSocketAddress getRemoteEndPoint()
InetSocketAddress
of socket, if it is created.
java.net.InetSocketAddress getLocalEndPoint()
InetSocketAddress
of socket, if it is created.
boolean hasUnsetBytes()
long getUnsetBytes()
long getId()
java.lang.String getLocalBindHost()
setLocalBindHost(String)
.
BIND_HOST_KEY
when the connection is getting opened.
setLocalBindHost(String)
void setLocalBindHost(java.lang.String host)
BIND_HOST_KEY
when the connection is getting opened.
java.lang.Integer getLocalBindPort()
setLocalBindPort(Integer)
.
BIND_PORT_KEY
when the connection is getting opened.
setLocalBindPort(Integer)
void setLocalBindPort(java.lang.Integer port)
BIND_PORT_KEY
when the connection is getting opened.
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |