org.jdiameter.client.api.io
Interface IConnection

All Superinterfaces:
org.jdiameter.api.Wrapper
All Known Implementing Classes:
TCPClientConnection, TLSClientConnection

public interface IConnection
extends org.jdiameter.api.Wrapper

A Connection with a remote host.


Method Summary
 void addConnectionListener(IConnectionListener connectionListener)
          Append connection listener
 void connect()
          Connect with remote host
 void disconnect()
          Disconnect wit remote host
 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
 void release()
          Clear all attachec resources (close socket)
 void remConnectionListener(IConnectionListener connectionListener)
          Remove connection listener
 void sendMessage(IMessage message)
          Send message to remote host
 
Methods inherited from interface org.jdiameter.api.Wrapper
isWrapperFor, unwrap
 

Method Detail

getKey

java.lang.String getKey()
Return identifier of connection. For example: "[remote_host_name]:[remote_port]"

Returns:
identifier of connection.

connect

void connect()
             throws TransportException
Connect with remote host

Throws:
TransportException

disconnect

void disconnect()
                throws java.lang.InternalError
Disconnect wit remote host

Throws:
java.lang.InternalError

sendMessage

void sendMessage(IMessage message)
                 throws TransportException,
                        org.jdiameter.api.OverloadException
Send message to remote host

Parameters:
message - diameter message
Throws:
TransportException
org.jdiameter.api.OverloadException

release

void release()
             throws java.io.IOException
Clear all attachec resources (close socket)

Throws:
java.io.IOException

isNetworkInitiated

boolean isNetworkInitiated()
Return true if connection is incomming

Returns:
true if connection is incomming

isConnected

boolean isConnected()
Return true if is connection is valid

Returns:
true if is connection is valid

getRemoteAddress

java.net.InetAddress getRemoteAddress()
Return remote host address

Returns:
remote host address

getRemotePort

int getRemotePort()
Return remote socket port

Returns:
remote socket port

addConnectionListener

void addConnectionListener(IConnectionListener connectionListener)
Append connection listener

Parameters:
connectionListener - listener instance

remConnectionListener

void remConnectionListener(IConnectionListener connectionListener)
Remove connection listener

Parameters:
connectionListener - listener instance


Copyright © 2008. All Rights Reserved.