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.
-
bind(Name, Object)
- Binds 'name' to the object 'obj'.
-
bind(String, Object)
- Binds 'name' to the object 'obj'.
-
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).
-
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).
-
destroySubcontext(Name)
- Destroys the named context and removes it from the namespace.
-
destroySubcontext(String)
- Destroys the named context and removes it from the namespace.
-
getEnvironment()
- Retrieves the environment properties in effect for this context.
-
getNameParser(Name)
- Retrieves the parser associated with the named context.
-
getNameParser(String)
- Retrieves the parser associated with the named context.
-
list(Name)
- Enumerates the atomic names and the class names of their
bound objects in the named context.
-
list(String)
- Enumerates the atomic names and the class names of their
bound objects in the named context.
-
listBindings(Name)
- Enumerates the atomic names and their bound objects in
the named context.
-
listBindings(String)
- Enumerates the atomic names and their bound objects in
the named context.
-
lookup(Name)
- Retrieves the named object.
-
lookup(String)
- Retrieves the named object.
-
lookupLink(Name)
- Retrieves the named object, following links except
for the terminal atomic component of name.
-
lookupLink(String)
- Retrieves the named object, following links except
for the terminal atomic component of name.
-
rebind(Name, Object)
- Binds 'name' to the object 'obj'.
-
rebind(String, Object)
- Binds 'name' to the object 'obj'.
-
rename(Name, Name)
- Binds 'newName' to the object bound to 'oldName', and unbinds
'oldName'.
-
rename(String, String)
- Binds 'newName' to the object bound to 'oldName', and unbinds
'oldName'.
-
setEnvironment(Properties)
- Adds new environment properties to the environment of this
context.
-
unbind(Name)
- Unbinds the named object from the namespace.
-
unbind(String)
- Unbinds the named object from the namespace.
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'.
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'.
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
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
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
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
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.
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.
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
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
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.
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.
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.
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.
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.
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.
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
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
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.
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.
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
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
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
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