public class TLSClientConnection extends Object implements IConnection
Constructor and Description |
---|
TLSClientConnection(Configuration config,
Configuration localPeerSSLConfig,
IConcurrentFactory concurrentFactory,
Socket socket,
IMessageParser parser) |
TLSClientConnection(Configuration config,
IConcurrentFactory concurrentFactory,
InetAddress remoteAddress,
int remotePort,
InetAddress localAddress,
int localPort,
IConnectionListener listener,
IMessageParser parser,
String ref) |
TLSClientConnection(Configuration config,
IConcurrentFactory concurrentFactory,
InetAddress remoteAddress,
int remotePort,
InetAddress localAddress,
int localPort,
IMessageParser parser,
String ref) |
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 TLSTransportClient |
getClient() |
long |
getCreatedTime()
Return created time
|
String |
getKey()
Return identifier of connection.
|
InetAddress |
getRemoteAddress()
Return remote host address
|
int |
getRemotePort()
Return remote socket port
|
Configuration |
getSSLConfig() |
SSLSocketFactory |
getSSLFactory() |
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.tls.TLSClientConnection.Event event) |
protected void |
onMessageReceived(IMessage message) |
protected boolean |
processBufferedMessages(org.jdiameter.client.impl.transport.tls.TLSClientConnection.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) |
public TLSClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IMessageParser parser, String ref)
public TLSClientConnection(Configuration config, IConcurrentFactory concurrentFactory, InetAddress remoteAddress, int remotePort, InetAddress localAddress, int localPort, IConnectionListener listener, IMessageParser parser, String ref)
public TLSClientConnection(Configuration config, Configuration localPeerSSLConfig, IConcurrentFactory concurrentFactory, Socket socket, IMessageParser parser) throws Exception
Exception
protected TLSTransportClient getClient()
public Configuration getSSLConfig()
public SSLSocketFactory getSSLFactory()
public long getCreatedTime()
IConnection
getCreatedTime
in interface IConnection
public InetAddress getRemoteAddress()
IConnection
getRemoteAddress
in interface IConnection
public int getRemotePort()
IConnection
getRemotePort
in interface IConnection
public void addConnectionListener(IConnectionListener listener)
IConnection
addConnectionListener
in interface IConnection
listener
- listener instancepublic void remAllConnectionListener()
IConnection
remAllConnectionListener
in interface IConnection
public void remConnectionListener(IConnectionListener listener)
IConnection
remConnectionListener
in interface IConnection
listener
- listener instancepublic void release() throws IOException
IConnection
release
in interface IConnection
IOException
public boolean isWrapperFor(Class<?> aClass) throws InternalException
isWrapperFor
in interface Wrapper
InternalException
public <T> T unwrap(Class<T> aClass) throws InternalException
unwrap
in interface Wrapper
InternalException
public boolean isConnected()
IConnection
isConnected
in interface IConnection
public boolean isNetworkInitiated()
IConnection
isNetworkInitiated
in interface IConnection
public String getKey()
IConnection
getKey
in interface IConnection
public void connect() throws TransportException
IConnection
connect
in interface IConnection
TransportException
public void disconnect() throws InternalError
IConnection
disconnect
in interface IConnection
InternalError
public void sendMessage(IMessage message) throws TransportException, OverloadException
IConnection
sendMessage
in interface IConnection
message
- diameter messageTransportException
OverloadException
protected void onDisconnect() throws AvpDataException
AvpDataException
protected void onMessageReceived(IMessage message) throws AvpDataException
AvpDataException
protected void onAvpDataException(AvpDataException e)
protected void onConnected()
protected void onEvent(org.jdiameter.client.impl.transport.tls.TLSClientConnection.Event event) throws AvpDataException
AvpDataException
protected boolean processBufferedMessages(org.jdiameter.client.impl.transport.tls.TLSClientConnection.Event event) throws AvpDataException
AvpDataException
Copyright © 2016. All Rights Reserved.