APIdia Launch Partner
Top Constructors Methods
com.sun.jndi.toolkit.ctx

public abstract Class PartialCompositeDirContext

extends AtomicContext
implements DirContext
Class Inheritance
All Implemented Interfaces
javax.naming.directory.DirContext, javax.naming.Context
Known Direct Subclasses
com.sun.jndi.toolkit.ctx.ComponentDirContext
Imports
java.util.Hashtable, javax.naming.*, javax.naming.directory.*, javax.naming.spi.DirectoryManager

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected void
protected Context
protected void
protected NameParser
protected NamingEnumeration<NameClassPair>
protected NamingEnumeration<Binding>
protected Object
protected void
protected void
protected void
public void
bind(String name, Object obj, Attributes attrs)

Implements javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes.

public void
bind(Name name, Object obj, Attributes attrs)

Implements javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes.

protected StringHeadTail
c_parseComponent(String inputName, Continuation cont)

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.c_parseComponent.

Parse 'inputName' into two parts: head: the first component in this name tail: the rest of the unused name.

public DirContext
createSubcontext(String name, Attributes attrs)

Implements javax.naming.directory.DirContext.createSubcontext.

Creates and binds a new context, along with associated attributes.

public DirContext
createSubcontext(Name name, Attributes attrs)

Implements javax.naming.directory.DirContext.createSubcontext.

Creates and binds a new context, along with associated attributes.

public Attributes
getAttributes(String name)

Implements javax.naming.directory.DirContext.getAttributes.

Retrieves all of the attributes associated with a named object.

public Attributes
getAttributes(Name name)

Implements javax.naming.directory.DirContext.getAttributes.

Retrieves all of the attributes associated with a named object.

public Attributes
getAttributes(String name, String[] attrIds)

Implements javax.naming.directory.DirContext.getAttributes.

Retrieves selected attributes associated with a named object.

public Attributes
getAttributes(Name name, String[] attrIds)

Implements javax.naming.directory.DirContext.getAttributes.

Retrieves selected attributes associated with a named object.

protected static PartialCompositeDirContext
getPCDirContext(Continuation cont)

Retrieves a PartialCompositeDirContext for the resolved object in cont.

public DirContext
getSchema(String name)

Implements javax.naming.directory.DirContext.getSchema.

Retrieves the schema associated with the named object.

public DirContext
getSchema(Name name)

Implements javax.naming.directory.DirContext.getSchema.

Retrieves the schema associated with the named object.

public DirContext
getSchemaClassDefinition(String name)

Implements javax.naming.directory.DirContext.getSchemaClassDefinition.

Retrieves a context containing the schema objects of the named object's class definitions.

public DirContext
getSchemaClassDefinition(Name name)

Implements javax.naming.directory.DirContext.getSchemaClassDefinition.

Retrieves a context containing the schema objects of the named object's class definitions.

public void
modifyAttributes(String name, int mod_op, Attributes attrs)

Implements javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object.

public void
modifyAttributes(Name name, int mod_op, Attributes attrs)

Implements javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object.

public void
modifyAttributes(String name, ModificationItem[] mods)

Implements javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object using an ordered list of modifications.

public void
modifyAttributes(Name name, ModificationItem[] mods)

Implements javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object using an ordered list of modifications.

protected abstract void
p_bind(Name name, Object obj, Attributes attrs, Continuation cont)

protected abstract DirContext
protected abstract Attributes
p_getAttributes(Name name, String[] attrIds, Continuation cont)

protected abstract DirContext
protected abstract DirContext
protected abstract void
p_modifyAttributes(Name name, int mod_op, Attributes attrs, Continuation cont)

protected abstract void
protected abstract void
p_rebind(Name name, Object obj, Attributes attrs, Continuation cont)

protected abstract NamingEnumeration<SearchResult>
p_search(Name name, Attributes matchingAttributes, String[] attributesToReturn, Continuation cont)

protected abstract NamingEnumeration<SearchResult>
p_search(Name name, String filter, SearchControls cons, Continuation cont)

protected abstract NamingEnumeration<SearchResult>
p_search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons, Continuation cont)

public void
rebind(String name, Object obj, Attributes attrs)

Implements javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding.

public void
rebind(Name name, Object obj, Attributes attrs)

Implements javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding.

public NamingEnumeration<SearchResult>
search(String name, Attributes matchingAttributes)

Implements javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes.

public NamingEnumeration<SearchResult>
search(Name name, Attributes matchingAttributes)

Implements javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes.

public NamingEnumeration<SearchResult>
search(String name, Attributes matchingAttributes, String[] attributesToReturn)

Implements javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.

public NamingEnumeration<SearchResult>
search(Name name, Attributes matchingAttributes, String[] attributesToReturn)

Implements javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.

public NamingEnumeration<SearchResult>
search(String name, String filter, SearchControls cons)

Implements javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter.

public NamingEnumeration<SearchResult>
search(Name name, String filter, SearchControls cons)

Implements javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter.

public NamingEnumeration<SearchResult>
search(String name, String filterExpr, Object[] filterArgs, SearchControls cons)

Implements javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter.

public NamingEnumeration<SearchResult>
search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons)

Implements javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter.

Inherited from com.sun.jndi.toolkit.ctx.AtomicContext:
a_bind_nnsa_createSubcontext_nnsa_destroySubcontext_nnsa_getNameParser_nnsa_list_nnsa_listBindings_nnsa_lookup_nnsa_lookupLink_nnsa_processJunction_nnsa_processJunction_nnsa_rebind_nnsa_rename_nnsa_resolveIntermediate_nnsa_unbind_nnsc_bindc_bind_nnsc_createSubcontextc_createSubcontext_nnsc_destroySubcontextc_destroySubcontext_nnsc_getNameParserc_getNameParser_nnsc_listc_list_nnsc_listBindingsc_listBindings_nnsc_lookupc_lookup_nnsc_lookupLinkc_lookupLink_nnsc_rebindc_rebind_nnsc_renamec_rename_nnsc_resolveIntermediate_nnsc_unbindc_unbind_nnsisEmptyresolve_to_contextresolve_to_nns_and_continueresolve_to_penultimate_contextresolve_to_penultimate_context_nns

Constructor Detail

PartialCompositeDirContextback to summary
protected PartialCompositeDirContext()

Method Detail

a_bindback to summary
protected void a_bind(String name, Object obj, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_bind.

a_createSubcontextback to summary
protected Context a_createSubcontext(String name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_createSubcontext.

a_destroySubcontextback to summary
protected void a_destroySubcontext(String name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_destroySubcontext.

a_getNameParserback to summary
protected NameParser a_getNameParser(Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_getNameParser.

a_listback to summary
protected NamingEnumeration<NameClassPair> a_list(Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_list.

a_listBindingsback to summary
protected NamingEnumeration<Binding> a_listBindings(Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_listBindings.

a_lookupback to summary
protected Object a_lookup(String name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_lookup.

a_rebindback to summary
protected void a_rebind(String name, Object obj, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_rebind.

a_renameback to summary
protected void a_rename(String oldname, Name newname, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_rename.

a_unbindback to summary
protected void a_unbind(String name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.a_unbind.

bindback to summary
public void bind(String name, Object obj, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.bind.

Doc from javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes. See bind(Name, Object, Attributes) for details.

Exceptions
NamingException:
if a naming exception is encountered
bindback to summary
public void bind(Name name, Object obj, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.bind.

Doc from javax.naming.directory.DirContext.bind.

Binds a name to an object, along with associated attributes. If attrs is null, the resulting binding will have the attributes associated with obj if obj is a DirContext, and no attributes otherwise. If attrs is non-null, the resulting binding will have attrs as its attributes; any attributes associated with obj are ignored.

Exceptions
NamingException:
if a naming exception is encountered
c_parseComponentback to summary
protected StringHeadTail c_parseComponent(String inputName, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.AtomicContext.c_parseComponent.

Doc from com.sun.jndi.toolkit.ctx.AtomicContext.c_parseComponent.

Parse 'inputName' into two parts: head: the first component in this name tail: the rest of the unused name. Subclasses should provide an implementation for this method which parses inputName using its own name syntax.

createSubcontextback to summary
public DirContext createSubcontext(String name, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.createSubcontext.

Doc from javax.naming.directory.DirContext.createSubcontext.

Creates and binds a new context, along with associated attributes. See createSubcontext(Name, Attributes) for details.

Exceptions
NamingException:
if a naming exception is encountered
createSubcontextback to summary
public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.createSubcontext.

Doc from javax.naming.directory.DirContext.createSubcontext.

Creates and binds a new context, along with associated attributes. This method creates a new subcontext with the given name, binds it in the target context (that named by all but terminal atomic component of the name), and associates the supplied attributes with the newly created object. All intermediate and target contexts must already exist. If attrs is null, this method is equivalent to Context.createSubcontext().

Exceptions
NamingException:
if a naming exception is encountered
getAttributesback to summary
public Attributes getAttributes(String name) throws NamingException

Implements javax.naming.directory.DirContext.getAttributes.

Doc from javax.naming.directory.DirContext.getAttributes.

Retrieves all of the attributes associated with a named object. See getAttributes(Name) for details.

Exceptions
NamingException:
if a naming exception is encountered
getAttributesback to summary
public Attributes getAttributes(Name name) throws NamingException

Implements javax.naming.directory.DirContext.getAttributes.

Doc from javax.naming.directory.DirContext.getAttributes.

Retrieves all of the attributes associated with a named object. See the class description regarding attribute models, attribute type names, and operational attributes.

Exceptions
NamingException:
if a naming exception is encountered
getAttributesback to summary
public Attributes getAttributes(String name, String[] attrIds) throws NamingException

Implements javax.naming.directory.DirContext.getAttributes.

Doc from javax.naming.directory.DirContext.getAttributes.

Retrieves selected attributes associated with a named object. See getAttributes(Name, String[]) for details.

Exceptions
NamingException:
if a naming exception is encountered
getAttributesback to summary
public Attributes getAttributes(Name name, String[] attrIds) throws NamingException

Implements javax.naming.directory.DirContext.getAttributes.

Doc from javax.naming.directory.DirContext.getAttributes.

Retrieves selected attributes associated with a named object. See the class description regarding attribute models, attribute type names, and operational attributes.

If the object does not have an attribute specified, the directory will ignore the nonexistent attribute and return those requested attributes that the object does have.

A directory might return more attributes than was requested (see Attribute Type Names in the class description), but is not allowed to return arbitrary, unrelated attributes.

See also Operational Attributes in the class description.

Exceptions
NamingException:
if a naming exception is encountered
getPCDirContextback to summary
protected static PartialCompositeDirContext getPCDirContext(Continuation cont) throws NamingException

Retrieves a PartialCompositeDirContext for the resolved object in cont. Throws CannotProceedException if not successful.

getSchemaback to summary
public DirContext getSchema(String name) throws NamingException

Implements javax.naming.directory.DirContext.getSchema.

Doc from javax.naming.directory.DirContext.getSchema.

Retrieves the schema associated with the named object. See getSchema(Name) for details.

Exceptions
NamingException:
if a naming exception is encountered
getSchemaback to summary
public DirContext getSchema(Name name) throws NamingException

Implements javax.naming.directory.DirContext.getSchema.

Doc from javax.naming.directory.DirContext.getSchema.

Retrieves the schema associated with the named object. The schema describes rules regarding the structure of the namespace and the attributes stored within it. The schema specifies what types of objects can be added to the directory and where they can be added; what mandatory and optional attributes an object can have. The range of support for schemas is directory-specific.

This method returns the root of the schema information tree that is applicable to the named object. Several named objects (or even an entire directory) might share the same schema.

Issues such as structure and contents of the schema tree, permission to modify to the contents of the schema tree, and the effect of such modifications on the directory are dependent on the underlying directory.

Exceptions
NamingException:
if a naming exception is encountered
getSchemaClassDefinitionback to summary
public DirContext getSchemaClassDefinition(String name) throws NamingException

Implements javax.naming.directory.DirContext.getSchemaClassDefinition.

Doc from javax.naming.directory.DirContext.getSchemaClassDefinition.

Retrieves a context containing the schema objects of the named object's class definitions. See getSchemaClassDefinition(Name) for details.

Exceptions
NamingException:
if a naming exception is encountered
getSchemaClassDefinitionback to summary
public DirContext getSchemaClassDefinition(Name name) throws NamingException

Implements javax.naming.directory.DirContext.getSchemaClassDefinition.

Doc from javax.naming.directory.DirContext.getSchemaClassDefinition.

Retrieves a context containing the schema objects of the named object's class definitions.

One category of information found in directory schemas is class definitions. An "object class" definition specifies the object's type and what attributes (mandatory and optional) the object must/can have. Note that the term "object class" being referred to here is in the directory sense rather than in the Java sense. For example, if the named object is a directory object of "Person" class, getSchemaClassDefinition() would return a DirContext representing the (directory's) object class definition of "Person".

The information that can be retrieved from an object class definition is directory-dependent.

Prior to JNDI 1.2, this method returned a single schema object representing the class definition of the named object. Since JNDI 1.2, this method returns a DirContext containing all of the named object's class definitions.

Exceptions
NamingException:
if a naming exception is encountered
modifyAttributesback to summary
public void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.modifyAttributes.

Doc from javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object. See modifyAttributes(Name, int, Attributes) for details.

Exceptions
NamingException:
if a naming exception is encountered
modifyAttributesback to summary
public void modifyAttributes(Name name, int mod_op, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.modifyAttributes.

Doc from javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object. The order of the modifications is not specified. Where possible, the modifications are performed atomically.

Exceptions
NamingException:
if a naming exception is encountered
modifyAttributesback to summary
public void modifyAttributes(String name, ModificationItem[] mods) throws NamingException

Implements javax.naming.directory.DirContext.modifyAttributes.

Doc from javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object using an ordered list of modifications. See modifyAttributes(Name, ModificationItem[]) for details.

Exceptions
NamingException:
if a naming exception is encountered
modifyAttributesback to summary
public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException

Implements javax.naming.directory.DirContext.modifyAttributes.

Doc from javax.naming.directory.DirContext.modifyAttributes.

Modifies the attributes associated with a named object using an ordered list of modifications. The modifications are performed in the order specified. Each modification specifies a modification operation code and an attribute on which to operate. Where possible, the modifications are performed atomically.

Exceptions
NamingException:
if a naming exception is encountered
p_bindback to summary
protected abstract void p_bind(Name name, Object obj, Attributes attrs, Continuation cont) throws NamingException
p_createSubcontextback to summary
protected abstract DirContext p_createSubcontext(Name name, Attributes attrs, Continuation cont) throws NamingException
p_getAttributesback to summary
protected abstract Attributes p_getAttributes(Name name, String[] attrIds, Continuation cont) throws NamingException
p_getSchemaback to summary
protected abstract DirContext p_getSchema(Name name, Continuation cont) throws NamingException
p_getSchemaClassDefinitionback to summary
protected abstract DirContext p_getSchemaClassDefinition(Name name, Continuation cont) throws NamingException
p_modifyAttributesback to summary
protected abstract void p_modifyAttributes(Name name, int mod_op, Attributes attrs, Continuation cont) throws NamingException
p_modifyAttributesback to summary
protected abstract void p_modifyAttributes(Name name, ModificationItem[] mods, Continuation cont) throws NamingException
p_rebindback to summary
protected abstract void p_rebind(Name name, Object obj, Attributes attrs, Continuation cont) throws NamingException
p_searchback to summary
protected abstract NamingEnumeration<SearchResult> p_search(Name name, Attributes matchingAttributes, String[] attributesToReturn, Continuation cont) throws NamingException
p_searchback to summary
protected abstract NamingEnumeration<SearchResult> p_search(Name name, String filter, SearchControls cons, Continuation cont) throws NamingException
p_searchback to summary
protected abstract NamingEnumeration<SearchResult> p_search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons, Continuation cont) throws NamingException
rebindback to summary
public void rebind(String name, Object obj, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.rebind.

Doc from javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding. See rebind(Name, Object, Attributes) for details.

Exceptions
NamingException:
if a naming exception is encountered
rebindback to summary
public void rebind(Name name, Object obj, Attributes attrs) throws NamingException

Implements javax.naming.directory.DirContext.rebind.

Doc from javax.naming.directory.DirContext.rebind.

Binds a name to an object, along with associated attributes, overwriting any existing binding. If attrs is null and obj is a DirContext, the attributes from obj are used. If attrs is null and obj is not a DirContext, any existing attributes associated with the object already bound in the directory remain unchanged. If attrs is non-null, any existing attributes associated with the object already bound in the directory are removed and attrs is associated with the named object. If obj is a DirContext and attrs is non-null, the attributes of obj are ignored.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes. See search(Name, Attributes) for details.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes. This method returns all the attributes of such objects. It is equivalent to supplying null as the attributesToReturn parameter to the method search(Name, Attributes, String[]).
See search(Name, Attributes, String[]) for a full description.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes. See search(Name, Attributes, String[]) for details.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes. The search is performed using the default SearchControls settings.

For an object to be selected, each attribute in matchingAttributes must match some attribute of the object. If matchingAttributes is empty or null, all objects in the target context are returned.

An attribute A1 in matchingAttributes is considered to match an attribute A2 of an object if A1 and A2 have the same identifier, and each value of A1 is equal to some value of A2. This implies that the order of values is not significant, and that A2 may contain "extra" values not found in A1 without affecting the comparison. It also implies that if A1 has no values, then testing for a match is equivalent to testing for the presence of an attribute A2 with the same identifier.

The precise definition of "equality" used in comparing attribute values is defined by the underlying directory service. It might use the Object.equals method, for example, or might use a schema to specify a different equality operation. For matching based on operations other than equality (such as substring comparison) use the version of the search method that takes a filter argument.

When changes are made to this DirContext, the effect on enumerations returned by prior calls to this method is undefined.

If the object does not have the attribute specified, the directory will ignore the nonexistent attribute and return the requested attributes that the object does have.

A directory might return more attributes than was requested (see Attribute Type Names in the class description), but is not allowed to return arbitrary, unrelated attributes.

See also Operational Attributes in the class description.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls. See search(Name, String, SearchControls) for details.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(Name name, String filter, SearchControls cons) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.

The format and interpretation of filter follows RFC 2254 with the following interpretations for attr and value mentioned in the RFC.

attr is the attribute's identifier.

value is the string representation the attribute's value. The translation of this string representation into the attribute's value is directory-specific.

For the assertion "someCount=127", for example, attr is "someCount" and value is "127". The provider determines, based on the attribute ID ("someCount") (and possibly its schema), that the attribute's value is an integer. It then parses the string "127" appropriately.

Any non-ASCII characters in the filter string should be represented by the appropriate Java (Unicode) characters, and not encoded as UTF-8 octets. Alternately, the "backslash-hexcode" notation described in RFC 2254 may be used.

If the directory does not support a string representation of some or all of its attributes, the form of search that accepts filter arguments in the form of Objects can be used instead. The service provider for such a directory would then translate the filter arguments to its service-specific representation for filter evaluation. See search(Name, String, Object[], SearchControls).

RFC 2254 defines certain operators for the filter, including substring matches, equality, approximate match, greater than, less than. These operators are mapped to operators with corresponding semantics in the underlying directory. For example, for the equals operator, suppose the directory has a matching rule defining "equality" of the attributes in the filter. This rule would be used for checking equality of the attributes specified in the filter with the attributes of objects in the directory. Similarly, if the directory has a matching rule for ordering, this rule would be used for making "greater than" and "less than" comparisons.

Not all of the operators defined in RFC 2254 are applicable to all attributes. When an operator is not applicable, the exception InvalidSearchFilterException is thrown.

The result is returned in an enumeration of SearchResults. Each SearchResult contains the name of the object and other information about the object (see SearchResult). The name is either relative to the target context of the search (which is named by the name parameter), or it is a URL string. If the target context is included in the enumeration (as is possible when cons specifies a search scope of SearchControls.OBJECT_SCOPE or SearchControls.SUBSTREE_SCOPE), its name is the empty string. The SearchResult may also contain attributes of the matching object if the cons argument specified that attributes be returned.

If the object does not have a requested attribute, that nonexistent attribute will be ignored. Those requested attributes that the object does have will be returned.

A directory might return more attributes than were requested (see Attribute Type Names in the class description) but is not allowed to return arbitrary, unrelated attributes.

See also Operational Attributes in the class description.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls. See search(Name, String, Object[], SearchControls) for details.

Exceptions
NamingException:
if a naming exception is encountered
searchback to summary
public NamingEnumeration<SearchResult> search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException

Implements javax.naming.directory.DirContext.search.

Doc from javax.naming.directory.DirContext.search.

Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.

The interpretation of filterExpr is based on RFC 2254. It may additionally contain variables of the form {i} -- where i is an integer -- that refer to objects in the filterArgs array. The interpretation of filterExpr is otherwise identical to that of the filter parameter of the method search(Name, String, SearchControls).

When a variable {i} appears in a search filter, it indicates that the filter argument filterArgs[i] is to be used in that place. Such variables may be used wherever an attr, value, or matchingrule production appears in the filter grammar of RFC 2254, section 4. When a string-valued filter argument is substituted for a variable, the filter is interpreted as if the string were given in place of the variable, with any characters having special significance within filters (such as '*') having been escaped according to the rules of RFC 2254.

For directories that do not use a string representation for some or all of their attributes, the filter argument corresponding to an attribute value may be of a type other than String. Directories that support unstructured binary-valued attributes, for example, should accept byte arrays as filter arguments. The interpretation (if any) of filter arguments of any other type is determined by the service provider for that directory, which maps the filter operations onto operations with corresponding semantics in the underlying directory.

This method returns an enumeration of the results. Each element in the enumeration contains the name of the object and other information about the object (see SearchResult). The name is either relative to the target context of the search (which is named by the name parameter), or it is a URL string. If the target context is included in the enumeration (as is possible when cons specifies a search scope of SearchControls.OBJECT_SCOPE or SearchControls.SUBSTREE_SCOPE), its name is the empty string.

The SearchResult may also contain attributes of the matching object if the cons argument specifies that attributes be returned.

If the object does not have a requested attribute, that nonexistent attribute will be ignored. Those requested attributes that the object does have will be returned.

A directory might return more attributes than were requested (see Attribute Type Names in the class description) but is not allowed to return arbitrary, unrelated attributes.

If a search filter with invalid variable substitutions is provided to this method, the result is undefined. When changes are made to this DirContext, the effect on enumerations returned by prior calls to this method is undefined.

See also Operational Attributes in the class description.

Exceptions
NamingException:
if a naming exception is encountered