solar.service.directory
Interface DirectoryService

All Superinterfaces:
EventHandler, RequestHandler, Service
All Known Implementing Classes:
CentralDirectoryService, DistDirectoryService

public interface DirectoryService
extends Service

Directory service handles naming and resource discovery.

Version:
$Id: DirectoryService.java,v 1.4 2003/09/25 21:37:37 glchen Exp $
Author:
Guanling Chen

Method Summary
 void addListener(Name pattern, DirectoryListener listener)
          Add a directory listener for the specified pattern.
 java.lang.Object advertise(Name name, Id guid, java.lang.Object obj)
          Advertise a name to the name space, with an app-specific object.
 java.util.List lookup(Name pattern)
          Return a list of advertisement whose name matches the pattern.
 void removeListener(Name pattern, DirectoryListener listener)
          Remove a directory listener for the specified pattern.
 java.lang.Object unadvertise(Name name, Id guid)
          Unadvertise a name from the name space.
 java.lang.Object update(Name oldname, Id guid, Name newname, java.lang.Object obj)
          Update a name advertisement in the name space.
 
Methods inherited from interface solar.service.Service
getName, getServiceManager, handleDispatchUnit, hasInited, init, initDependents, setName, setServiceManager, start, stop
 
Methods inherited from interface solar.api.EventHandler
handleEvent
 
Methods inherited from interface solar.api.RequestHandler
handleRequest
 

Method Detail

addListener

public void addListener(Name pattern,
                        DirectoryListener listener)
                 throws DirectoryException
Add a directory listener for the specified pattern.

DirectoryException

removeListener

public void removeListener(Name pattern,
                           DirectoryListener listener)
                    throws DirectoryException
Remove a directory listener for the specified pattern.

DirectoryException

lookup

public java.util.List lookup(Name pattern)
                      throws DirectoryException
Return a list of advertisement whose name matches the pattern.

DirectoryException

advertise

public java.lang.Object advertise(Name name,
                                  Id guid,
                                  java.lang.Object obj)
                           throws DirectoryException
Advertise a name to the name space, with an app-specific object.

Returns:
the previous object if there is any.
DirectoryException

unadvertise

public java.lang.Object unadvertise(Name name,
                                    Id guid)
                             throws DirectoryException
Unadvertise a name from the name space.

Returns:
the previous object if there is any.
DirectoryException

update

public java.lang.Object update(Name oldname,
                               Id guid,
                               Name newname,
                               java.lang.Object obj)
                        throws DirectoryException
Update a name advertisement in the name space.

Returns:
the previous object if there is any.
DirectoryException