All Packages Class Hierarchy This Package Previous Next Index
Interface java.naming.directory.DSContext
- public interface DSContext
- extends Context
DSContext is the directory service interface.
It contains methods for examining and updating attributes
associated with objects, as well as methods for searching the directory.
Each name passed as an argument to a DSContext object is relative to
that context. The empty name is used to name the context itself.
-
ADD_ATTRIBUTE
- Adds attribute with specified values.
-
DELETE_ATTRIBUTE
- Deletes the specified attribute values from the attribute.
-
REPLACE_ATTRIBUTE
- Adds attribute with specified values.
-
bind(Name, Object, AttributeSet)
- Binds 'name' to the object 'obj' and associate the attributes 'attrs'
with the named object.
-
bind(String, Object, AttributeSet)
- Binds 'name' to the object 'obj' and associate the attributes 'attrs'
with the named object.
-
createSubcontext(Name, AttributeSet)
- Creates a new subcontext with the given name, binds it in
the target context (that named by all but terminal
component of the name), and associates the attributes
'attrs' with the newly created object.
-
createSubcontext(String, AttributeSet)
- Creates a new subcontext with the given name, binds it in
the target context (that named by all but terminal atomic
component of the name), and associates the attributes
'attrs' with the newly created object.
-
getAttributes(Name)
- Retrieves all of the attributes associated with the named object.
-
getAttributes(Name, String[])
- Retrieves the attributes listed in attrIds associated with the
named object.
-
getAttributes(String)
- Retrieves all of the attributes associated with the named object.
-
getAttributes(String, String[])
- Retrieves the attributes listed in attrIds associated with the
named object.
-
getSchema(Name)
- Retrieves the schema associated with the named DSContext.
-
getSchema(String)
- Retrieves the schema associated with the named DSContext.
-
getSchemaClassDefinition(Name)
- Retrieves the schema class definition associated with the
named DSContext.
-
getSchemaClassDefinition(String)
- Retrieves the schema class definition associated with the
named DSContext.
-
modifyAttributes(Name, int, AttributeSet)
- Modifies according to mod_op and attrs the attributes
associated with the named object.
-
modifyAttributes(Name, ModificationEnumeration)
- Modifies according to mods the attributes associated with
the named object.
-
modifyAttributes(String, int, AttributeSet)
- Modifies according to mod_op and attrs the attributes
associated with the named object.
-
modifyAttributes(String, ModificationEnumeration)
- Modifies according to mods the attributes associated with
the named object.
-
rebind(Name, Object, AttributeSet)
- Binds 'name' to the object 'obj' and associates the attributes
'attrs' with the named object.
-
rebind(String, Object, AttributeSet)
- Binds 'name' to the object 'obj' and associates the attributes
'attrs' with the named object.
-
search(Name, AttributeSet)
-
Searches in a single context for objects that contain a
specified set of attributes.
-
search(Name, AttributeSet, String[])
-
Searches in a single context for objects that contain a
specified set of attributes.
-
search(Name, String, Object[], SearchConstraints)
- Searches in the named context for entries that satisfy the
given search filter.
-
search(Name, String, SearchConstraints)
- Searches in the named context for entries that satisfy the
given search filter.
-
search(String, AttributeSet)
-
Searches in a single context for objects that contain a
specified set of attributes.
-
search(String, AttributeSet, String[])
-
Searches in a single context for objects that contain a
specified set of attributes.
-
search(String, String, Object[], SearchConstraints)
- Searches in the named context for entries that satisfy the
given search filter.
-
search(String, String, SearchConstraints)
- Searches in the named context for entries that satisfy the
given search filter.
ADD_ATTRIBUTE
public static final int ADD_ATTRIBUTE
- Adds attribute with specified values. If attribute does not exist,
create the attribute. The resulting attribute has a union of the
specified value set and the prior value set.
Adding an attribute with no value will throw
InvalidAttributeValueException if the attribute must have at least
one value. For a single-valued attribute,
if attribute already exists, throws AttributeInUseException. If
attempting to add more than one value to a single-valued attribute,
throws InvalidAttributeValueException.
REPLACE_ATTRIBUTE
public static final int REPLACE_ATTRIBUTE
- Adds attribute with specified values. If attribute already exists,
replace all existing values with new specified values. If the
attribute does not exist, create it. If no value is specified,
delete all the values of the attribute.
Removal of the last value will remove the attribute if the attribute
is required to have at least one value. If
attempting to add more than one value to a single-valued attribute,
throws InvalidAttributeValueException.
DELETE_ATTRIBUTE
public static final int DELETE_ATTRIBUTE
- Deletes the specified attribute values from the attribute.
The resulting attribute has the set difference of its prior value set
and the specified value set.
If no values are specified, delete the entire attribute.
If the attribute does not exist, or if some or all members of the
specified value set does not exist, they are ignored silently
and this operation still succeeds.
Removal of the last value will remove the attribute if the
attribute is required to have at least one value.
getAttributes
public abstract AttributeSet getAttributes(String name) throws NamingException
- Retrieves all of the attributes associated with the named object.
- Parameters:
- name - The name of the object from which to retrieve attributes.
- Returns:
- The attributes associated with 'name'.
getAttributes
public abstract AttributeSet getAttributes(Name name) throws NamingException
- Retrieves all of the attributes associated with the named object.
- Parameters:
- name - The name of the object from which to retrieve attributes.
- Returns:
- The attributes associated with 'name'.
getAttributes
public abstract AttributeSet getAttributes(String name,
String attrIds[]) throws NamingException
- Retrieves the attributes listed in attrIds associated with the
named object.
- Parameters:
- name - The name of the object from which to retrieve attributes.
- attrIds - The identifiers of the attributes to retrieve.
null indicates that all attributes should be retrieved.
- Returns:
- The attributes identified by attrIds (or a subset thereof if
some attributes cannot be retrieved).
getAttributes
public abstract AttributeSet getAttributes(Name name,
String attrIds[]) throws NamingException
- Retrieves the attributes listed in attrIds associated with the
named object.
- Parameters:
- name - The name of the object from which to retrieve attributes.
- attrIds - The identifiers of the attributes to retrieve.
null indicates that all attributes should be retrieved.
- Returns:
- The attributes identified by attrIds (or a subset thereof if
some attributes cannot be retrieved).
modifyAttributes
public abstract void modifyAttributes(String name,
int mod_op,
AttributeSet attrs) throws NamingException
- Modifies according to mod_op and attrs the attributes
associated with the named object. The order of the
modifications within attrs is not specified. Where
possible, the modifications are performed atomically. If
the operation fails to complete,
AttributeModificationException is thrown containing
details of the failure.
- Parameters:
- name - The name of the object whose attributes will be updated.
- mod_op - The modification operation.
It is one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE,
DELETE_ATTRIBUTE.
- attrs - The attributes to be used for the modification.
modifyAttributes
public abstract void modifyAttributes(Name name,
int mod_op,
AttributeSet attrs) throws NamingException
- Modifies according to mod_op and attrs the attributes
associated with the named object. The order of the
modifications within attrs is not specified. Where
possible, the modifications are performed atomically. If
the operation fails to complete,
AttributeModificationException is thrown containing
details of the failure.
- Parameters:
- name - The name of the object whose attributes will be updated.
- mod_op - The modification operation.
It is one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE,
DELETE_ATTRIBUTE.
- attrs - The attributes to be used for the modification.
modifyAttributes
public abstract void modifyAttributes(String name,
ModificationEnumeration mods) throws NamingException
- Modifies according to mods the attributes associated with
the named object. The modifications are to be performed
in the order specified. Each modification specifies a
modification operation code and an attribute on which to
operation. Where possible, the list of modifications are
to be performed atomically. If the operation fails to
complete, AttributeModificationException is thrown
containing details of the failure.
- Parameters:
- name - The name of the object whose attributes will be updated.
- mods - An ordered sequence of modifications that are to be
performed on the attributes of the named object.
- See Also:
- ModificationEnumeration
modifyAttributes
public abstract void modifyAttributes(Name name,
ModificationEnumeration mods) throws NamingException
- Modifies according to mods the attributes associated with
the named object. The modifications are to be performed
in the order specified. Each modification specifies a
modification operation code and an attribute on which to
operation. Where possible, the list of modifications are
to be performed atomically. If the operation fails to
complete, AttributeModificationException is thrown
containing details of the failure.
- Parameters:
- name - The name of the object whose attributes will be updated.
- mods - An ordered sequence of modifications that are to be
performed on the attributes of the named object.
- See Also:
- ModificationEnumeration
bind
public abstract void bind(String name,
Object obj,
AttributeSet attrs) throws NamingException
- Binds 'name' to the object 'obj' and associate the attributes 'attrs'
with the named object. If 'attrs' is null, the resulting binding
will have the attributes associated with 'obj' if 'obj' is a
DSContext. If 'obj' is not a DSContext and 'attrs' is null,
the resulting binding will have no attributes.
If 'attrs' is non-null, the resulting binding will have 'attrs'
as its attributes and any attributes associated with 'obj'
are ignored.
- Parameters:
- name - The name to bind. It cannot be empty.
- obj - The object to bind.
- attrs - The attributes to associate with the bound object.
- Throws: NameAlreadyBoundException
- If name is already bound.
- Throws: InvalidAttributeSetException
- If the attributes specified
by 'attrs', or 'obj' if 'attrs' is null, are not sufficient
to create the binding.
- See Also:
- java.naming.Context.bind, rebind
bind
public abstract void bind(Name name,
Object obj,
AttributeSet attrs) throws NamingException
- Binds 'name' to the object 'obj' and associate the attributes 'attrs'
with the named object. If 'attrs' is null, the resulting binding
will have the attributes associated with 'obj' if 'obj' is a
DSContext. If 'obj' is not a DSContext and 'attrs' is null,
the resulting binding will have no attributes.
If 'attrs' is non-null, the resulting binding will have 'attrs'
as its attributes and any attributes associated with 'obj'
are ignored.
- Parameters:
- name - The name to bind. It cannot be empty.
- obj - The object to bind.
- attrs - The attributes to associate with the bound object.
- Throws: NameAlreadyBoundException
- If name is already bound.
- Throws: InvalidAttributeSetException
- If the attributes specified
by 'attrs', or 'obj' if 'attrs' is null, are not sufficient
to create the binding.
- See Also:
- java.naming.Context.bind, rebind
rebind
public abstract void rebind(String name,
Object obj,
AttributeSet attrs) throws NamingException
- Binds 'name' to the object 'obj' and associates the attributes
'attrs' with the named object.
If 'name' is already bound, 'obj' overwrites the existing binding.
If 'attrs' is null and 'obj' is a DSContext,
the attributes from 'obj' are used.
If 'attrs' is null and 'obj' is not a DSContext,
any existing attributes associated with the already bound object
remain unchanged.
If 'attrs' is non-null, any existing attributes associated with
the already bound object are removed and 'attrs' is associated
with the named object. If 'obj' is a DSContext and 'attrs' is
non-null, obj's attributes are ignored.
- Parameters:
- name - The name to bind.
- obj - The object to bind.
- attrs - The attributes to associate with the bound object.
- Throws: InvalidAttributeSetException
- If attrs does not supply
all mandatory attributes required to create the binding.
rebind
public abstract void rebind(Name name,
Object obj,
AttributeSet attrs) throws NamingException
- Binds 'name' to the object 'obj' and associates the attributes
'attrs' with the named object.
If 'name' is already bound, 'obj' overwrites the existing binding.
If 'attrs' is null and 'obj' is a DSContext,
the attributes from 'obj' are used.
If 'attrs' is null and 'obj' is not a DSContext,
any existing attributes associated with the object already bound
in the directory remain unchanged.
If 'attrs' is non-null, any existing attributes associated with
the object already bound in the directory are removed and 'attrs'
is associated with the named object. If 'obj' is a DSContext
and 'attrs' is non-null, obj's attributes are ignored.
- Parameters:
- name - The name to bind.
- obj - The object to bind.
- attrs - The attributes to associate with the bound object.
- Throws: InvalidAttributeSetException
- If attrs does not supply
all mandatory attributes required to create the binding.
createSubcontext
public abstract DSContext createSubcontext(String name,
AttributeSet attrs) throws NamingException
- Creates a new subcontext with the given name, binds it in
the target context (that named by all but terminal atomic
component of the name), and associates the attributes
'attrs' with the newly created object.
All intermediate and target contexts must already exist.
- Parameters:
- name - The name to use when creating the new context.
It cannot be empty.
- attrs - The attributes to associate with the newly created
context.
- Returns:
- The newly created context.
- Throws: NameAlreadyBoundException
- If name is already bound.
- Throws: InvalidAttributeSetException
- If 'attrs' does not
contain all the mandatory attributes required for creation.
- See Also:
- java.naming.Context.createSubcontext
createSubcontext
public abstract DSContext createSubcontext(Name name,
AttributeSet attrs) throws NamingException
- Creates a new subcontext with the given name, binds it in
the target context (that named by all but terminal
component of the name), and associates the attributes
'attrs' with the newly created object.
All intermediate and target contexts must already exist.
- Parameters:
- name - The name to use when creating the new context.
It cannot be empty.
- attrs - The attributes to associate with the newly created
context.
- Returns:
- The newly created context.
- Throws: NameAlreadyBoundException
- If name is already bound.
- Throws: InvalidAttributeSetException
- If 'attrs' does not
contain all the mandatory attributes required for creation.
- See Also:
- java.naming.Context.createSubcontext
getSchema
public abstract DSContext getSchema(String name) throws NamingException
- Retrieves the schema associated with the named DSContext.
- Parameters:
- name - The name of the DSContext.
- Returns:
- The schema associated with the DSContext.
getSchema
public abstract DSContext getSchema(Name name) throws NamingException
- Retrieves the schema associated with the named DSContext.
- Parameters:
- name - The name of the DSContext.
- Returns:
- The schema associated with the DSContext.
getSchemaClassDefinition
public abstract DSContext getSchemaClassDefinition(String name) throws NamingException
- Retrieves the schema class definition associated with the
named DSContext.
- Parameters:
- name - The name of the DSContext.
- Returns:
- The schema class definition associated with name.
getSchemaClassDefinition
public abstract DSContext getSchemaClassDefinition(Name name) throws NamingException
- Retrieves the schema class definition associated with the
named DSContext.
- Parameters:
- name - The name of the DSContext.
- Returns:
- The schema class definition associated with name.
search
public abstract SearchEnumeration search(String name,
AttributeSet matchingAttributes) throws NamingException
- Searches in a single context for objects that contain a
specified set of attributes.
- Parameters:
- name - The name of the context to search.
- matchingAttributes - The attributes to search for.
- Returns:
- An enumeration of the objects that have the attributes
specified in matchingAttributes.
Each item in the enumeration contains all of the attributes
associated with that object.
search
public abstract SearchEnumeration search(Name name,
AttributeSet matchingAttributes) throws NamingException
- Searches in a single context for objects that contain a
specified set of attributes.
- Parameters:
- name - The name of the context to search.
- matchingAttributes - The attributes to search for.
- Returns:
- An enumeration of the objects that have the attributes
specified in matchingAttributes.
Each item in the enumeration contains all of the attributes
associated with that object.
search
public abstract SearchEnumeration search(String name,
AttributeSet matchingAttributes,
String attributesToReturn[]) throws NamingException
- Searches in a single context for objects that contain a
specified set of attributes.
- Parameters:
- name - The name of the context to search.
- matchingAttributes - The attributes to search for.
- attributesToReturn - The attributes to return.
null indicates that all attributes should be returned.
- Returns:
- An enumeration of the objects that has the attributes
specified in matchingAttributes. Each item in the enumeration
contains the attributes identified by attributesToReturn.
search
public abstract SearchEnumeration search(Name name,
AttributeSet matchingAttributes,
String attributesToReturn[]) throws NamingException
- Searches in a single context for objects that contain a
specified set of attributes.
- Parameters:
- name - The name of the context to search.
- matchingAttributes - The attributes to search for.
- attributesToReturn - The attributes to return.
null indicates that all attributes should be returned.
- Returns:
- An enumeration of the objects that has the attributes
specified in matchingAttributes. Each item in the enumeration
contains the attributes identified by attributesToReturn.
search
public abstract SearchEnumeration search(String name,
String filter,
SearchConstraints cons) throws NamingException
- Searches in the named context for entries that satisfy the
given search filter. Performs the search as specified in
the search constraints 'cons'.
- Parameters:
- name - The name of the context at which to start the search.
- filter - The filter to use for the search. Uses the LDAP
filter syntax specified in RFC 1960.
- cons - The search constraints to be applied to the search.
- Returns:
- An enumeration of the objects that satisfy the filter.
search
public abstract SearchEnumeration search(Name name,
String filter,
SearchConstraints cons) throws NamingException
- Searches in the named context for entries that satisfy the
given search filter. Performs the search as specified in
the search constraints 'cons'.
- Parameters:
- name - The name of the context at which to start the search.
- filter - The filter to use for the search. Uses the LDAP
filter syntax specified in RFC 1960.
- cons - The search constraints to be applied to the search.
- Returns:
- An enumeration of the objects that satisfy the filter.
search
public abstract SearchEnumeration search(String name,
String filterExpr,
Object filterArgs[],
SearchConstraints cons) throws NamingException
- Searches in the named context for entries that satisfy the
given search filter. Performs the search as specified in
the search constraints 'cons'.
- Parameters:
- name - The name of the context at which to start the search.
- filterExpr - The filter expression to use for the search.
The expression may contain variables of the form {i} where
'i' is an integral number.
- filterArgs - The arguments to substitute for the variables in
filterExpr. filterArgs[i] will replace all occurrences of {i}.
- cons - The search constraints to be applied to the search.
- Returns:
- An enumeration of the objects that satisfy the filter.
search
public abstract SearchEnumeration search(Name name,
String filterExpr,
Object filterArgs[],
SearchConstraints cons) throws NamingException
- Searches in the named context for entries that satisfy the
given search filter. Performs the search as specified in
the search constraints 'cons'.
- Parameters:
- name - The name of the context at which to start the search.
- filterExpr - The filter expression to use for the search.
The expression may contain variables of the form {i} where
'i' is an integral number.
- filterArgs - The arguments to substitute for the variables in
filterExpr. filterArgs[i] will replace all occurrences of {i}.
- cons - The search constraints to be applied to the search.
- Returns:
- An enumeration of the objects that satisfy the filter.
All Packages Class Hierarchy This Package Previous Next Index