org.mobicents.media.server.mgcp.controller.naming
Class EndpointQueue

java.lang.Object
  extended by org.mobicents.media.server.mgcp.controller.naming.EndpointQueue
All Implemented Interfaces:
MgcpEndpointStateListener

public class EndpointQueue
extends Object
implements MgcpEndpointStateListener

Storage for endpoints of same type with search and reordering functions.

Author:
kulikov

Constructor Summary
EndpointQueue()
           
 
Method Summary
 void add(MgcpEndpoint endpoint)
          Adds new endpoint to the queue.
 int find(Text name, MgcpEndpoint[] endpoints)
          Finds endpoints matching to name pattern.
 void onFreed(MgcpEndpoint endpoint)
           
 void remove(MgcpEndpoint endpoint)
          Removes endpoint from the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndpointQueue

public EndpointQueue()
Method Detail

add

public void add(MgcpEndpoint endpoint)
Adds new endpoint to the queue.

Parameters:
endpoint - the endpoint to be added

remove

public void remove(MgcpEndpoint endpoint)
Removes endpoint from the queue.

Parameters:
endpoint - the endpoint to be removed.

find

public int find(Text name,
                MgcpEndpoint[] endpoints)
Finds endpoints matching to name pattern. If "any" endpoint was requested, then first matching endpoint will be locked and not available for search in future until this endpoint will be explicitly unlocked.

Parameters:
name - the name pattern for search
endpoints - collection which will be filled by found endpoints
Returns:
the number of found endpoints.

onFreed

public void onFreed(MgcpEndpoint endpoint)
Specified by:
onFreed in interface MgcpEndpointStateListener


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