Platform SDK Java 8.5 API Reference

com.genesyslab.platform.voice.protocol.runtime
Class HAConnection

java.lang.Object
  extended by com.genesyslab.platform.commons.connection.impl.AbstractConnection
      extended by com.genesyslab.platform.voice.protocol.runtime.HAConnection
All Implemented Interfaces:
Connection, LogMessageFilterSupport

public class HAConnection
extends com.genesyslab.platform.commons.connection.impl.AbstractConnection
implements LogMessageFilterSupport

Please note, that unlike TLib 7.1 this connection doesn't waitResponse primary connection and link status inside open(). So, if you call write() before "opened" event has come then you're on your own.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.genesyslab.platform.commons.connection.impl.AbstractConnection
com.genesyslab.platform.commons.connection.impl.AbstractConnection.CloseCommand
 
Field Summary
 
Fields inherited from class com.genesyslab.platform.commons.connection.impl.AbstractConnection
_syncConfig, address, connHandler, host, port
 
Fields inherited from interface com.genesyslab.platform.commons.connection.Connection
BACKUP_BIND_PORT_KEY, BIND_HOST_KEY, BIND_PORT_KEY, CONNECTION_TIMEOUT_KEY, DEFAULT_ENABLE_IPV6, DEFAULT_IP_VERSION, DEFAULT_OPERATION_TIMEOUT, ENABLE_IPV6_KEY, IP_VERSION_4_6, IP_VERSION_6_4, IP_VERSION_KEY, KEEP_ALIVE_KEY, LAZY_PARSING_ENABLED_KEY, OPERATION_TIMEOUT_KEY, REUSE_ADDRESS_KEY, SSL_KEYSTORE_PASS, SSL_KEYSTORE_PATH_KEY, STR_ATTR_ENCODING_NAME_KEY, TLS_KEY, TLS_VERSION_KEY
 
Constructor Summary
HAConnection(ConnectionSettings connectionSettings, java.lang.Object proxySync)
           
 
Method Summary
 void configure(ConnectionConfiguration config)
          Configures or reconfigures this connection's additional parameters.
protected  void doClose(java.lang.Throwable closeReason)
           
 void forceClose(java.lang.Throwable reason)
           
 TServerConnContext getHAConnectionContext()
           
 com.genesyslab.platform.commons.connection.interceptor.Interceptor getInterceptor()
          Returns interceptor of this connection.
 java.net.InetSocketAddress getLocalEndPoint()
          Gets current local InetSocketAddress of socket, if it is created.
 MessageFilter getLogMessageFilter()
          Gets current message logining filter.
 MessagePackager getMessagePackager()
           
 MessageTransport getMessageTransport()
           
 java.net.InetSocketAddress getRemoteEndPoint()
          Gets current remote InetSocketAddress of socket, if it is created.
 long getUnsetBytes()
          Gets amount of unsent bytes.
 boolean hasUnsetBytes()
          Checks if some unsent bytes have been ramained.
 void notifyErrorHandler(ProtocolException e)
           
 void notifyMessageHandler(Message msg)
           
 void open()
          Opens network connection to the server.
 void setConnectionState(ConnectionState state)
           
 void setInvoker(AsyncInvoker invoker)
          Connection can use invoker (if it's set) to parse messages.
 void setLogMessageFilter(MessageFilter filter)
          Sets current message logining filter.
 void setMessagePackager(MessagePackager packager)
           
 void setMessageTransport(MessageTransport transport)
           
protected  void startClose(java.lang.Throwable reason)
           
 java.lang.String toString()
           
 
Methods inherited from class com.genesyslab.platform.commons.connection.impl.AbstractConnection
close, close, context, forceClose, getConnection, getConnectionState, getExecutor, getHost, getId, getLocalBindHost, getLocalBindPort, getPort, getStringAttributesEncoding, getUri, notifyCloseHandler, notifyEstablishedHandler, registerConfigurationHandlers, setConnectionHandler, setContext, setExecutor, setLocalBindHost, setLocalBindPort, setStringAttributesEncoding, setUri, setUri, unregisterConfigurationHandlers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HAConnection

public HAConnection(ConnectionSettings connectionSettings,
                    java.lang.Object proxySync)
Method Detail

open

public void open()
Description copied from interface: Connection
Opens network connection to the server. Please note, that usually this method will return immediately and won't wait while connection is established. (connection process is asynchronous).

Specified by:
open in interface Connection
Overrides:
open in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

getRemoteEndPoint

public java.net.InetSocketAddress getRemoteEndPoint()
Gets current remote InetSocketAddress of socket, if it is created.

Specified by:
getRemoteEndPoint in interface Connection
Returns:
connection remote endpoint or null

getLocalEndPoint

public java.net.InetSocketAddress getLocalEndPoint()
Gets current local InetSocketAddress of socket, if it is created.

Specified by:
getLocalEndPoint in interface Connection
Returns:
connection local endpoint or null

configure

public void configure(ConnectionConfiguration config)
Description copied from interface: Connection
Configures or reconfigures this connection's additional parameters. (e.g. ADDP).

Specified by:
configure in interface Connection
Parameters:
config - Connection parameters

getInterceptor

public com.genesyslab.platform.commons.connection.interceptor.Interceptor getInterceptor()
Description copied from interface: Connection
Returns interceptor of this connection.

Specified by:
getInterceptor in interface Connection
Returns:
interceptor of the connection

setMessageTransport

public void setMessageTransport(MessageTransport transport)
Specified by:
setMessageTransport in interface Connection

getMessageTransport

public MessageTransport getMessageTransport()
Specified by:
getMessageTransport in interface Connection

setInvoker

public void setInvoker(AsyncInvoker invoker)
Description copied from interface: Connection
Connection can use invoker (if it's set) to parse messages. It is recommended to use the invoker if you know that it can take long to parse the message. Whether invoker will be used or not is implementation specific. For instance it seems a good idea to set some kind of thread pool as invoker for some busy connection, but you can break the order of message arrival by doing so.

Specified by:
setInvoker in interface Connection
Parameters:
invoker - async invoker

setMessagePackager

public void setMessagePackager(MessagePackager packager)
Specified by:
setMessagePackager in interface Connection

getMessagePackager

public MessagePackager getMessagePackager()
Specified by:
getMessagePackager in interface Connection

setConnectionState

public void setConnectionState(ConnectionState state)
Overrides:
setConnectionState in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

notifyMessageHandler

public void notifyMessageHandler(Message msg)

notifyErrorHandler

public void notifyErrorHandler(ProtocolException e)

getHAConnectionContext

public TServerConnContext getHAConnectionContext()

getLogMessageFilter

public MessageFilter getLogMessageFilter()
Description copied from interface: LogMessageFilterSupport
Gets current message logining filter.

Specified by:
getLogMessageFilter in interface LogMessageFilterSupport
Returns:
current message logining filter.

setLogMessageFilter

public void setLogMessageFilter(MessageFilter filter)
Description copied from interface: LogMessageFilterSupport
Sets current message logining filter.

Specified by:
setLogMessageFilter in interface LogMessageFilterSupport
Parameters:
filter - new message logining filter.

toString

public java.lang.String toString()
Overrides:
toString in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

startClose

protected void startClose(java.lang.Throwable reason)
Specified by:
startClose in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

forceClose

public void forceClose(java.lang.Throwable reason)
Overrides:
forceClose in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

doClose

protected void doClose(java.lang.Throwable closeReason)
Overrides:
doClose in class com.genesyslab.platform.commons.connection.impl.AbstractConnection

hasUnsetBytes

public boolean hasUnsetBytes()
Description copied from interface: Connection
Checks if some unsent bytes have been ramained.

Specified by:
hasUnsetBytes in interface Connection
Overrides:
hasUnsetBytes in class com.genesyslab.platform.commons.connection.impl.AbstractConnection
Returns:
true if some unsent bytes have been ramained.

getUnsetBytes

public long getUnsetBytes()
Description copied from interface: Connection
Gets amount of unsent bytes.

Specified by:
getUnsetBytes in interface Connection
Overrides:
getUnsetBytes in class com.genesyslab.platform.commons.connection.impl.AbstractConnection
Returns:
amount of unsent bytes.

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.