javax.naming package to provide functionality
for accessing directory services.
This package defines the directory operations of the Java Naming and Directory Interface™ (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 ContextThe
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
getAttributes() to retrieve the attributes
associated with a directory object (for which you supply the name).
Attributes are modified using
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
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.
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
There are other overloaded forms of
that support more sophisticated search filters.
Package SpecificationThe JNDI API Specification and related documents can be found in the JNDI documentation.
Interface Summary Interface Description AttributeThis interface represents an attribute associated with a named object. AttributesThis interface represents a collection of attributes. DirContextThe directory service interface, containing methods for examining and updating attributes associated with objects, and for searching the directory.
Class Summary Class Description BasicAttributeThis class provides a basic implementation of the
BasicAttributesThis class provides a basic implementation of the Attributes interface. InitialDirContextThis class is the starting context for performing directory operations. ModificationItemThis class represents a modification item. SearchControlsThis class encapsulates factors that determine scope of search and what gets returned as a result of the search. SearchResultThis class represents an item in the NamingEnumeration returned as a result of the DirContext.search() methods.
Exception Summary Exception Description AttributeInUseExceptionThis exception is thrown when an operation attempts to add an attribute that already exists. AttributeModificationExceptionThis 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. InvalidAttributeIdentifierExceptionThis exception is thrown when an attempt is made to add to create an attribute with an invalid attribute identifier. InvalidAttributesExceptionThis exception is thrown when an attempt is made to add or modify an attribute set that has been specified incompletely or incorrectly. InvalidAttributeValueExceptionThis class is thrown when an attempt is made to add to an attribute a value that conflicts with the attribute's schema definition. InvalidSearchControlsExceptionThis exception is thrown when the specification of the SearchControls for a search operation is invalid. InvalidSearchFilterExceptionThis exception is thrown when the specification of a search filter is invalid. NoSuchAttributeExceptionThis exception is thrown when attempting to access an attribute that does not exist. SchemaViolationExceptionThis exception is thrown when a method in some ways violates the schema.