org.mobicents.media.server.spi
Interface Connection


public interface Connection

Author:
Yulian Oifa, amit bhayani

Method Summary
 void addListener(ConnectionListener listener)
          Adds connection state listener.
 long getBytesReceived()
          The total number of bytes received .
 long getBytesTransmitted()
          The total number of bytes transmitted.
 String getDescriptor()
          Gets the descriptor of this connection in SDP format.
 Endpoint getEndpoint()
          Gets the endpoint which executes this connection.
 int getId()
          Gets the identifier of this connection.
 boolean getIsLocal()
          Gets whether connection should be bound to local or remote interface , supported only for rtp connections.
 double getJitter()
          The average jitter value accross all media types.
 ConnectionMode getMode()
          Gets the current mode of this connection.
 long getPacketsReceived()
          The number of packets of the specified media type received .
 long getPacketsTransmitted()
          The number of packets of the specified media type transmitted.
 ConnectionState getState()
          Returns state of this connection
 String getTextualId()
          Gets the identifier of this connection.
 void removeListener(ConnectionListener listener)
          Removes connection state listener.
 void setConnectionFailureListener(ConnectionFailureListener connectionFailureListener)
          Sets connection failure listener.
 void setEndpoint(Endpoint endpoint)
          Sets the endpoint which executes this connection.
 void setIsLocal(boolean isLocal)
          Gets whether connection should be bound to local or remote interface , supported only for rtp connections.
 void setMode(ConnectionMode mode)
          Modify mode of this connection for all known media types.
 void setOtherParty(byte[] descriptor)
          Joins endpoint which executes this connection with other party.
 void setOtherParty(Connection other)
          Joins endpoint wich executes this connection with other party.
 void setOtherParty(Text descriptor)
          Joins endpoint which executes this connection with other party.
 

Method Detail

getId

int getId()
Gets the identifier of this connection.

Returns:
integer.

getTextualId

String getTextualId()
Gets the identifier of this connection.

Returns:
hex view of the integer.

getIsLocal

boolean getIsLocal()
Gets whether connection should be bound to local or remote interface , supported only for rtp connections.

Returns:
boolean value

setIsLocal

void setIsLocal(boolean isLocal)
Gets whether connection should be bound to local or remote interface , supported only for rtp connections.


getState

ConnectionState getState()
Returns state of this connection

Returns:

getMode

ConnectionMode getMode()
Gets the current mode of this connection.

Returns:
integer constant indicating mode.

setMode

void setMode(ConnectionMode mode)
             throws ModeNotSupportedException
Modify mode of this connection for all known media types.

Parameters:
mode - the new mode of the connection.
Throws:
ModeNotSupportedException

setEndpoint

void setEndpoint(Endpoint endpoint)
Sets the endpoint which executes this connection.

Parameters:
the - endpoint object.

getEndpoint

Endpoint getEndpoint()
Gets the endpoint which executes this connection.

Returns:
the endpoint object.

getDescriptor

String getDescriptor()
Gets the descriptor of this connection in SDP format.

Returns:
SDP descriptor as text string.

setOtherParty

void setOtherParty(Connection other)
                   throws IOException
Joins endpoint wich executes this connection with other party.

Parameters:
other - the connection executed by other party endpoint.
Throws:
IOException

setOtherParty

void setOtherParty(byte[] descriptor)
                   throws IOException
Joins endpoint which executes this connection with other party.

Parameters:
descriptor - the SDP descriptor of the other party.
Throws:
IOException

setOtherParty

void setOtherParty(Text descriptor)
                   throws IOException
Joins endpoint which executes this connection with other party.

Parameters:
descriptor - the SDP descriptor of the other party.
Throws:
IOException

addListener

void addListener(ConnectionListener listener)
Adds connection state listener.

Parameters:
listener - to be registered

setConnectionFailureListener

void setConnectionFailureListener(ConnectionFailureListener connectionFailureListener)
Sets connection failure listener.

Parameters:
listener - to be registered

removeListener

void removeListener(ConnectionListener listener)
Removes connection state listener.

Parameters:
listener - to be unregistered

getPacketsReceived

long getPacketsReceived()
The number of packets of the specified media type received .

Parameters:
media - the media type.
Returns:
the number of packets.

getBytesReceived

long getBytesReceived()
The total number of bytes received .

Returns:
the number of bytes.

getPacketsTransmitted

long getPacketsTransmitted()
The number of packets of the specified media type transmitted.

Parameters:
media - the media type
Returns:
the number of packets.

getBytesTransmitted

long getBytesTransmitted()
The total number of bytes transmitted.

Returns:
the number of bytes.

getJitter

double getJitter()
The average jitter value accross all media types.

Returns:
average jitter value.


Copyright © 2013 TeleStax, Inc.. All Rights Reserved.