org.mobicents.media.server.mgcp.controller
Class MgcpEndpoint

java.lang.Object
  extended by org.mobicents.media.server.mgcp.controller.MgcpEndpoint

public class MgcpEndpoint
extends Object

Represents media endpoint on MGCP controller side.

Author:
kulikov

Field Summary
protected  Text fullName
           
protected  MgcpProvider mgcpProvider
           
static int STATE_BUSY
           
static int STATE_FREE
           
static int STATE_LOCKED
           
static AtomicInteger txID
           
 
Constructor Summary
MgcpEndpoint(Endpoint endpoint, MgcpProvider mgcpProvider, String domainName, int port, Collection<MgcpPackage> packages)
          Constructs new endpoint activity.
 
Method Summary
 MgcpConnection createConnection(MgcpCall call, ConnectionType type, boolean isLocal)
          Creates new RTP connection.
 void deleteAllConnections()
           
 void deleteConnection(Text id)
          Deletes connection.
 MgcpConnection getConnection(Text connectionID)
           
 Endpoint getEndpoint()
          Provides the access to the native endpoint.
 Text getFullName()
           
 String getName()
          Gets the MGCP name of this activity.
 Request getRequest()
          Gets the access to the request executor.
 int getState()
          Gets the current state of this activity.
 void lock()
          Exclusively locks this activity.
protected  void offer(MgcpConnection mgcpConnection)
          Reclaims used connection object.
protected  MgcpConnection poll(MgcpCall call)
          Asks mgcp connection object from pool.
protected  void send(MgcpEvent message, SocketAddress address)
           
 void setMgcpEndpointStateListener(MgcpEndpointStateListener listener)
           
 void setMgcpListener(MgcpListener listener)
           
 void share()
          Unlocks this activity if it is not busy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

txID

public static AtomicInteger txID

STATE_LOCKED

public static final int STATE_LOCKED
See Also:
Constant Field Values

STATE_FREE

public static final int STATE_FREE
See Also:
Constant Field Values

STATE_BUSY

public static final int STATE_BUSY
See Also:
Constant Field Values

fullName

protected Text fullName

mgcpProvider

protected MgcpProvider mgcpProvider
Constructor Detail

MgcpEndpoint

public MgcpEndpoint(Endpoint endpoint,
                    MgcpProvider mgcpProvider,
                    String domainName,
                    int port,
                    Collection<MgcpPackage> packages)
Constructs new endpoint activity.

Parameters:
endpoint - native endpoint.
Method Detail

getName

public String getName()
Gets the MGCP name of this activity.

Returns:
the name of activity

getFullName

public Text getFullName()

getEndpoint

public Endpoint getEndpoint()
Provides the access to the native endpoint.

Returns:
the native endpoint.

setMgcpListener

public void setMgcpListener(MgcpListener listener)

setMgcpEndpointStateListener

public void setMgcpEndpointStateListener(MgcpEndpointStateListener listener)

getState

public int getState()
Gets the current state of this activity.

Returns:
the state indicator.

getRequest

public Request getRequest()
Gets the access to the request executor.

Returns:
request executor.

lock

public void lock()
Exclusively locks this activity.


share

public void share()
Unlocks this activity if it is not busy


createConnection

public MgcpConnection createConnection(MgcpCall call,
                                       ConnectionType type,
                                       boolean isLocal)
                                throws TooManyConnectionsException,
                                       ResourceUnavailableException
Creates new RTP connection. Creation of connection makes endpoint activity busy.

Returns:
connection activity.
Throws:
TooManyConnectionsException
ResourceUnavailableException

deleteConnection

public void deleteConnection(Text id)
Deletes connection.

Parameters:
id - the identifier of the relative connection activity.

deleteAllConnections

public void deleteAllConnections()

getConnection

public MgcpConnection getConnection(Text connectionID)

send

protected void send(MgcpEvent message,
                    SocketAddress address)

poll

protected MgcpConnection poll(MgcpCall call)
Asks mgcp connection object from pool.

Parameters:
call - the call to which connection belongs
Returns:
MgcpConnection object.

offer

protected void offer(MgcpConnection mgcpConnection)
Reclaims used connection object.

Parameters:
connection - the object to be reclaimed


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