![]() ![]() ![]() ![]() |
JNDI Overview |
This packageextends the javax.naming
package to provide functionality for accessing directory services in addition to naming services. This package allows applications to retrieve attributes associated with objects stored in the directory and to search for objects using specified attributes.
The Directory Context
The DirContextinterface represents a directory context. It defines methods for examining and updating attributes associated with a directory object.
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. This means that any directory object can also provide a naming context. For example, a directory object for a person might contain attributes about that person and at the same time provide a context for naming objects such as his printers and file system relative to that person directory object.
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.
![]() ![]() ![]() ![]() |
JNDI Overview |