|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdiameter.client.impl.transport.tcp.TCPClientConnection
public class TCPClientConnection
| Nested Class Summary | |
|---|---|
protected static class |
TCPClientConnection.Event
|
protected static class |
TCPClientConnection.EventType
|
| Field Summary | |
|---|---|
protected java.util.concurrent.LinkedBlockingQueue<TCPClientConnection.Event> |
buffer
|
protected java.util.concurrent.ConcurrentLinkedQueue<IConnectionListener> |
listeners
|
protected java.util.concurrent.locks.Lock |
lock
|
protected IMessageParser |
parser
|
| Constructor Summary | |
|---|---|
|
TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.InetAddress remoteAddress,
int remotePort,
java.net.InetAddress localAddress,
int localPort,
IConnectionListener listener,
IMessageParser parser,
java.lang.String ref)
|
|
TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.InetAddress remoteAddress,
int remotePort,
java.net.InetAddress localAddress,
int localPort,
IMessageParser parser,
java.lang.String ref)
|
|
TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.Socket socket,
IMessageParser parser,
java.lang.String ref)
|
protected |
TCPClientConnection(IConcurrentFactory concurrentFactory,
IMessageParser parser)
|
| Method Summary | ||
|---|---|---|
void |
addConnectionListener(IConnectionListener listener)
Append connection listener |
|
void |
connect()
Connect with remote host |
|
void |
disconnect()
Disconnect wit remote host |
|
protected org.jdiameter.client.impl.transport.tcp.TCPTransportClient |
getClient()
|
|
long |
getCreatedTime()
Return created time |
|
java.lang.String |
getKey()
Return identifier of connection. |
|
java.net.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(java.lang.Class<?> aClass)
|
|
protected void |
onAvpDataException(org.jdiameter.api.AvpDataException e)
|
|
protected void |
onConnected()
|
|
protected void |
onDisconnect()
|
|
protected void |
onEvent(TCPClientConnection.Event event)
|
|
protected void |
onMessageReveived(java.nio.ByteBuffer message)
|
|
protected boolean |
processBufferedMessages(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 |
|
|
unwrap(java.lang.Class<T> aClass)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.concurrent.LinkedBlockingQueue<TCPClientConnection.Event> buffer
protected IMessageParser parser
protected java.util.concurrent.locks.Lock lock
protected java.util.concurrent.ConcurrentLinkedQueue<IConnectionListener> listeners
| Constructor Detail |
|---|
protected TCPClientConnection(IConcurrentFactory concurrentFactory,
IMessageParser parser)
public TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.Socket socket,
IMessageParser parser,
java.lang.String ref)
throws java.lang.Exception
java.lang.Exception
public TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.InetAddress remoteAddress,
int remotePort,
java.net.InetAddress localAddress,
int localPort,
IMessageParser parser,
java.lang.String ref)
public TCPClientConnection(org.jdiameter.api.Configuration config,
IConcurrentFactory concurrentFactory,
java.net.InetAddress remoteAddress,
int remotePort,
java.net.InetAddress localAddress,
int localPort,
IConnectionListener listener,
IMessageParser parser,
java.lang.String ref)
| Method Detail |
|---|
public long getCreatedTime()
IConnection
getCreatedTime in interface IConnection
public void connect()
throws TransportException
IConnection
connect in interface IConnectionTransportException
public void disconnect()
throws java.lang.InternalError
IConnection
disconnect in interface IConnectionjava.lang.InternalError
public void release()
throws java.io.IOException
IConnection
release in interface IConnectionjava.io.IOException
public void sendMessage(IMessage message)
throws TransportException,
org.jdiameter.api.OverloadException
IConnection
sendMessage in interface IConnectionmessage - diameter message
TransportException
org.jdiameter.api.OverloadExceptionprotected org.jdiameter.client.impl.transport.tcp.TCPTransportClient getClient()
public boolean isNetworkInitiated()
IConnection
isNetworkInitiated in interface IConnectionpublic boolean isConnected()
IConnection
isConnected in interface IConnectionpublic java.net.InetAddress getRemoteAddress()
IConnection
getRemoteAddress in interface IConnectionpublic int getRemotePort()
IConnection
getRemotePort in interface IConnectionpublic void addConnectionListener(IConnectionListener listener)
IConnection
addConnectionListener in interface IConnectionlistener - listener instancepublic void remAllConnectionListener()
IConnection
remAllConnectionListener in interface IConnectionpublic void remConnectionListener(IConnectionListener listener)
IConnection
remConnectionListener in interface IConnectionlistener - listener instance
public boolean isWrapperFor(java.lang.Class<?> aClass)
throws org.jdiameter.api.InternalException
isWrapperFor in interface org.jdiameter.api.Wrapperorg.jdiameter.api.InternalException
public <T> T unwrap(java.lang.Class<T> aClass)
throws org.jdiameter.api.InternalException
unwrap in interface org.jdiameter.api.Wrapperorg.jdiameter.api.InternalExceptionpublic java.lang.String getKey()
IConnection
getKey in interface IConnection
protected void onDisconnect()
throws org.jdiameter.api.AvpDataException
org.jdiameter.api.AvpDataException
protected void onMessageReveived(java.nio.ByteBuffer message)
throws org.jdiameter.api.AvpDataException
org.jdiameter.api.AvpDataExceptionprotected void onAvpDataException(org.jdiameter.api.AvpDataException e)
protected void onConnected()
protected void onEvent(TCPClientConnection.Event event)
throws org.jdiameter.api.AvpDataException
org.jdiameter.api.AvpDataException
protected boolean processBufferedMessages(TCPClientConnection.Event event)
throws org.jdiameter.api.AvpDataException
org.jdiameter.api.AvpDataException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||