jdk/src/java.naming/share/classes/javax/naming/directory/DirContext.java
author sspitsyn
Wed, 07 Sep 2016 03:35:45 +0000
changeset 40963 c7c990c4ec68
parent 32029 a5538163e144
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.naming.directory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.naming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * The directory service interface, containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * methods for examining and updating attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * associated with objects, and for searching the directory.
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
    34
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
    35
 * <h1>Names</h1>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    36
 * Each name passed as an argument to a {@code DirContext} method is relative
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * to that context.  The empty name is used to name the context itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * The name parameter may never be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * Most of the methods have overloaded versions with one taking a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <code>Name</code> parameter and one taking a <code>String</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * These overloaded versions are equivalent in that if
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * the <code>Name</code> and <code>String</code> parameters are just
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * different representations of the same name, then the overloaded
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * versions of the same methods behave the same.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * In the method descriptions below, only one version is documented.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * The second version instead has a link to the first:  the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * documentation applies to both.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    50
 * See {@code Context} for a discussion on the interpretation of the
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    51
 * name argument to the {@code Context} methods. These same rules
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    52
 * apply to the name argument to the {@code DirContext} methods.
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
    53
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
    54
 * <h1>Attribute Models</h1>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * There are two basic models of what attributes should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * associated with.  First, attributes may be directly associated with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * DirContext object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * In this model, an attribute operation on the named object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * roughly equivalent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * to a lookup on the name (which returns the DirContext object),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * followed by the attribute operation invoked on the DirContext object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * in which the caller supplies an empty name. The attributes can be viewed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * as being stored along with the object (note that this does not imply that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * the implementation must do so).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * The second model is that attributes are associated with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * name (typically an atomic name) in a DirContext.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * In this model, an attribute operation on the named object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * roughly equivalent to a lookup on the name of the parent DirContext of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * named object, followed by the attribute operation invoked on the parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * in which the caller supplies the terminal atomic name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * The attributes can be viewed as being stored in the parent DirContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * (again, this does not imply that the implementation must do so).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * Objects that are not DirContexts can have attributes, as long as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * their parents are DirContexts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * JNDI support both of these models.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * It is up to the individual service providers to decide where to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * "store" attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * JNDI clients are safest when they do not make assumptions about
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * whether an object's attributes are stored as part of the object, or stored
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * within the parent object and associated with the object's name.
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
    83
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
    84
 * <h1>Attribute Type Names</h1>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
    85
 * In the {@code getAttributes()} and {@code search()} methods,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
 * you can supply the attributes to return by supplying a list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * attribute names (strings).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * The attributes that you get back might not have the same names as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * attribute names you have specified. This is because some directories
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * support features that cause them to return other attributes.  Such
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
 * features include attribute subclassing, attribute name synonyms, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * attribute language codes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * In attribute subclassing, attributes are defined in a class hierarchy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * In some directories, for example, the "name" attribute might be the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * superclass of all name-related attributes, including "commonName" and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * "surName".  Asking for the "name" attribute might return both the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 * "commonName" and "surName" attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * With attribute type synonyms, a directory can assign multiple names to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * the same attribute. For example, "cn" and "commonName" might both
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * refer to the same attribute. Asking for "cn" might return the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * "commonName" attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * Some directories support the language codes for attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * Asking such a directory for the "description" attribute, for example,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * might return all of the following attributes:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
 * <li>description
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * <li>description;lang-en
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * <li>description;lang-de
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * <li>description;lang-fr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
 *
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
   115
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
   116
 *<h1>Operational Attributes</h1>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * Some directories have the notion of "operational attributes" which are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * attributes associated with a directory object for administrative
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * purposes. An example of operational attributes is the access control
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * list for an object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   123
 * In the {@code getAttributes()} and {@code search()} methods,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
 * you can specify that all attributes associated with the requested objects
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   125
 * be returned by supply {@code null} as the list of attributes to return.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
 * The attributes returned do <em>not</em> include operational attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
 * In order to retrieve operational attributes, you must name them explicitly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
 *
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
   129
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
   130
 * <h1>Named Context</h1>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
 * There are certain methods in which the name must resolve to a context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
 * (for example, when searching a single level context). The documentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
 * of such methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
 * use the term <em>named context</em> to describe their name parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
 * For these methods, if the named object is not a DirContext,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
 * <code>NotContextException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
 * Aside from these methods, there is no requirement that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
 * <em>named object</em> be a DirContext.
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
   140
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
   141
 *<h1>Parameters</h1>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
 *<p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   143
 * An {@code Attributes}, {@code SearchControls}, or array object
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
 * passed as a parameter to any method will not be modified by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
 * service provider.  The service provider may keep a reference to it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
 * for the duration of the operation, including any enumeration of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
 * method's results and the processing of any referrals generated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
 * The caller should not modify the object during this time.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   149
 * An {@code Attributes} object returned by any method is owned by
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
 * the caller.  The caller may subsequently modify it; the service
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
 * provider will not.
21285
e740104a04f1 8026840: Fix new doclint issues in javax.naming
darcy
parents: 18580
diff changeset
   152
 *
18580
6c4badf4ffba 8019407: Fix doclint issues in javax.naming.*
darcy
parents: 5506
diff changeset
   153
 *<h1>Exceptions</h1>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
 *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
 * All the methods in this interface can throw a NamingException or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
 * any of its subclasses. See NamingException and their subclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
 * for details on each exception.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
 * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
 * @author Scott Seligman
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
 * @author R. Vasudevan
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
 * @see javax.naming.Context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
public interface DirContext extends Context {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Retrieves all of the attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * See the class description regarding attribute models, attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * type names, and operational attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     *          the name of the object from which to retrieve attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * @return  the set of attributes associated with <code>name</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     *          Returns an empty attribute set if name has no attributes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     *          never null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @see #getAttributes(String)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @see #getAttributes(Name, String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    public Attributes getAttributes(Name name) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Retrieves all of the attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * See {@link #getAttributes(Name)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *          the name of the object from which to retrieve attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @return  the set of attributes associated with <code>name</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public Attributes getAttributes(String name) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Retrieves selected attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * See the class description regarding attribute models, attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * type names, and operational attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <p> If the object does not have an attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * specified, the directory will ignore the nonexistent attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * and return those requested attributes that the object does have.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * <p> A directory might return more attributes than was requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * (see <strong>Attribute Type Names</strong> in the class description),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * but is not allowed to return arbitrary, unrelated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * <p> See also <strong>Operational Attributes</strong> in the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *          the name of the object from which to retrieve attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @param attrIds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *          the identifiers of the attributes to retrieve.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     *          null indicates that all attributes should be retrieved;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *          an empty array indicates that none should be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @return  the requested attributes; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public Attributes getAttributes(Name name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * Retrieves selected attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * See {@link #getAttributes(Name, String[])} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     *          The name of the object from which to retrieve attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @param attrIds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     *          the identifiers of the attributes to retrieve.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     *          null indicates that all attributes should be retrieved;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     *          an empty array indicates that none should be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * @return  the requested attributes; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    public Attributes getAttributes(String name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * This constant specifies to add an attribute with the specified values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * If attribute does not exist,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * create the attribute.  The resulting attribute has a union of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * specified value set and the prior value set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * Adding an attribute with no value will throw
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * <code>InvalidAttributeValueException</code> if the attribute must have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * at least  one value.  For a single-valued attribute where that attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * already exists, throws <code>AttributeInUseException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * If attempting to add more than one value to a single-valued attribute,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * throws <code>InvalidAttributeValueException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   257
     * The value of this constant is {@code 1}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @see ModificationItem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * @see #modifyAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public final static int ADD_ATTRIBUTE = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * This constant specifies to replace an attribute with specified values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * If attribute already exists,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * replaces all existing values with new specified values.  If the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * attribute does not exist, creates it.  If no value is specified,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * deletes all the values of the attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * Removal of the last value will remove the attribute if the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * is required to have at least one value.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * attempting to add more than one value to a single-valued attribute,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * throws <code>InvalidAttributeValueException</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   276
     * The value of this constant is {@code 2}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @see ModificationItem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @see #modifyAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    public final static int REPLACE_ATTRIBUTE = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * This constant specifies to delete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * the specified attribute values from the attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * The resulting attribute has the set difference of its prior value set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * and the specified value set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * If no values are specified, deletes the entire attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * If the attribute does not exist, or if some or all members of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * specified value set do not exist, this absence may be ignored
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * and the operation succeeds, or a NamingException may be thrown to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * indicate the absence.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * Removal of the last value will remove the attribute if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * attribute is required to have at least one value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   297
     * The value of this constant is {@code 3}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * @see ModificationItem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @see #modifyAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    public final static int REMOVE_ATTRIBUTE = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * Modifies the attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * The order of the modifications is not specified.  Where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * possible, the modifications are performed atomically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     *          the name of the object whose attributes will be updated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @param mod_op
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     *          the modification operation, one of:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *                  <code>ADD_ATTRIBUTE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     *                  <code>REPLACE_ATTRIBUTE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     *                  <code>REMOVE_ATTRIBUTE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *          the attributes to be used for the modification; may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * @throws  AttributeModificationException if the modification cannot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     *          be completed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * @see #modifyAttributes(Name, ModificationItem[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    public void modifyAttributes(Name name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * Modifies the attributes associated with a named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * See {@link #modifyAttributes(Name, int, Attributes)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *          the name of the object whose attributes will be updated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @param mod_op
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     *          the modification operation, one of:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     *                  <code>ADD_ATTRIBUTE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *                  <code>REPLACE_ATTRIBUTE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     *                  <code>REMOVE_ATTRIBUTE</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *          the attributes to be used for the modification; may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @throws  AttributeModificationException if the modification cannot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     *          be completed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    public void modifyAttributes(String name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * Modifies the attributes associated with a named object using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * an ordered list of modifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * The modifications are performed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * in the order specified.  Each modification specifies a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * modification operation code and an attribute on which to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * operate.  Where possible, the modifications are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * performed atomically.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *          the name of the object whose attributes will be updated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * @param mods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     *          an ordered sequence of modifications to be performed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *          may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * @throws  AttributeModificationException if the modifications
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     *          cannot be completed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @see #modifyAttributes(Name, int, Attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * @see ModificationItem
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public void modifyAttributes(Name name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * Modifies the attributes associated with a named object using
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * an ordered list of modifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * See {@link #modifyAttributes(Name, ModificationItem[])} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     *          the name of the object whose attributes will be updated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * @param mods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     *          an ordered sequence of modifications to be performed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     *          may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @throws  AttributeModificationException if the modifications
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     *          cannot be completed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    public void modifyAttributes(String name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * Binds a name to an object, along with associated attributes.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   394
     * If {@code attrs} is null, the resulting binding will have
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   395
     * the attributes associated with {@code obj} if {@code obj} is a
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   396
     * {@code DirContext}, and no attributes otherwise.
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   397
     * If {@code attrs} is non-null, the resulting binding will have
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   398
     * {@code attrs} as its attributes; any attributes associated with
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   399
     * {@code obj} are ignored.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *          the name to bind; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @param obj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     *          the object to bind; possibly null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     *          the attributes to associate with the binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * @throws  NameAlreadyBoundException if name is already bound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * @throws  InvalidAttributesException if some "mandatory" attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     *          of the binding are not supplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * @see Context#bind(Name, Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @see #rebind(Name, Object, Attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    public void bind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Binds a name to an object, along with associated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * See {@link #bind(Name, Object, Attributes)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     *          the name to bind; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * @param obj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     *          the object to bind; possibly null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     *          the attributes to associate with the binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @throws  NameAlreadyBoundException if name is already bound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @throws  InvalidAttributesException if some "mandatory" attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *          of the binding are not supplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public void bind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * Binds a name to an object, along with associated attributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * overwriting any existing binding.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   441
     * If {@code attrs} is null and {@code obj} is a {@code DirContext},
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   442
     * the attributes from {@code obj} are used.
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   443
     * If {@code attrs} is null and {@code obj} is not a {@code DirContext},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * any existing attributes associated with the object already bound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * in the directory remain unchanged.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   446
     * If {@code attrs} is non-null, any existing attributes associated with
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   447
     * the object already bound in the directory are removed and {@code attrs}
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   448
     * is associated with the named object.  If {@code obj} is a
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   449
     * {@code DirContext} and {@code attrs} is non-null, the attributes
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   450
     * of {@code obj} are ignored.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     *          the name to bind; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * @param obj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     *          the object to bind; possibly null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     *          the attributes to associate with the binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * @throws  InvalidAttributesException if some "mandatory" attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     *          of the binding are not supplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @see Context#bind(Name, Object)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @see #bind(Name, Object, Attributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
    public void rebind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * Binds a name to an object, along with associated attributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * overwriting any existing binding.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * See {@link #rebind(Name, Object, Attributes)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     *          the name to bind; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @param obj
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     *          the object to bind; possibly null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     *          the attributes to associate with the binding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @throws  InvalidAttributesException if some "mandatory" attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     *          of the binding are not supplied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    public void rebind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * Creates and binds a new context, along with associated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * This method creates a new subcontext with the given name, binds it in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * the target context (that named by all but terminal atomic
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * component of the name), and associates the supplied attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * with the newly created object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * All intermediate and target contexts must already exist.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   495
     * If {@code attrs} is null, this method is equivalent to
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   496
     * {@code Context.createSubcontext()}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     *          the name of the context to create; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     *          the attributes to associate with the newly created context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @return  the newly created context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @throws  NameAlreadyBoundException if the name is already bound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * @throws  InvalidAttributesException if <code>attrs</code> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     *          contain all the mandatory attributes required for creation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @see Context#createSubcontext(Name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
    public DirContext createSubcontext(Name name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Creates and binds a new context, along with associated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * See {@link #createSubcontext(Name, Attributes)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     *          the name of the context to create; may not be empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * @param attrs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     *          the attributes to associate with the newly created context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @return  the newly created context
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * @throws  NameAlreadyBoundException if the name is already bound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * @throws  InvalidAttributesException if <code>attrs</code> does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     *          contain all the mandatory attributes required for creation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    public DirContext createSubcontext(String name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
// -------------------- schema operations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * Retrieves the schema associated with the named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * The schema describes rules regarding the structure of the namespace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * and the attributes stored within it.  The schema
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * specifies what types of objects can be added to the directory and where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * they can be added; what mandatory and optional attributes an object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * can have. The range of support for schemas is directory-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * <p> This method returns the root of the schema information tree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * that is applicable to the named object. Several named objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * (or even an entire directory) might share the same schema.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * <p> Issues such as structure and contents of the schema tree,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * permission to modify to the contents of the schema
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * tree, and the effect of such modifications on the directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * are dependent on the underlying directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     *          the name of the object whose schema is to be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * @return  the schema associated with the context; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * @throws  OperationNotSupportedException if schema not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
    public DirContext getSchema(Name name) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * Retrieves the schema associated with the named object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * See {@link #getSchema(Name)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     *          the name of the object whose schema is to be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * @return  the schema associated with the context; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * @throws  OperationNotSupportedException if schema not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
    public DirContext getSchema(String name) throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * Retrieves a context containing the schema objects of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * named object's class definitions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * One category of information found in directory schemas is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * <em>class definitions</em>.  An "object class" definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * specifies the object's <em>type</em> and what attributes (mandatory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * and optional) the object must/can have. Note that the term
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * "object class" being referred to here is in the directory sense
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * rather than in the Java sense.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * For example, if the named object is a directory object of
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   582
     * "Person" class, {@code getSchemaClassDefinition()} would return a
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   583
     * {@code DirContext} representing the (directory's) object class
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * definition of "Person".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * The information that can be retrieved from an object class definition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * is directory-dependent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * Prior to JNDI 1.2, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * returned a single schema object representing the class definition of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * the named object.
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   592
     * Since JNDI 1.2, this method returns a {@code DirContext} containing
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * all of the named object's class definitions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     *          the name of the object whose object class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     *          definition is to be retrieved
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   598
     * @return  the {@code DirContext} containing the named
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     *          object's class definitions; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * @throws  OperationNotSupportedException if schema not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    public DirContext getSchemaClassDefinition(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * Retrieves a context containing the schema objects of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * named object's class definitions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * See {@link #getSchemaClassDefinition(Name)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     *          the name of the object whose object class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     *          definition is to be retrieved
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   615
     * @return  the {@code DirContext} containing the named
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     *          object's class definitions; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @throws  OperationNotSupportedException if schema not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
    public DirContext getSchemaClassDefinition(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
            throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
// -------------------- search operations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * Searches in a single context for objects that contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     * specified set of attributes, and retrieves selected attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     * The search is performed using the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * <code>SearchControls</code> settings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * For an object to be selected, each attribute in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     * <code>matchingAttributes</code> must match some attribute of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     * object.  If <code>matchingAttributes</code> is empty or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * null, all objects in the target context are returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * An attribute <em>A</em><sub>1</sub> in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * <code>matchingAttributes</code> is considered to match an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * attribute <em>A</em><sub>2</sub> of an object if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * <em>A</em><sub>1</sub> and <em>A</em><sub>2</sub> have the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * identifier, and each value of <em>A</em><sub>1</sub> is equal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * to some value of <em>A</em><sub>2</sub>.  This implies that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * order of values is not significant, and that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * <em>A</em><sub>2</sub> may contain "extra" values not found in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * <em>A</em><sub>1</sub> without affecting the comparison.  It
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * also implies that if <em>A</em><sub>1</sub> has no values, then
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * testing for a match is equivalent to testing for the presence
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * of an attribute <em>A</em><sub>2</sub> with the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * The precise definition of "equality" used in comparing attribute values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * is defined by the underlying directory service.  It might use the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * <code>Object.equals</code> method, for example, or might use a schema
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * to specify a different equality operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     * For matching based on operations other than equality (such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * substring comparison) use the version of the <code>search</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * method that takes a filter argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   659
     * When changes are made to this {@code DirContext},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * the effect on enumerations returned by prior calls to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * is undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * If the object does not have the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * specified, the directory will ignore the nonexistent attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * and return the requested attributes that the object does have.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * A directory might return more attributes than was requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * (see <strong>Attribute Type Names</strong> in the class description),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * but is not allowed to return arbitrary, unrelated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     * See also <strong>Operational Attributes</strong> in the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     * description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     *          the name of the context to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * @param matchingAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     *          the attributes to search for.  If empty or null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     *          all objects in the target context are returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * @param attributesToReturn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     *          the attributes to return.  null indicates that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     *          all attributes are to be returned;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     *          an empty array indicates that none are to be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * @return
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   684
     *          a non-null enumeration of {@code SearchResult} objects.
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   685
     *          Each {@code SearchResult} contains the attributes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     *          identified by <code>attributesToReturn</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     *          and the name of the corresponding object, named relative
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     *          to the context named by <code>name</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @see SearchControls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * @see SearchResult
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * @see #search(Name, String, Object[], SearchControls)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     * Searches in a single context for objects that contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * specified set of attributes, and retrieves selected attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * See {@link #search(Name, Attributes, String[])} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     *          the name of the context to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * @param matchingAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *          the attributes to search for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * @param attributesToReturn
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     *          the attributes to return
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   712
     * @return  a non-null enumeration of {@code SearchResult} objects
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * Searches in a single context for objects that contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * specified set of attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * This method returns all the attributes of such objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * It is equivalent to supplying null as
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   726
     * the {@code attributesToReturn} parameter to the method
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * <code>search(Name, Attributes, String[])</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * <br>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * See {@link #search(Name, Attributes, String[])} for a full description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     *          the name of the context to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * @param matchingAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     *          the attributes to search for
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   735
     * @return  an enumeration of {@code SearchResult} objects
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @see #search(Name, Attributes, String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
        search(Name name, Attributes matchingAttributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     * Searches in a single context for objects that contain a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * specified set of attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * See {@link #search(Name, Attributes)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     *          the name of the context to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * @param matchingAttributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     *          the attributes to search for
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   753
     * @return  an enumeration of {@code SearchResult} objects
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
        search(String name, Attributes matchingAttributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * Searches in the named context or object for entries that satisfy the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     * given search filter.  Performs the search as specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * the search controls.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * The format and interpretation of <code>filter</code> follows RFC 2254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * following interpretations for <code>attr</code> and <code>value</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * mentioned in the RFC.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * <code>attr</code> is the attribute's identifier.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * <code>value</code> is the string representation the attribute's value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * The translation of this string representation into the attribute's value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * is directory-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * For the assertion "someCount=127", for example, <code>attr</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * is "someCount" and <code>value</code> is "127".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * The provider determines, based on the attribute ID ("someCount")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * (and possibly its schema), that the attribute's value is an integer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * It then parses the string "127" appropriately.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * Any non-ASCII characters in the filter string should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     * represented by the appropriate Java (Unicode) characters, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * not encoded as UTF-8 octets.  Alternately, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * "backslash-hexcode" notation described in RFC 2254 may be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * If the directory does not support a string representation of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * some or all of its attributes, the form of <code>search</code> that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * accepts filter arguments in the form of Objects can be used instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * The service provider for such a directory would then translate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * the filter arguments to its service-specific representation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * for filter evaluation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * See <code>search(Name, String, Object[], SearchControls)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * RFC 2254 defines certain operators for the filter, including substring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * matches, equality, approximate match, greater than, less than.  These
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * operators are mapped to operators with corresponding semantics in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     * underlying directory. For example, for the equals operator, suppose
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * the directory has a matching rule defining "equality" of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     * attributes in the filter. This rule would be used for checking
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     * equality of the attributes specified in the filter with the attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * of objects in the directory. Similarly, if the directory has a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     * matching rule for ordering, this rule would be used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * making "greater than" and "less than" comparisons.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * Not all of the operators defined in RFC 2254 are applicable to all
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * attributes.  When an operator is not applicable, the exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * <code>InvalidSearchFilterException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     * <p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   810
     * The result is returned in an enumeration of {@code SearchResult}s.
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   811
     * Each {@code SearchResult} contains the name of the object
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * and other information about the object (see SearchResult).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * The name is either relative to the target context of the search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * (which is named by the <code>name</code> parameter), or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * it is a URL string. If the target context is included in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * the enumeration (as is possible when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * <code>cons</code> specifies a search scope of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * <code>SearchControls.OBJECT_SCOPE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * <code>SearchControls.SUBSTREE_SCOPE</code>), its name is the empty
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   820
     * string. The {@code SearchResult} may also contain attributes of the
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   821
     * matching object if the {@code cons} argument specified that attributes
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * If the object does not have a requested attribute, that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * nonexistent attribute will be ignored.  Those requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * attributes that the object does have will be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * A directory might return more attributes than were requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * (see <strong>Attribute Type Names</strong> in the class description)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * but is not allowed to return arbitrary, unrelated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * See also <strong>Operational Attributes</strong> in the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     *          the name of the context or object to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * @param filter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     *          the filter expression to use for the search; may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @param cons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     *          the search controls that control the search.  If null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     *          the default search controls are used (equivalent
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   842
     *          to {@code (new SearchControls())}).
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   843
     * @return  an enumeration of {@code SearchResult}s of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     *          the objects that satisfy the filter; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * @throws  InvalidSearchFilterException if the search filter specified is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *          not supported or understood by the underlying directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * @throws  InvalidSearchControlsException if the search controls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     *          contain invalid settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * @see #search(Name, String, Object[], SearchControls)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * @see SearchControls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @see SearchResult
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * Searches in the named context or object for entries that satisfy the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * given search filter.  Performs the search as specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * the search controls.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     * See {@link #search(Name, String, SearchControls)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     *          the name of the context or object to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * @param filter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     *          the filter expression to use for the search; may not be null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * @param cons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *          the search controls that control the search.  If null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     *          the default search controls are used (equivalent
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   875
     *          to {@code (new SearchControls())}).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   877
     * @return  an enumeration of {@code SearchResult}s for
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     *          the objects that satisfy the filter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * @throws  InvalidSearchFilterException if the search filter specified is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     *          not supported or understood by the underlying directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * @throws  InvalidSearchControlsException if the search controls
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     *          contain invalid settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * Searches in the named context or object for entries that satisfy the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     * given search filter.  Performs the search as specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * the search controls.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     * The interpretation of <code>filterExpr</code> is based on RFC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * 2254.  It may additionally contain variables of the form
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     * <code>{i}</code> -- where <code>i</code> is an integer -- that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     * refer to objects in the <code>filterArgs</code> array.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     * interpretation of <code>filterExpr</code> is otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * identical to that of the <code>filter</code> parameter of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * method <code>search(Name, String, SearchControls)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * When a variable <code>{i}</code> appears in a search filter, it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     * indicates that the filter argument <code>filterArgs[i]</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * is to be used in that place.  Such variables may be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     * wherever an <em>attr</em>, <em>value</em>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     * <em>matchingrule</em> production appears in the filter grammar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     * of RFC 2254, section 4.  When a string-valued filter argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
     * is substituted for a variable, the filter is interpreted as if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * the string were given in place of the variable, with any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * characters having special significance within filters (such as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * <code>'*'</code>) having been escaped according to the rules of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     * RFC 2254.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * For directories that do not use a string representation for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * some or all of their attributes, the filter argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * corresponding to an attribute value may be of a type other than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * String.  Directories that support unstructured binary-valued
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * attributes, for example, should accept byte arrays as filter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * arguments.  The interpretation (if any) of filter arguments of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * any other type is determined by the service provider for that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * directory, which maps the filter operations onto operations with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     * corresponding semantics in the underlying directory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * This method returns an enumeration of the results.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * Each element in the enumeration contains the name of the object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * and other information about the object (see <code>SearchResult</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * The name is either relative to the target context of the search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * (which is named by the <code>name</code> parameter), or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * it is a URL string. If the target context is included in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * the enumeration (as is possible when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     * <code>cons</code> specifies a search scope of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * <code>SearchControls.OBJECT_SCOPE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * <code>SearchControls.SUBSTREE_SCOPE</code>),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * its name is the empty string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     *<p>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   938
     * The {@code SearchResult} may also contain attributes of the matching
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   939
     * object if the {@code cons} argument specifies that attributes be
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     * returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     * If the object does not have a requested attribute, that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * nonexistent attribute will be ignored.  Those requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * attributes that the object does have will be returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     * A directory might return more attributes than were requested
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     * (see <strong>Attribute Type Names</strong> in the class description)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     * but is not allowed to return arbitrary, unrelated attributes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * If a search filter with invalid variable substitutions is provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * to this method, the result is undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * When changes are made to this DirContext,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     * the effect on enumerations returned by prior calls to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     * is undefined.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     * See also <strong>Operational Attributes</strong> in the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     *          the name of the context or object to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * @param filterExpr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     *          the filter expression to use for the search.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     *          The expression may contain variables of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     *          form "<code>{i}</code>" where <code>i</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     *          is a nonnegative integer.  May not be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * @param filterArgs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     *          the array of arguments to substitute for the variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     *          in <code>filterExpr</code>.  The value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     *          <code>filterArgs[i]</code> will replace each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     *          occurrence of "<code>{i}</code>".
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     *          If null, equivalent to an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * @param cons
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     *          the search controls that control the search.  If null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     *          the default search controls are used (equivalent
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   975
     *          to {@code (new SearchControls())}).
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   976
     * @return  an enumeration of {@code SearchResult}s of the objects
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     *          that satisfy the filter; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   979
     * @throws  ArrayIndexOutOfBoundsException if {@code filterExpr} contains
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     *          <code>{i}</code> expressions where <code>i</code> is outside
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     *          the bounds of the array <code>filterArgs</code>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   982
     * @throws  InvalidSearchControlsException if {@code cons} contains
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     *          invalid settings
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   984
     * @throws  InvalidSearchFilterException if {@code filterExpr} with
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
   985
     *          {@code filterArgs} represents an invalid search filter
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * @see #search(Name, Attributes, String[])
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * @see java.text.MessageFormat
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * Searches in the named context or object for entries that satisfy the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     * given search filter.  Performs the search as specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     * the search controls.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     * See {@link #search(Name, String, Object[], SearchControls)} for details.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     * @param name
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
     *          the name of the context or object to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
     * @param filterExpr
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
     *          the filter expression to use for the search.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     *          The expression may contain variables of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     *          form "<code>{i}</code>" where <code>i</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     *          is a nonnegative integer.  May not be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * @param filterArgs
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     *          the array of arguments to substitute for the variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     *          in <code>filterExpr</code>.  The value of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     *          <code>filterArgs[i]</code> will replace each
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     *          occurrence of "<code>{i}</code>".
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     *          If null, equivalent to an empty array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * @param cons
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     *          the search controls that control the search.  If null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     *          the default search controls are used (equivalent
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1020
     *          to {@code (new SearchControls())}).
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1021
     * @return  an enumeration of {@code SearchResult}s of the objects
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     *          that satisfy the filter; never null
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     *
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1024
     * @throws  ArrayIndexOutOfBoundsException if {@code filterExpr} contains
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     *          <code>{i}</code> expressions where <code>i</code> is outside
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     *          the bounds of the array <code>filterArgs</code>
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1027
     * @throws  InvalidSearchControlsException if {@code cons} contains
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     *          invalid settings
32029
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1029
     * @throws  InvalidSearchFilterException if {@code filterExpr} with
a5538163e144 8132877: docs: replace <tt> tags (obsolete in html5) for javax.naming
avstepan
parents: 25859
diff changeset
  1030
     *          {@code filterArgs} represents an invalid search filter
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
        throws NamingException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
}