org.mobicents.media.server.connection
Class Connections

java.lang.Object
  extended by org.mobicents.media.server.connection.Connections
Direct Known Subclasses:
LocalToRemoteConnections, RemoteToRemoteConnections

public class Connections
extends Object

Implements connection management subsystem. Procedure of joining endponts must work very fast however dynamic connection creation upon request cause long and unpredictable delays. Preallocated connection objects gives better result.

Author:
kulikov

Nested Class Summary
protected  class Connections.Channel
          Transmission channel between connections and endpoint
protected  class Connections.LocalChannel
          Channel for joining connections in CNF mode.
 
Field Summary
protected  ConcurrentHashMap<String,BaseConnection> activeConnections
           
protected  Connections.Channel audioChannel
           
protected  DspFactory dspFactory
          Signaling processors factory
protected  BaseEndpointImpl endpoint
           
protected  ConcurrentHashMap<String,Connections.LocalChannel> localChannels
          active local channels
protected  RTPManager rtpManager
           
protected  Scheduler scheduler
           
protected  Connections.Channel videoChannel
           
 
Constructor Summary
Connections(BaseEndpointImpl endpoint, int localPoolSize, int rtpPoolSize, Boolean isLocalToRemote)
          Creates new connections subsystem.
 
Method Summary
protected  void addToConference(BaseConnection connection)
           
 Connection createConnection(ConnectionType type)
          Creates connection with specified type.
 int getActiveConnectionsCount()
           
protected  String getChannelId(BaseConnection c1, BaseConnection c2)
           
 CheckPoint getCheckPoint(MediaType mediaType, int n)
          Reads data from specified check point.
 BaseEndpointImpl getEndpoint()
           
 Mixer getMixer(MediaType mediaType)
          Get access to the mixer.
 Splitter getSplitter(MediaType mediaType)
          Gets access to the splitter.
 void release()
          Closes all activities connections.
 void releaseConnection(BaseConnection connection, ConnectionType type)
           
protected  void removeFromConference(BaseConnection connection)
           
 String report()
           
protected  void updateConnectionChannels(BaseConnection connection)
           
 void updateMode(MediaType mediaType)
          Determines transmission mode between endpoint and connections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

endpoint

protected BaseEndpointImpl endpoint

scheduler

protected Scheduler scheduler

activeConnections

protected ConcurrentHashMap<String,BaseConnection> activeConnections

audioChannel

protected Connections.Channel audioChannel

videoChannel

protected Connections.Channel videoChannel

localChannels

protected ConcurrentHashMap<String,Connections.LocalChannel> localChannels
active local channels


rtpManager

protected RTPManager rtpManager

dspFactory

protected DspFactory dspFactory
Signaling processors factory

Constructor Detail

Connections

public Connections(BaseEndpointImpl endpoint,
                   int localPoolSize,
                   int rtpPoolSize,
                   Boolean isLocalToRemote)
            throws Exception
Creates new connections subsystem.

Parameters:
endpoint - the endpoint running connections
poolSize - the number of available connections.
Throws:
Exception
Method Detail

getEndpoint

public BaseEndpointImpl getEndpoint()

getActiveConnectionsCount

public int getActiveConnectionsCount()

createConnection

public Connection createConnection(ConnectionType type)
                            throws ResourceUnavailableException
Creates connection with specified type.

Parameters:
type - the type of connection
Returns:
connection instance.
Throws:
ResourceUnavailableException

releaseConnection

public void releaseConnection(BaseConnection connection,
                              ConnectionType type)

release

public void release()
Closes all activities connections.


getMixer

public Mixer getMixer(MediaType mediaType)
Get access to the mixer.

Parameters:
mediaType - the type of the mixer: audio or video
Returns:
mixer component

getSplitter

public Splitter getSplitter(MediaType mediaType)
Gets access to the splitter.

Parameters:
mediaType - the type of the splitter: audio or video
Returns:
splitter component.

updateMode

public void updateMode(MediaType mediaType)
                throws ModeNotSupportedException
Determines transmission mode between endpoint and connections. This method is called when mode of any connection has been changed. It checks modes of all active connections and determines endpoint transition mode as a combination of connections modes.

Throws:
ModeNotSupportedException

getChannelId

protected String getChannelId(BaseConnection c1,
                              BaseConnection c2)

addToConference

protected void addToConference(BaseConnection connection)

updateConnectionChannels

protected void updateConnectionChannels(BaseConnection connection)

removeFromConference

protected void removeFromConference(BaseConnection connection)

report

public String report()

getCheckPoint

public CheckPoint getCheckPoint(MediaType mediaType,
                                int n)
Reads data from specified check point.

Parameters:
n - the identifier of check point
Returns:
the data collected by checkpoint.


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