mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
17.21.2007 d07ce77c50877dbae6d2e9f437f71c836d76418b
Add a new build-tools source stub for the netscape.ldap.LDAPSocketFactory class
that is part of the Mozilla LDAP SDK for Java. Also, use this source stub to
create the org.opends.server.protocols.internal.InternalMozillaLDAPSocketFactory
class which implements that interface and allows users to more easily use the
Mozilla LDAP SDK for Java to invoke internal operations in the server.

Note that the source stub is used only to allow our code to compile. Anyone
that wants to use the Mozilla LDAP SDK for Java to perform internal operations
will need to supply the full library containing the LDAP SDK for Java.
3 files added
1 files modified
183 ■■■■■ changed files
opends/build.xml 4 ●●●● patch | view | raw | blame | history
opends/src/build-tools/netscape/ldap/LDAPSocketFactory.java 53 ●●●●● patch | view | raw | blame | history
opends/src/build-tools/netscape/ldap/package-info.java 42 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/internal/InternalMozillaLDAPSocketFactory.java 84 ●●●●● patch | view | raw | blame | history
opends/build.xml
@@ -1016,6 +1016,10 @@
          <include name="*.jar" />
        </fileset>
        <fileset dir="${build.dir}/build-tools">
          <include name="*.jar" />
        </fileset>
        <dirset dir="${classes.dir}" />
        <dirset dir="${dsml.classes.dir}" />
        <dirset dir="${quicksetup.classes.dir}" />
opends/src/build-tools/netscape/ldap/LDAPSocketFactory.java
New file
@@ -0,0 +1,53 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 */
package netscape.ldap;
import java.net.Socket;
/**
 * This class provides an empty definition of the
 * {{netscape.ldap.LDAPSocketFactory}} interface, which is part of the Mozilla
 * LDAP SDK for Java.  It is provided to allow the
 * {{org.opends.server.protocols.internal.InternalMozillaLDAPSocketFactory}}
 * class to compile without creating a dependency on the full Mozilla LDAP SDK
 * for Java.
 * <BR><BR>
 * Note that we do not intend to distribute the Mozilla LDAP SDK for Java with
 * OpenDS, or do we depend on it in any way.  Any third-party applications which
 * intend to use the
 * {{org.opends.server.protocols.internal.InternalMozillaLDAPSocketFactory}}
 * class will be required to provide the Mozilla LDAP SDK for Java library.
 */
public interface LDAPSocketFactory
{
  public Socket makeSocket(String host, int port);
}
opends/src/build-tools/netscape/ldap/package-info.java
New file
@@ -0,0 +1,42 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 */
/**
 * This package provides a source file stub for the LDAPSocketFactory class
 * that is part of the Mozilla LDAP SDK for Java and is required to build the
 * org.opends.server.protocols.internal.InternalMozillaLDAPSocketFactory class.
 * This class provides a simple way to use the Mozilla LDAP SDK for Java to
 * perform internal operations in OpenDS.
 *
 * This code is not acutally used in any way other than to allow other code to
 * compile, and it should not be included in any JAR files or other bundles
 * that we ship as part of OpenDS.
 */
package netscape.ldap;
opends/src/server/org/opends/server/protocols/internal/InternalMozillaLDAPSocketFactory.java
New file
@@ -0,0 +1,84 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 */
package org.opends.server.protocols.internal;
import java.net.Socket;
import netscape.ldap.LDAPSocketFactory;
/**
 * This class provides an implementation of the
 * {{netscape.ldap.LDAPSocketFactory}} class that can be used to allow
 * the Mozilla LDAP SDK for Java to perform internal operations in
 * OpenDS.  To use it, simply provide an instance of this class to the
 * constructor of the {{netscape.ldap.LDAPConnection}} class, like:
 * <PRE>
 * LDAPConnection conn =
 *      new LDAPConnection(new InternalMozillaLDAPSocketFactory());
 * </PRE>
 */
public final class InternalMozillaLDAPSocketFactory
       implements LDAPSocketFactory
{
  /**
   * Creates a new instance of this internal Mozilla LDAP socket
   * factory.
   */
  public InternalMozillaLDAPSocketFactory()
  {
    // No implementation is required.
  }
  /**
   * Creates and returns a new internal LDAP socket, which can be used
   * by the Mozilla LDAP SDK for Java to perform internal operations
   * in OpenDS.
   *
   * @param  host  The address of the server to which the connection
   *               should be established.  This will be ignored, since
   *               there will not be any actual network communication.
   * @param  port  The port of the server to which the connection
   *               should be established.  This will be ignored, since
   *               there will not be any actual network communication.
   *
   * @return  An internal LDAP socket, which can be used by the
   *          Mozilla LDAP SDK for Java to perform internal operations
   *          in OpenDS.
   */
  public Socket makeSocket(String host, int port)
  {
    return new InternalLDAPSocket();
  }
}