All Packages Class Hierarchy This Package Previous Next Index
Class AcmeNet.Assn4.Naming
AcmeNet.Assn4.Naming
- public class Naming
This class provides a handy way for clients of distributed AcmeNet name services to
access the name space. For example, it allows clients to use Unix-style pathnames like
"/cs461/echo/swedish_chef"; this class parses pathnames into their components and does the
necessary string of lookups to traverse the name hierarchy.
- See Also:
- NameService
-
Naming(String, long)
- Create a new Naming object that uses a newly created NetworkInterface.
-
Naming(String, long, ClientServerNI)
- Create a new Naming object that uses an existing network interface.
-
bind(String, ServiceAddress)
- Bind a service to a name in the AcmeNet name space.
-
connectTo(String)
- Connect to the service that is bound to a specified pathname in the AcmeNet name space.
-
listDirectory(String)
- List all of the names bound in an AcmeNet "directory".
-
unbind(String)
- Unbind a name in the AcmeNet name space.
Naming
public Naming(String username,
long userkey)
- Create a new Naming object that uses a newly created NetworkInterface.
- Parameters:
- username - the user-ID under which the object should run
- userkey - the secret key of the user-ID under which the object should run
Naming
public Naming(String username,
long userkey,
ClientServerNI ni)
- Create a new Naming object that uses an existing network interface.
- Parameters:
- username - the user-ID under which the object should run
- userkey - the secret key of the user-ID under which the object should run
- ni - the network interface the object should use
bind
public boolean bind(String pathname,
ServiceAddress servAddr) throws IOException
- Bind a service to a name in the AcmeNet name space.
- Parameters:
- pathname - the pathname at which the service should be bound
- servAddr - the address of the service to bind to pathname
- Returns:
- true if the operation succeeded; false otherwise
- Throws: IOException
- some I/O error occurred
unbind
public boolean unbind(String pathname) throws IOException
- Unbind a name in the AcmeNet name space.
- Parameters:
- pathname - the pathname to unbind
- Returns:
- true if the operation succeeded; false otherwise
- Throws: IOException
- some I/O error occurred
listDirectory
public Enumeration listDirectory(String pathname) throws IOException
- List all of the names bound in an AcmeNet "directory".
- Parameters:
- pathname - the pathname of the directory to list
- Returns:
- a java.util.Enumeration of all of the names bound in the directory, or null if the operation failed
- Throws: IOException
- some I/O error occurred
connectTo
public Connection connectTo(String pathname) throws IOException
- Connect to the service that is bound to a specified pathname in the AcmeNet name space.
- Parameters:
- pathname - the pathname of the service to connect to
- Returns:
- a connection to the service, or null if the operation failed
- Throws: IOException
- some I/O error occurred
All Packages Class Hierarchy This Package Previous Next Index