org.mobicents.media.server.spi
Interface Connection


public interface Connection

Author:
Oleg Kulikov, amit bhayani

Method Summary
 void addListener(ConnectionListener listener)
          Adds connection state listener.
 long getBytesReceived()
          The total number of bytes received .
 long getBytesReceived(MediaType media)
          The number of bytes of the specified media type received .
 long getBytesTransmitted()
          The total number of bytes transmitted.
 long getBytesTransmitted(MediaType media)
          The number of bytes of the specified media type transmitted.
 String getDescriptor()
          Gets the descriptor of this connection in SDP format.
 Endpoint getEndpoint()
          Gets the endpoint which executes this connection.
 String getId()
          Gets the identifier of this connection.
 double getJitter()
          The average jitter value accross all media types.
 double getJitter(MediaType media)
          The interarrival jitter for the specific media type.
 ConnectionMode getMode(MediaType mediaType)
          Gets the current mode of this connection.
 long getPacketsReceived(MediaType media)
          The number of packets of the specified media type received .
 long getPacketsTransmitted(MediaType media)
          The number of packets of the specified media type transmitted.
 ConnectionState getState()
          Returns state of this connection
 void removeListener(ConnectionListener listener)
          Removes connection state listener.
 void setMode(ConnectionMode mode)
          Modify mode of this connection for all known media types.
 void setMode(ConnectionMode mode, MediaType mediaType)
          Modify mode of this connection.
 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

String getId()
Gets the identifier of this connection.

Returns:
hex view of the integer.

getState

ConnectionState getState()
Returns state of this connection

Returns:

getMode

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

Returns:
integer constant indicating mode.

setMode

void setMode(ConnectionMode mode,
             MediaType mediaType)
             throws ModeNotSupportedException
Modify mode of this connection.

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

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

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

removeListener

void removeListener(ConnectionListener listener)
Removes connection state listener.

Parameters:
listener - to be unregistered

getPacketsReceived

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

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

getBytesReceived

long getBytesReceived(MediaType media)
The number of bytes of the specified media type received .

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

getBytesReceived

long getBytesReceived()
The total number of bytes received .

Returns:
the number of bytes.

getPacketsTransmitted

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

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

getBytesTransmitted

long getBytesTransmitted(MediaType media)
The number of bytes of the specified media type transmitted.

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

getBytesTransmitted

long getBytesTransmitted()
The total number of bytes transmitted.

Returns:
the number of bytes.

getJitter

double getJitter(MediaType media)
The interarrival jitter for the specific media type.

Parameters:
media - the media type
Returns:
jitter value

getJitter

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

Returns:
average jitter value.


Copyright © 2011. All Rights Reserved.