public class TCPClientConnection extends Object implements IConnection
| Modifier | Constructor and Description |
|---|---|
|
TCPClientConnection(Configuration config,
IConcurrentFactory concurrentFactory,
InetAddress remoteAddress,
int remotePort,
InetAddress localAddress,
int localPort,
IConnectionListener listener,
IMessageParser parser,
String ref) |
|
TCPClientConnection(Configuration config,
IConcurrentFactory concurrentFactory,
InetAddress remoteAddress,
int remotePort,
InetAddress localAddress,
int localPort,
IMessageParser parser,
String ref) |
|
TCPClientConnection(Configuration config,
IConcurrentFactory concurrentFactory,
Socket socket,
IMessageParser parser,
String ref) |
protected |
TCPClientConnection(IConcurrentFactory concurrentFactory,
IMessageParser parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(IConnectionListener listener)
Append connection listener
|
void |
connect()
Connect with remote host
|
void |
disconnect()
Disconnect wit remote host
|
protected TCPTransportClient |
getClient() |
long |
getCreatedTime()
Return created time
|
String |
getKey()
Return identifier of connection.
|
InetAddress |
getRemoteAddress()
Return remote host address
|
int |
getRemotePort()
Return remote socket port
|
boolean |
isConnected()
Return true if is connection is valid
|
boolean |
isNetworkInitiated()
Return true if connection is incomming
|
boolean |
isWrapperFor(Class<?> aClass) |
protected void |
onAvpDataException(AvpDataException e) |
protected void |
onConnected() |
protected void |
onDisconnect() |
protected void |
onEvent(org.jdiameter.client.impl.transport.tcp.TCPClientConnection.Event event) |
protected void |
onMessageReceived(ByteBuffer message) |
protected boolean |
processBufferedMessages(org.jdiameter.client.impl.transport.tcp.TCPClientConnection.Event event) |
void |
release()
Clear all attachec resources (close socket)
|
void |
remAllConnectionListener()
Remove all connection listeners
|
void |
remConnectionListener(IConnectionListener listener)
Remove connection listener
|
void |
sendMessage(IMessage message)
Send message to remote host
|
<T> T |
unwrap(Class<T> aClass) |
protected TCPClientConnection(IConcurrentFactory concurrentFactory, IMessageParser parser)
public TCPClientConnection(Configuration config, IConcurrentFactory concurrentFactory, Socket socket, IMessageParser parser, String ref) throws Exception
Exceptionpublic TCPClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IMessageParser parser, String ref)
public TCPClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IConnectionListener listener, IMessageParser parser, String ref)
public long getCreatedTime()
IConnectiongetCreatedTime in interface IConnectionpublic void connect()
throws TransportException
IConnectionconnect in interface IConnectionTransportExceptionpublic void disconnect()
throws InternalError
IConnectiondisconnect in interface IConnectionInternalErrorpublic void release()
throws IOException
IConnectionrelease in interface IConnectionIOExceptionpublic void sendMessage(IMessage message) throws TransportException, OverloadException
IConnectionsendMessage in interface IConnectionmessage - diameter messageTransportExceptionOverloadExceptionprotected TCPTransportClient getClient()
public boolean isNetworkInitiated()
IConnectionisNetworkInitiated in interface IConnectionpublic boolean isConnected()
IConnectionisConnected in interface IConnectionpublic InetAddress getRemoteAddress()
IConnectiongetRemoteAddress in interface IConnectionpublic int getRemotePort()
IConnectiongetRemotePort in interface IConnectionpublic void addConnectionListener(IConnectionListener listener)
IConnectionaddConnectionListener in interface IConnectionlistener - listener instancepublic void remAllConnectionListener()
IConnectionremAllConnectionListener in interface IConnectionpublic void remConnectionListener(IConnectionListener listener)
IConnectionremConnectionListener in interface IConnectionlistener - listener instancepublic boolean isWrapperFor(Class<?> aClass) throws InternalException
isWrapperFor in interface WrapperInternalExceptionpublic <T> T unwrap(Class<T> aClass) throws InternalException
unwrap in interface WrapperInternalExceptionpublic String getKey()
IConnectiongetKey in interface IConnectionprotected void onDisconnect()
throws AvpDataException
AvpDataExceptionprotected void onMessageReceived(ByteBuffer message) throws AvpDataException
AvpDataExceptionprotected void onAvpDataException(AvpDataException e)
protected void onConnected()
protected void onEvent(org.jdiameter.client.impl.transport.tcp.TCPClientConnection.Event event)
throws AvpDataException
AvpDataExceptionprotected boolean processBufferedMessages(org.jdiameter.client.impl.transport.tcp.TCPClientConnection.Event event)
throws AvpDataException
AvpDataExceptionCopyright © 2016. All Rights Reserved.