0N/A<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
0N/ACopyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved. 0N/ADO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/AThis code is free software; you can redistribute it and/or modify it 0N/Aunder the terms of the GNU General Public License version 2 only, as 0N/Apublished by the Free Software Foundation. Sun designates this 0N/Aparticular file as subject to the "Classpath" exception as provided 0N/Aby Sun in the LICENSE file that accompanied this code. 0N/AThis code is distributed in the hope that it will be useful, but WITHOUT 0N/AANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/AFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/Aversion 2 for more details (a copy is included in the LICENSE file that 0N/Aaccompanied this code). 0N/AYou should have received a copy of the GNU General Public License version 0N/A2 along with this work; if not, write to the Free Software Foundation, 0N/AInc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/APlease contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/ACA 95054 USA or visit www.sun.com if you need additional information or 0N/A<
body bgcolor="white">
0N/Afor accessing directory services.
0N/AThis package defines the directory operations of the Java Naming and
0N/ADirectory Interface<
font size=-
2><
sup>TM</
sup></
font> (JNDI).
0N/AJNDI provides naming and directory functionality to applications
0N/Awritten in the Java programming language. It is designed to be
0N/Aindependent of any specific naming or directory service
0N/Aimplementation. Thus a variety of services--new, emerging, and
0N/Aalready deployed ones--can be accessed in a common way.
0N/AThis package allows applications to retrieve and update attributes
0N/Aassociated with objects stored in a directory, and to search for
0N/Aobjects using specified attributes.
0N/A<
h4>The Directory Context</
h4>
0N/AThe <
tt>DirContext</
tt>
0N/Ainterface represents a <
em>directory context</
em>.
0N/AIt defines methods for examining and updating attributes associated with a
0N/A<
em>directory object</
em>, or <
em>directory entry</
em> as it is sometimes
0N/AYou use <
tt>getAttributes()</
tt> to retrieve the attributes
0N/Aassociated with a directory object (for which you supply the name).
0N/AAttributes are modified using <
tt>modifyAttributes()</
tt>.
0N/AYou can add, replace, or remove attributes
and/
or attribute values
0N/Ausing this operation.
0N/A<
tt>DirContext</
tt> also behaves as a naming context
0N/Aby extending the <
tt>Context</
tt> interface in the <
tt>
javax.naming</
tt> package.
0N/AThis means that any directory object can also provide
0N/AFor example, the directory object for a person might contain
0N/Athe attributes of that person, and at the same time provide
0N/Aa context for naming objects relative to that person
0N/Asuch as his printers and home directory.
0N/A<
tt>DirContext</
tt> contains methods for
0N/Aperforming content-based searching of the directory.
0N/AIn the simplest and most common form of usage, the application
0N/Aspecifies a set of attributes--possibly with specific
0N/Avalues--to match, and submits this attribute set, to the
0N/A<
tt>search()</
tt> method.
0N/AThere are other overloaded forms of <
tt>search()</
tt>
0N/Athat support more sophisticated <
em>search filters</
em>.
0N/A<
h2>Package Specification</
h2>
0N/AThe JNDI API Specification and related documents can be found in the