org.mobicents.media.server
Class NamingService

java.lang.Object
  extended by org.mobicents.media.server.NamingService

public class NamingService
extends Object

Implements naming server for media server. The name of the endpoint has heirarhical structure and endpoints are stored in tree structure. The service allows register and unregister endpoints with this service and as well allows to lookup the endpoint using the name of endpoint in two styles: exclusive and non-exclusive The exclusive lookup is used when endpoint name is wildcarded and returned endpoint is not visible for future lookups. The user must explicit share the endpoint after usage to make visible again.

Author:
kulikov

Constructor Summary
NamingService()
           
 
Method Summary
 Endpoint lookup(String name, boolean exclusive)
          Gets the endpoint with specified name.
 void register(Endpoint endpoint)
          Registers endpoint.
 void share(Endpoint endpoint)
          Makes endpoint visible for lookups if it was looked up exclusively before
 void unregister(Endpoint endpoint)
          Unregisters endpoint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingService

public NamingService()
Method Detail

register

public void register(Endpoint endpoint)
Registers endpoint. After registration the endpoint can be looked up using its name.

Parameters:
endpoint - the endpoint to be registered.

unregister

public void unregister(Endpoint endpoint)
Unregisters endpoint. Unregistered endpoint is not longer visible for lookups.

Parameters:
endpoint - the endpoint to be unregistered.

lookup

public Endpoint lookup(String name,
                       boolean exclusive)
                throws ResourceUnavailableException,
                       UnknownEndpointException
Gets the endpoint with specified name.

Parameters:
name - the name of the endpoint to lookup
exclusive - the mode of search. if true the returned endpoint won't be visible for future lookups unit it will be explicitly shared. *
Returns:
the endpoint with specified name
Throws:
ResourceUnavailableException - if name is wildcarded and no free endpoints now
UnknownEndpointException - the name of endpoint is unknown.

share

public void share(Endpoint endpoint)
Makes endpoint visible for lookups if it was looked up exclusively before

Parameters:
endpoint - the endpoint to share.


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