javax.naming.directory

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » naming » javax.naming.directory 
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 NameTypeComment
Attribute.javaInterface This interface represents an attribute associated with a named object.

In a directory, named objects can have associated with them attributes.

AttributeInUseException.javaClass This exception is thrown when an operation attempts to add an attribute that already exists.
AttributeModificationException.javaClass 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.javaInterface This interface represents a collection of attributes.

In a directory, named objects can have associated with them attributes.

BasicAttribute.javaClass 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.javaClass 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.javaInterface 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.javaClass This class is the starting context for performing directory operations.
InvalidAttributeIdentifierException.javaClass This exception is thrown when an attempt is made to add to create an attribute with an invalid attribute identifier.
InvalidAttributesException.javaClass This exception is thrown when an attempt is made to add or modify an attribute set that has been specified incompletely or incorrectly.
InvalidAttributeValueException.javaClass 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.javaClass This exception is thrown when the specification of the SearchControls for a search operation is invalid.
InvalidSearchFilterException.javaClass This exception is thrown when the specification of a search filter is invalid.
ModificationItem.javaClass 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.javaClass This exception is thrown when attempting to access an attribute that does not exist.
SchemaViolationException.javaClass This exception is thrown when a method in some ways violates the schema.
SearchControls.javaClass 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.javaClass 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.

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.