jdk/src/share/classes/javax/naming/directory/InitialDirContext.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 4349 c72a4e2ec170
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1999-2004 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
package javax.naming.directory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import javax.naming.spi.NamingManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import javax.naming.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * This class is the starting context for performing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * directory operations. The documentation in the class description
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * of InitialContext (including those for synchronization) apply here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * @author Rosanna Lee
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @author Scott Seligman
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @see javax.naming.InitialContext
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public class InitialDirContext extends InitialContext implements DirContext {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * Constructs an initial DirContext with the option of not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     * initializing it.  This may be used by a constructor in
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * a subclass when the value of the environment parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * is not yet known at the time the <tt>InitialDirContext</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * constructor is called.  The subclass's constructor will
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * call this constructor, compute the value of the environment,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * and then call <tt>init()</tt> before returning.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * @param lazy
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *          true means do not initialize the initial DirContext; false
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     *          is equivalent to calling <tt>new InitialDirContext()</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * @see InitialContext#init(Hashtable)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    protected InitialDirContext(boolean lazy) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        super(lazy);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Constructs an initial DirContext.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * No environment properties are supplied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * Equivalent to <tt>new InitialDirContext(null)</tt>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * @see #InitialDirContext(Hashtable)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public InitialDirContext() throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        super();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * Constructs an initial DirContext using the supplied environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Environment properties are discussed in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * <tt>javax.naming.InitialContext</tt> class description.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * <p> This constructor will not modify <tt>environment</tt>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * or save a reference to it, but may save a clone.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @param environment
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     *          environment used to create the initial DirContext.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *          Null indicates an empty environment.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @throws  NamingException if a naming exception is encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public InitialDirContext(Hashtable<?,?> environment)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        super(environment);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    private DirContext getURLOrDefaultInitDirCtx(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        Context answer = getURLOrDefaultInitCtx(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        if (!(answer instanceof DirContext)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            if (answer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                throw new NoInitialContextException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                throw new NotContextException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                    "Not an instance of DirContext");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        return (DirContext)answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    private DirContext getURLOrDefaultInitDirCtx(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        Context answer = getURLOrDefaultInitCtx(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        if (!(answer instanceof DirContext)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            if (answer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                throw new NoInitialContextException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                throw new NotContextException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    "Not an instance of DirContext");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        return (DirContext)answer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
// DirContext methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
// Most Javadoc is deferred to the DirContext interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public Attributes getAttributes(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        return getAttributes(name, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public Attributes getAttributes(String name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        return getURLOrDefaultInitDirCtx(name).getAttributes(name, attrIds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    public Attributes getAttributes(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        return getAttributes(name, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    public Attributes getAttributes(Name name, String[] attrIds)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        return getURLOrDefaultInitDirCtx(name).getAttributes(name, attrIds);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    public void modifyAttributes(String name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
        getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mod_op, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    public void modifyAttributes(Name name, int mod_op, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mod_op, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    public void modifyAttributes(String name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mods);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    public void modifyAttributes(Name name, ModificationItem[] mods)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mods);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    public void bind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        getURLOrDefaultInitDirCtx(name).bind(name, obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    public void bind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        getURLOrDefaultInitDirCtx(name).bind(name, obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    public void rebind(String name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        getURLOrDefaultInitDirCtx(name).rebind(name, obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    public void rebind(Name name, Object obj, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        getURLOrDefaultInitDirCtx(name).rebind(name, obj, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    public DirContext createSubcontext(String name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        return getURLOrDefaultInitDirCtx(name).createSubcontext(name, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    public DirContext createSubcontext(Name name, Attributes attrs)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            throws NamingException  {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        return getURLOrDefaultInitDirCtx(name).createSubcontext(name, attrs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    public DirContext getSchema(String name) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        return getURLOrDefaultInitDirCtx(name).getSchema(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public DirContext getSchema(Name name) throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        return getURLOrDefaultInitDirCtx(name).getSchema(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    public DirContext getSchemaClassDefinition(String name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        return getURLOrDefaultInitDirCtx(name).getSchemaClassDefinition(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    public DirContext getSchemaClassDefinition(Name name)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
            throws NamingException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        return getURLOrDefaultInitDirCtx(name).getSchemaClassDefinition(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
// -------------------- search operations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        search(String name, Attributes matchingAttributes)
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
        return getURLOrDefaultInitDirCtx(name).search(name, matchingAttributes);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        search(Name name, Attributes matchingAttributes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        return getURLOrDefaultInitDirCtx(name).search(name, matchingAttributes);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        return getURLOrDefaultInitDirCtx(name).search(name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
                                                      matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                                                      attributesToReturn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
               Attributes matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
               String[] attributesToReturn)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        return getURLOrDefaultInitDirCtx(name).search(name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                                            matchingAttributes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
                                            attributesToReturn);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        return getURLOrDefaultInitDirCtx(name).search(name, filter, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
               String filter,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        return getURLOrDefaultInitDirCtx(name).search(name, filter, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        search(String name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
        return getURLOrDefaultInitDirCtx(name).search(name, filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                                                      filterArgs, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    public NamingEnumeration<SearchResult>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        search(Name name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
               String filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
               Object[] filterArgs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
               SearchControls cons)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        throws NamingException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        return getURLOrDefaultInitDirCtx(name).search(name, filterExpr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                                                      filterArgs, cons);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
}