All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface java.naming.Context

public interface Context
A naming context consists of a set of name-to-object bindings. The Context interface represents a naming context. It contains methods for examining and updating the contents of the context. Each name passed as an argument to a Context object is relative to that context. The empty name is used to name the context itself.


Method Index

 o bind(Name, Object)
Binds 'name' to the object 'obj'.
 o bind(String, Object)
Binds 'name' to the object 'obj'.
 o createSubcontext(Name)
Creates a new context with the given name and binds it in the target context (that named by all but terminal atomic component of the name).
 o createSubcontext(String)
Creates a new context with the given name and binds it in the target context (that named by all but terminal atomic component of the name).
 o destroySubcontext(Name)
Destroys the named context and removes it from the namespace.
 o destroySubcontext(String)
Destroys the named context and removes it from the namespace.
 o getEnvironment()
Retrieves the environment properties in effect for this context.
 o getNameParser(Name)
Retrieves the parser associated with the named context.
 o getNameParser(String)
Retrieves the parser associated with the named context.
 o list(Name)
Enumerates the atomic names and the class names of their bound objects in the named context.
 o list(String)
Enumerates the atomic names and the class names of their bound objects in the named context.
 o listBindings(Name)
Enumerates the atomic names and their bound objects in the named context.
 o listBindings(String)
Enumerates the atomic names and their bound objects in the named context.
 o lookup(Name)
Retrieves the named object.
 o lookup(String)
Retrieves the named object.
 o lookupLink(Name)
Retrieves the named object, following links except for the terminal atomic component of name.
 o lookupLink(String)
Retrieves the named object, following links except for the terminal atomic component of name.
 o rebind(Name, Object)
Binds 'name' to the object 'obj'.
 o rebind(String, Object)
Binds 'name' to the object 'obj'.
 o rename(Name, Name)
Binds 'newName' to the object bound to 'oldName', and unbinds 'oldName'.
 o rename(String, String)
Binds 'newName' to the object bound to 'oldName', and unbinds 'oldName'.
 o setEnvironment(Properties)
Adds new environment properties to the environment of this context.
 o unbind(Name)
Unbinds the named object from the namespace.
 o unbind(String)
Unbinds the named object from the namespace.

Methods

 o lookup
 public abstract Object lookup(String name) throws NamingException
Retrieves the named object. context.

Parameters:
name - The name to look up. If empty, look up this context itself.
Returns:
The object bound to 'name'.
 o lookup
 public abstract Object lookup(Name name) throws NamingException
Retrieves the named object.

Parameters:
name - The name to look up. If empty, look up this context itself.
Returns:
The object bound to 'name'.
 o bind
 public abstract void bind(String name,
                           Object obj) throws NamingException
Binds 'name' to the object 'obj'.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If obj did not supply all mandatory attributes.
See Also:
java.naming.directory.DSContext.bind, bind, rename
 o bind
 public abstract void bind(Name name,
                           Object obj) throws NamingException
Binds 'name' to the object 'obj'.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind.
Throws: NameAlreadyBoundException
name is already bound.
Throws: InvalidAttributeSetException
If obj did not supply all mandatory attributes.
See Also:
java.naming.directory.DSContext.bind, rebind, rename
 o rebind
 public abstract void rebind(String name,
                             Object obj) throws NamingException
Binds 'name' to the object 'obj'. If name is already bound, overwrite the existing binding.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind. If obj is a DSContext, the attributes associated with the name already bound are replaced with the attributes of obj.
Throws: InvalidAttributeSetException
If obj did not supply all mandatory attributes.
See Also:
java.naming.directory.DSContext.rebind, bind, rename
 o rebind
 public abstract void rebind(Name name,
                             Object obj) throws NamingException
Binds 'name' to the object 'obj'. If name is already bound, overwrite the existing binding.

Parameters:
name - The name to bind. It cannot be empty.
obj - The object to bind. If obj is a DSContext, the attributes associated with the name already bound are replaced with the attributes of obj.
Throws: InvalidAttributeSetException
If obj did not supply all mandatory attributes.
See Also:
bind, rename, java.naming.directory.DSContext.rebind
 o unbind
 public abstract void unbind(String name) throws NamingException
Unbinds the named object from the namespace. Any attributes associated with name are removed. Intermediate contexts are not changed.

Parameters:
name - The name to unbind. It cannot be empty.
 o unbind
 public abstract void unbind(Name name) throws NamingException
Unbinds the named object from the namespace. Any attributes associated with name are removed. Intermediate contexts are not changed.

Parameters:
name - The name to unbind. It cannot be empty.
 o rename
 public abstract void rename(String oldName,
                             String newName) throws NamingException
Binds 'newName' to the object bound to 'oldName', and unbinds 'oldName'. Any attributes associated with 'oldName' become associated with 'newName'. Intermediate contexts of 'oldName' are not changed.

Parameters:
oldName - The name of the existing binding, relative to this context. It cannot be empty.
newName - The name of the new binding, relative to this context. It cannot be empty.
See Also:
bind, rebind
 o rename
 public abstract void rename(Name oldName,
                             Name newName) throws NamingException
Binds 'newName' to the object bound to 'oldName', and unbinds 'oldName'. Any attributes associated with 'oldName' become associated with 'newName'. Intermediate contexts of 'oldName' are not changed.

Parameters:
oldName - The name of the existing binding. oldName is resolved relative to this context. It cannot be empty.
newName - The name of the new binding. newName is resolved relative to this context. It cannot be empty.
See Also:
bind, rebind
 o list
 public abstract NameClassEnumeration list(String name) throws NamingException
Enumerates the atomic names and the class names of their bound objects in the named context.

Parameters:
name - The name of the context to list.
Returns:
An enumeration of the atomic names and class names of the bindings in this context.
 o list
 public abstract NameClassEnumeration list(Name name) throws NamingException
Enumerates the atomic names and the class names of their bound objects in the named context.

Parameters:
name - The name of the context to list.
Returns:
An enumeration of the atomic names and class names of the bindings in this context.
 o listBindings
 public abstract BindingEnumeration listBindings(String name) throws NamingException
Enumerates the atomic names and their bound objects in the named context.

Parameters:
name - The name of the context to list.
Returns:
An enumeration of the atomic names and their bound objects.
 o listBindings
 public abstract BindingEnumeration listBindings(Name name) throws NamingException
Enumerates the atomic names and their bound objects in the named context.

Parameters:
name - The name of the context to list.
Returns:
An enumeration of the atomic names and their bound objects.
 o destroySubcontext
 public abstract void destroySubcontext(String name) throws NamingException
Destroys the named context and removes it from the namespace. Any attributes associated with name are also removed. Intermediate contexts are not destroyed.

Parameters:
name - The name of the context to be destroyed. It cannot be empty.
 o destroySubcontext
 public abstract void destroySubcontext(Name name) throws NamingException
Destroys the named context and removes it from the namespace. Any attributes associated with name are also removed. Intermediate contexts are not destroyed.

Parameters:
name - The name of the context to be destroyed. It cannot be empty.
 o createSubcontext
 public abstract Context createSubcontext(String name) throws NamingException
Creates a new context with the given name and binds it in the target context (that named by all but terminal atomic component of the name). All intermediate contexts and the target context must already exist.

Parameters:
name - The name of the context to create. It cannot be empty.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If creation of the subcontext requires specification of mandatory attributes.
See Also:
java.naming.directory.DSConext.createSubcontext
 o createSubcontext
 public abstract Context createSubcontext(Name name) throws NamingException
Creates a new context with the given name and binds it in the target context (that named by all but terminal atomic component of the name). All intermediate contexts and the target context must already exist.

Parameters:
name - The name of the context to create. It cannot be empty.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If creation of the subcontext requires specification of mandatory attributes.
See Also:
java.naming.directory.DSConext.createSubcontext
 o lookupLink
 public abstract Object lookupLink(String name) throws NamingException
Retrieves the named object, following links except for the terminal atomic component of name. If

Parameters:
name - The name to look up.
Returns:
The object bound to the name by not following the terminal link (if any). If the object bound to name is not a link, return the object itself.
 o lookupLink
 public abstract Object lookupLink(Name name) throws NamingException
Retrieves the named object, following links except for the terminal atomic component of name.

Parameters:
name - The name to look up.
Returns:
The object bound to the name by not following the terminal link (if any). If the object bound to name is not a link, return the object itself.
 o getNameParser
 public abstract NameParser getNameParser(String name) throws NamingException
Retrieves the parser associated with the named context. In a federation of namespaces, different naming systems will parse names differently. This method allows an application to get a parser for parsing names into their atomic components using the naming convention of a particular naming system. Within any single naming system, the NameParser object returned by this method must be equal (using equals() test).

Parameters:
name - The name of the context from which to get the parser.
Returns:
A name parser that will parse names into their atomic components.
See Also:
CompoundName
 o getNameParser
 public abstract NameParser getNameParser(Name name) throws NamingException
Retrieves the parser associated with the named context. In a federation of namespaces, different naming systems will parse names differently. This method allows an application to get a parser for parsing names into their atomic components using the naming convention of a particular naming system. Within any single naming system, the NameParser object returned by this method must be equal (using equals() test).

Parameters:
name - The name of the context from which to get the parser.
Returns:
A name parser that will parse names into their atomic components.
See Also:
CompoundName
 o setEnvironment
 public abstract Properties setEnvironment(Properties environment) throws NamingException
Adds new environment properties to the environment of this context.

Parameters:
environment - The environment properties to add. These override any existing environment properties of the same names.
Returns:
The new environment of this context.
See Also:
getEnvironment
 o getEnvironment
 public abstract Properties getEnvironment() throws NamingException
Retrieves the environment properties in effect for this context.

Returns:
The environment properties for this context.
See Also:
setEnvironment

All Packages  Class Hierarchy  This Package  Previous  Next  Index