javax.naming.directory |
Extends the javax.naming package to provide functionality
for accessing directory services.
This package defines the directory operations of the Java Naming and
Directory InterfaceTM (JNDI).
JNDI provides naming and directory functionality to applications
written in the Java programming language. It is designed to be
independent of any specific naming or directory service
implementation. Thus a variety of services--new, emerging, and
already deployed ones--can be accessed in a common way.
This package allows applications to retrieve and update attributes
associated with objects stored in a directory, and to search for
objects using specified attributes.
The Directory Context
The DirContext
interface represents a directory context.
It defines methods for examining and updating attributes associated with a
directory object, or directory entry as it is sometimes
called.
You use getAttributes() to retrieve the attributes
associated with a directory object (for which you supply the name).
Attributes are modified using modifyAttributes().
You can add, replace, or remove attributes and/or attribute values
using this operation.
DirContext also behaves as a naming context
by extending the Context interface in the javax.naming package.
This means that any directory object can also provide
a naming context.
For example, the directory object for a person might contain
the attributes of that person, and at the same time provide
a context for naming objects relative to that person
such as his printers and home directory.
Searches
DirContext contains methods for
performing content-based searching of the directory.
In the simplest and most common form of usage, the application
specifies a set of attributes--possibly with specific
values--to match, and submits this attribute set, to the
search() method.
There are other overloaded forms of search()
that support more sophisticated search filters.
Package Specification
The JNDI API Specification and related documents can be found in the
JNDI documentation.
@since 1.3
|
Java Source File Name | Type | Comment |
Attribute.java | Interface | This interface represents an attribute associated with a named object.
In a directory, named objects can have associated with them
attributes. |
AttributeInUseException.java | Class | This exception is thrown when an operation attempts
to add an attribute that already exists. |
AttributeModificationException.java | Class | This exception is thrown when an attempt is
made to add, or remove, or modify an attribute, its identifier,
or its values that conflicts with the attribute's (schema) definition
or the attribute's state.
It is thrown in response to DirContext.modifyAttributes().
It contains a list of modifications that have not been performed, in the
order that they were supplied to modifyAttributes().
If the list is null, none of the modifications were performed successfully.
An AttributeModificationException instance is not synchronized
against concurrent multithreaded access. |
Attributes.java | Interface | This interface represents a collection of attributes.
In a directory, named objects can have associated with them
attributes. |
BasicAttribute.java | Class | This class provides a basic implementation of the Attribute interface.
This implementation does not support the schema methods
getAttributeDefinition() and getAttributeSyntaxDefinition().
They simply throw OperationNotSupportedException.
Subclasses of BasicAttribute should override these methods if they
support them.
The BasicAttribute class by default uses Object.equals() to
determine equality of attribute values when testing for equality or
when searching for values, except when the value is an array.
For an array, each element of the array is checked using Object.equals().
Subclasses of BasicAttribute can make use of schema information
when doing similar equality checks by overriding methods
in which such use of schema is meaningful.
Similarly, the BasicAttribute class by default returns the values passed to its
constructor and/or manipulated using the add/remove methods.
Subclasses of BasicAttribute can override get() and getAll()
to get the values dynamically from the directory (or implement
the Attribute interface directly instead of subclassing BasicAttribute).
Note that updates to BasicAttribute (such as adding or removing a value)
does not affect the corresponding representation of the attribute
in the directory. |
BasicAttributes.java | Class | This class provides a basic implementation
of the Attributes interface.
BasicAttributes is either case-sensitive or case-insensitive (case-ignore).
This property is determined at the time the BasicAttributes constructor
is called.
In a case-insensitive BasicAttributes, the case of its attribute identifiers
is ignored when searching for an attribute, or adding attributes.
In a case-sensitive BasicAttributes, the case is significant.
When the BasicAttributes class needs to create an Attribute, it
uses BasicAttribute. |
DirContext.java | Interface | The directory service interface, containing
methods for examining and updating attributes
associated with objects, and for searching the directory.
Names
Each name passed as an argument to a DirContext method is relative
to that context. |
InitialDirContext.java | Class | This class is the starting context for performing
directory operations. |
InvalidAttributeIdentifierException.java | Class | This exception is thrown when an attempt is
made to add to create an attribute with an invalid attribute identifier. |
InvalidAttributesException.java | Class | This exception is thrown when an attempt is
made to add or modify an attribute set that has been specified
incompletely or incorrectly. |
InvalidAttributeValueException.java | Class | This class is thrown when an attempt is
made to add to an attribute a value that conflicts with the attribute's
schema definition. |
InvalidSearchControlsException.java | Class | This exception is thrown when the specification of
the SearchControls for a search operation is invalid. |
InvalidSearchFilterException.java | Class | This exception is thrown when the specification of
a search filter is invalid. |
ModificationItem.java | Class | This class represents a modification item.
It consists of a modification code and an attribute on which to operate.
A ModificationItem instance is not synchronized against concurrent
multithreaded access. |
NoSuchAttributeException.java | Class | This exception is thrown when attempting to access
an attribute that does not exist. |
SchemaViolationException.java | Class | This exception is thrown when a method
in some ways violates the schema. |
SearchControls.java | Class | This class encapsulates
factors that determine scope of search and what gets returned
as a result of the search.
A SearchControls instance is not synchronized against concurrent
multithreaded access. |
SearchResult.java | Class | This class represents an item in the NamingEnumeration returned as a
result of the DirContext.search() methods.
A SearchResult instance is not synchronized against concurrent
multithreaded access. |