org.mobicents.media.server.spi
Interface Connection

All Superinterfaces:
java.io.Serializable

public interface Connection
extends java.io.Serializable

Author:
Oleg Kulikov

Field Summary
static int CHANNEL_RX
           
static int CHANNEL_TX
           
 
Method Summary
 void addListener(ConnectionListener listener)
          Adds connection state listener.
 void addNotificationListener(NotificationListener listener)
           
 Component getComponent(MediaType type, java.lang.Class _interface)
           
 Endpoint getEndpoint()
          Gets the endpoint which executes this connection.
 java.lang.String getId()
          Gets the identifier of this connection.
 int getLifeTime()
          Gets the time to live of the connection.
 java.lang.String getLocalDescriptor()
          Gets the local descriptor of the connection.
 ConnectionMode getMode(MediaType mediaType)
          Gets the current mode of this connection.
 long getPacketsReceived(MediaType media)
           
 long getPacketsTransmitted(MediaType media)
           
 java.lang.String getRemoteDescriptor()
          Gets the descriptor of the remote party.
 ConnectionState getState()
          Returns state of this connection
 void removeListener(ConnectionListener listener)
          Removes connection state listener.
 void removeNotificationListener(NotificationListener listener)
           
 void setLifeTime(int lifeTime)
          Modify life time of the connection.
 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(Connection other)
          Joins localy this and other connections.
 void setOtherParty(Connection other, MediaType mediaType)
           
 void setOtherParty(java.lang.String media, java.net.InetSocketAddress address)
           
 void setRemoteDescriptor(java.lang.String descriptor)
          Modify the descriptor of the remote party.
 

Field Detail

CHANNEL_RX

static final int CHANNEL_RX
See Also:
Constant Field Values

CHANNEL_TX

static final int CHANNEL_TX
See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
Gets the identifier of this connection.

Returns:
hex view of the integer.

getState

ConnectionState getState()
Returns state of this connection

Returns:

getLifeTime

int getLifeTime()
Gets the time to live of the connection.

Returns:
the time in seconds.

setLifeTime

void setLifeTime(int lifeTime)
Modify life time of the connection.

Parameters:
lifeTime - the time value in seconds.

getMode

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

Returns:
integer constant indicating mode.

setMode

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

Parameters:
mode - the new value of the mode.

setMode

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

Parameters:
mode - the new mode of the connection.

getEndpoint

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

Returns:
the endpoint object.

getLocalDescriptor

java.lang.String getLocalDescriptor()
Gets the local descriptor of the connection. The SDP format is used to encode the parameters of the connection.

Returns:
SDP descriptor.

getRemoteDescriptor

java.lang.String getRemoteDescriptor()
Gets the descriptor of the remote party. The SDP format is used to encode the parameters of the connection.

Returns:
SDP descriptor.

setRemoteDescriptor

void setRemoteDescriptor(java.lang.String descriptor)
                         throws javax.sdp.SdpException,
                                java.io.IOException,
                                ResourceUnavailableException
Modify the descriptor of the remote party. The SDP format is used to encode the parameters of the connection.

Parameters:
remoteDescriptor - the SDP descriptor of the remote party.
Throws:
ResourceUnavailableException
javax.sdp.SdpException
java.io.IOException

setOtherParty

void setOtherParty(Connection other)
                   throws java.io.IOException
Joins localy this and other connections.

Parameters:
other - the other connectio to join with.
Throws:
java.lang.InterruptedException
java.io.IOException

setOtherParty

void setOtherParty(Connection other,
                   MediaType mediaType)
                   throws java.io.IOException
Throws:
java.io.IOException

setOtherParty

void setOtherParty(java.lang.String media,
                   java.net.InetSocketAddress address)
                   throws java.io.IOException
Throws:
java.io.IOException

addListener

void addListener(ConnectionListener listener)
Adds connection state listener.

Parameters:
listener - to be registered

addNotificationListener

void addNotificationListener(NotificationListener listener)

removeListener

void removeListener(ConnectionListener listener)
Removes connection state listener.

Parameters:
listener - to be unregistered

removeNotificationListener

void removeNotificationListener(NotificationListener listener)

getComponent

Component getComponent(MediaType type,
                       java.lang.Class _interface)

getPacketsReceived

long getPacketsReceived(MediaType media)

getPacketsTransmitted

long getPacketsTransmitted(MediaType media)


Copyright © 2010. All Rights Reserved.