osl.nameservice
Interface NameService

All Known Implementing Classes:
DefaultNameService, LocalNameService

public abstract interface NameService

This interface defines the methods required in order for an object to be treated as a nameservice. In particular, a nameservice must provide a mechanism for creating names, associating them with particular physical addresses, and later updating or removing these bindings. A nameservice is used in conjunction with a request handler in order to implement communication between foundry nodes. Normally, request handler clients do not access the name service directly. Instead, a request handler proxy is used which ensures that the nameservice is accessed correctly and then nameservice entries remain consistent.

Version:
$Revision: 1.3 $ ($Date: 1998/06/12 21:32:34 $)
See Also:
Name, RequestHandler

Method Summary
 void nsAddAddress(PhysicalAddress addr)
          Add a new address for authoritative bindings.
 void nsClear(Name naum)
          Instructs the nameservice to clear non-authoritative about the given name.
 Name nsGenerateName()
          Request a fresh name from the name service.
 void nsInitialize(Scheduler S)
          Initialize this nameservice instance.
 boolean nsLocal(Name namu, PhysicalAddress localBind)
          Requests the nameservice to determine whether or not the given name is bound locally to the given physical address.
 PhysicalAddress nsLookup(Name namu)
          Requests the nameservice to resolve the binding of the given name.
 void nsRegister(Name namu, PhysicalAddress addr)
          Bind the given name to the given physical address.
 void nsRemove(Name namu, PhysicalAddress addr)
          Remove a binding between a name and a physical address.
 

Method Detail

nsInitialize

public void nsInitialize(Scheduler S)
Initialize this nameservice instance.
Parameters:
S - A reference to the scheduler which should be used to schedule nameservice threads.

nsAddAddress

public void nsAddAddress(PhysicalAddress addr)
Add a new address for authoritative bindings.
Parameters:
addr - A PhysicalAddress which may be used for authoritative bindings.

nsGenerateName

public Name nsGenerateName()
Request a fresh name from the name service. The name is guaranteed to be unique relative to all currently running instances of the same type of nameservice.
Returns:
A fresh Name instance.

nsRegister

public void nsRegister(Name namu,
                       PhysicalAddress addr)
                throws MalformedNameException,
                       NoSuchAddressException
Bind the given name to the given physical address. This registration constitutes authoritative information. That is, the registration is stored permanently rather than in a local cache. Note that a name may have multiple bindings.
Parameters:
namu - The Name instance to bind.
addr - The PhysicalAddress which the name argument should be bound to. Henceforth, this addr will be a valid target for any messages sent to namu.
Throws:
MalformedNameException - Thrown if the given name argument is an illegal name representation. This may occur if a name from another nameservice is used or if a client attempts to spoof an illegal name.
NoSuchAddressException - Thrown if this nameservice instance can not make authoritative bindings for addr.

nsRemove

public void nsRemove(Name namu,
                     PhysicalAddress addr)
              throws MalformedNameException,
                     NameNotFoundException,
                     NoSuchAddressException
Remove a binding between a name and a physical address. Bindings may only be removed for names which are bound in authoritative tables. That is, a name may only be unbound if it was previously bound by the same instance of the nameservice.
Parameters:
namu - The Name to unbind.
addr - The PhysicalAddress which should no longer be associated with this name.
Throws:
MalformedNameException - Thrown if the given name argument is an illegal name representation. This may occur if a name from another nameservice is used or if a client attempts to spoof an illegal name.
NameNotFoundException - Thrown if the given name was never bound by this instance of the nameservice.
NoSuchAddressException - Thrown if this nameservice instance does not maintain authoritative bindings for addr.

nsLookup

public PhysicalAddress nsLookup(Name namu)
                         throws MalformedNameException,
                                NameNotFoundException,
                                NoBindingException
Requests the nameservice to resolve the binding of the given name.
Parameters:
namu - The Name instance to be resolved.
Throws:
MalformedNameException - Thrown if the given name argument is an illegal name representation. This may occur if a name from another nameservice is used or if a client attempts to spoof an illegal name.
NameNotFoundException - Thrown if no binding exists for the given name.
NoBindingException - Thrown if the given name currently has no associated PhysicalAddress binding.

nsLocal

public boolean nsLocal(Name namu,
                       PhysicalAddress localBind)
                throws MalformedNameException,
                       NoSuchAddressException
Requests the nameservice to determine whether or not the given name is bound locally to the given physical address. This amounts to determining whether or not the binding namu->localBind is part of the authoritative information for this nameservice instance.
Parameters:
namu - The Name to be looked up.
localBind - The PhysicalAddress which should be verified as a local binding of the given name.
Throws:
MalformedNameException - Thrown if the given name argument is an illegal name representation. This may occur if a name from another nameservice is used or if a client attempts to spoof an illegal name.
NoSuchAddressException - Thrown if this nameservice instance does not maintain authoritative bindings for addr.

nsClear

public void nsClear(Name naum)
             throws MalformedNameException
Instructs the nameservice to clear non-authoritative about the given name. Typically, this means clearing any cache entries associated with the given name. Note that no action is taken if namu refers to an authoritative entry.
Parameters:
namu - The Name for which non-authoritative information should be cleared.
Throws:
MalformedNameException - Thrown if the given name argument is an illegal name representation. This may occur if a name from another nameservice is used or if a client attempts to spoof an illegal name.