org.jdiameter.client.api.io
Interface IConnection

All Superinterfaces:
Wrapper
All Known Implementing Classes:
SCTPClientConnection, SCTPServerConnection, TCPClientConnection, TLSClientConnection

public interface IConnection
extends Wrapper

A Connection with a remote host.

Author:
erick.svenson@yahoo.com, Alexandre Mendonca , Bartosz Baranowski

Method Summary
 void addConnectionListener(IConnectionListener connectionListener)
          Append connection listener
 void connect()
          Connect with remote host
 void disconnect()
          Disconnect wit remote host
 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
 void release()
          Clear all attachec resources (close socket)
 void remAllConnectionListener()
          Remove all connection listeners
 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

getCreatedTime

long getCreatedTime()
Return created time

Returns:
created time

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,
                        OverloadException
Send message to remote host

Parameters:
message - diameter message
Throws:
TransportException
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

remAllConnectionListener

void remAllConnectionListener()
Remove all connection listeners


remConnectionListener

void remConnectionListener(IConnectionListener connectionListener)
Remove connection listener

Parameters:
connectionListener - listener instance


Copyright © 2014. All Rights Reserved.