2362N/A * Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class is the starting context for performing 0N/A * LDAPv3-style extended operations and controls. 0N/A * and the policy for how an initial context is created. 0N/A * <h4>Request Controls</h4> 0N/A * When you create an initial context (<tt>InitialLdapContext</tt>), 0N/A * you can specify a list of request controls. 0N/A * These controls will be used as the request controls for any 0N/A * implicit LDAP "bind" operation performed by the context or contexts 0N/A * derived from the context. These are called <em>connection request controls</em>. 0N/A * Use <tt>getConnectControls()</tt> to get a context's connection request 0N/A * The request controls supplied to the initial context constructor 0N/A * are <em>not</em> used as the context request controls 0N/A * for subsequent context operations such as searches and lookups. 0N/A * Context request controls are set and updated by using 0N/A * <tt>setRequestControls()</tt>. 0N/A * As shown, there can be two different sets of request controls 0N/A * associated with a context: connection request controls and context 0N/A * This is required for those applications needing to send critical 0N/A * controls that might not be applicable to both the context operation and 0N/A * any implicit LDAP "bind" operation. 0N/A * A typical user program would do the following: 0N/A * InitialLdapContext lctx = new InitialLdapContext(env, critConnCtls); 0N/A * lctx.setRequestControls(critModCtls); 0N/A * lctx.modifyAttributes(name, mods); 0N/A * Controls[] respCtls = lctx.getResponseControls(); 0N/A *</pre></blockquote> 0N/A * It specifies first the critical controls for creating the initial context 0N/A * (<tt>critConnCtls</tt>), and then sets the context's request controls 0N/A * (<tt>critModCtls</tt>) for the context operation. If for some reason 0N/A * <tt>lctx</tt> needs to reconnect to the server, it will use 0N/A * <tt>critConnCtls</tt>. See the <tt>LdapContext</tt> interface for 0N/A * more discussion about request controls. 0N/A * Service provider implementors should read the "Service Provider" section 0N/A * in the <tt>LdapContext</tt> class description for implementation details. 0N/A * @author Rosanna Lee 0N/A * @author Scott Seligman 0N/A * @author Vincent Ryan 0N/A * @see javax.naming.spi.NamingManager#setInitialContextFactoryBuilder 0N/A * Constructs an initial context using no environment properties or 0N/A * connection request controls. 0N/A * Equivalent to <tt>new InitialLdapContext(null, null)</tt>. 0N/A * @throws NamingException if a naming exception is encountered 0N/A * Constructs an initial context 0N/A * using environment properties and connection request controls. 0N/A * environment properties. 0N/A * <p> This constructor will not modify its parameters or 0N/A * save references to them, but may save a clone or copy. 1954N/A * Caller should not modify mutable keys and values in 1954N/A * <tt>environment</tt> after it has been passed to the constructor. 0N/A * <p> <tt>connCtls</tt> is used as the underlying context instance's 0N/A * connection request controls. See the class description 0N/A * @param environment 0N/A * environment used to create the initial DirContext. 0N/A * Null indicates an empty environment. 0N/A * connection request controls for the initial context. 0N/A * If null, no connection request controls are used. 0N/A * @throws NamingException if a naming exception is encountered 0N/A * @see LdapContext#reconnect 0N/A super(
true);
// don't initialize yet 0N/A // Clone environment since caller owns it. 0N/A // Put connect controls into environment. Copy them first since 0N/A // caller owns the array. 0N/A // set version to LDAPv3 0N/A // Initialize with updated environment 0N/A * Retrieves the initial LDAP context. 0N/A * @return The non-null cached initial context. 0N/A * @exception NotContextException If the initial context is not an 0N/A * instance of <tt>LdapContext</tt>. 0N/A * @exception NamingException If a naming exception was encountered. 0N/A "Not an instance of LdapContext");
0N/A// LdapContext methods 0N/A// Most Javadoc is deferred to the LdapContext interface.