net.larsan.urd.impl
Class Registry

java.lang.Object
  |
  +--net.larsan.urd.impl.Registry
All Implemented Interfaces:
ServiceRegistry

public class Registry
extends java.lang.Object
implements ServiceRegistry

Urd ServiceRegistry implementation.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Field Summary
 
Fields inherited from interface net.larsan.norna.ServiceRegistry
NAMESPACE_ID
 
Constructor Summary
Registry(javax.naming.Context rootContext)
          Create a registry based on a root context.
 
Method Summary
 void addRegistryListener(java.util.Properties filter, RegistryListener listener)
          Get a service by id.
 void addRegistryListener(RegistryListener listener)
          Please refer to to the Norna ServiceRegistry documentation.
 java.util.Iterator getByPublicID(java.lang.String ID)
          Get a service by id.
 ServiceHandle getByURL(java.lang.String url)
          Get a service by url.
 Environment getEnvironment()
          Please refer to to the Norna ServiceRegistry documentation.
 SoftwareInfo getSoftwareInfo(java.lang.String url)
          Get a service info url.
 java.util.Iterator list()
          Get a service listing.
 void removeRegistryListener(RegistryListener listener)
          Get a service by id.
 java.util.Iterator search(java.util.Properties attributes)
          Search for a service.
 void start(java.lang.String url)
          Start a service.
 void stop(java.lang.String url)
          Stop a service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Registry

public Registry(javax.naming.Context rootContext)
         throws javax.naming.NamingException
Create a registry based on a root context.

Parameters:
rootContext - Context to use, must not be null
Method Detail

getEnvironment

public Environment getEnvironment()
Please refer to to the Norna ServiceRegistry documentation.

Specified by:
getEnvironment in interface ServiceRegistry
Returns:
The framework environment

addRegistryListener

public void addRegistryListener(RegistryListener listener)
Please refer to to the Norna ServiceRegistry documentation.

Specified by:
addRegistryListener in interface ServiceRegistry
Parameters:
listener - Register listener

addRegistryListener

public void addRegistryListener(java.util.Properties filter,
                                RegistryListener listener)
Get a service by id. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
addRegistryListener in interface ServiceRegistry
Parameters:
filter - Event filter properties
listener - Register listener

removeRegistryListener

public void removeRegistryListener(RegistryListener listener)
Get a service by id. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
removeRegistryListener in interface ServiceRegistry
Parameters:
listener - Listener to remove

getByPublicID

public java.util.Iterator getByPublicID(java.lang.String ID)
Get a service by id. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
getByPublicID in interface ServiceRegistry
Parameters:
ID - Service id as returned by getPublicID
Returns:
An iterator of the service context URLs as strings

getByURL

public ServiceHandle getByURL(java.lang.String url)
Get a service by url. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
getByURL in interface ServiceRegistry
Parameters:
url - Service context URL
Returns:
A ServiceHandle to the a service, or null if not found or not ready

search

public java.util.Iterator search(java.util.Properties attributes)
                          throws java.util.regex.PatternSyntaxException
Search for a service. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
search in interface ServiceRegistry
Parameters:
attributes - Search attributes matching property names to regular expressions
Returns:
An iterator of the service context URLs matching the search criteria as strings
Throws:
java.util.regex.PatternSyntaxException - If any regexp patter is invalid

list

public java.util.Iterator list()
Get a service listing. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
list in interface ServiceRegistry
Returns:
An iterator over service context URLs the caller has access to

getSoftwareInfo

public SoftwareInfo getSoftwareInfo(java.lang.String url)
Get a service info url. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
getSoftwareInfo in interface ServiceRegistry
Parameters:
url - Service context URL as a string
Returns:
A SoftwareInfo object for the service, or null if not found

start

public void start(java.lang.String url)
           throws NoSuchServiceException
Start a service. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
start in interface ServiceRegistry
Parameters:
url - Service context URL as a string
Throws:
NoSuchServiceException - If no service with the nuid is found

stop

public void stop(java.lang.String url)
          throws NoSuchServiceException
Stop a service. Please refer to to the Norna ServiceRegistry documentation.

Specified by:
stop in interface ServiceRegistry
Parameters:
url - Service context URL as a string
Throws:
NoSuchServiceException - If no service with the nuid is found