harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r410833 - in /incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap: ControlFactory.java InitialLdapContext.java LdapReferralException.java
Date Thu, 01 Jun 2006 11:00:27 GMT
Author: mloenko
Date: Thu Jun  1 04:00:26 2006
New Revision: 410833

URL: http://svn.apache.org/viewvc?rev=410833&view=rev
Log:
fixes for HARMONY-544
javax.naming.ldap generifications

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java
    incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java?rev=410833&r1=410832&r2=410833&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java
Thu Jun  1 04:00:26 2006
@@ -11,164 +11,164 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.ldap;
-
-import java.util.Hashtable;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.harmony.jndi.internal.EnvironmentReader;
-
-/**
- * This abstract class is used for factories which create controls as used in 
- * LDAPv3.
- * These factories are used by service providers to obtain control instances 
- * when they receive a response control.
- *
- * @see Control
- * 
- */
-public abstract class ControlFactory {
-
-    /*
-     * -------------------------------------------------------------------
-     * Constructors
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Constructs a <code>ControlFactory</code> instance with no parameters.
-     */
-    protected ControlFactory() {
-    	super();
-    }
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Uses this control factory to create a particular type of <code>Control
-     * </code> based on the supplied control.
-     * It is likely that the supplied control contains data encoded in BER 
-     * format as received from an LDAP server. Returns <code>null</code> if the
-     * factory cannot create a <code>Control</code> else it returns the type
of
-     * <code>Control</code> created by the factory.
-
-     * 
-     * @param c                 the supplied control
-     * @throws NamingException  If an error is encountered.
-     * @return the control
-     */
-    public abstract Control getControlInstance(Control c)
-        throws NamingException;
-
-    /**
-     * Creates a particular type of control based on the supplied control c.
-     * It is likely that the supplied control contains data encoded in BER 
-     * format as received from an LDAP server.
-     * <p>
-     * This method tries the factories in LdapContext.CONTROL_FACTORIES, 
-     * first from the supplied <code>Hashtable</code> then from the resource
-     * provider files of the supplied <code>Context</code>.</p>
-     * <p> 
-     * It returns the supplied control if no factories are loaded or a control
-     * cannot be created. Otherwise, a new <code>Control</code> instance is 
-     * returned.
-     * 
-     * @param c                 the supplied <code>Control</code> instance
-     * @param ctx               the supplied <code>Context</code> instance
-     * @param h                 the supplier JNDI environment properties
-     * @return                  the supplied control if no factories are loaded
-     *                          or a control cannot be created, otherwise a new 
-     *                          <code>Control</code> instance
-     * @throws NamingException  If an error is encountered.
-     */
-    public static Control getControlInstance(
-        Control c,
-        Context ctx,
-        Hashtable h)
-        throws NamingException {
-
-        // obtain control factories from hashtable and provider resource file
-        String fnames[] =
-            EnvironmentReader
-                .getFactoryNamesFromEnvironmentAndProviderResource(
-                h,
-                ctx,
-                LdapContext.CONTROL_FACTORIES);
-
-        // for each control factory
-        for (int i = 0; i < fnames.length; i++) {
-            // new factory instance by its class name
-            ControlFactory factory = null;
-            try {
-                factory =
-                    (ControlFactory) classForName(fnames[i]).newInstance();
-            } catch (Exception e) {
-                continue;
-            }
-            // try obtaining a Control using the factory
-            Control control = factory.getControlInstance(c);
-            // if a Control is obtained successfully, return it
-            if (null != control) {
-                return control;
-            }
-        }
-
-        // all factories failed, return the input argument c
-        return c;
-    }
-
-    /*
-     * Use the context class loader or the system class loader to load the
-     * specified class, in a privileged manner.
-     */
-    private static Class classForName(final String className)
-        throws ClassNotFoundException {
-
-        Class cls =
-            (Class) AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
-                // try thread context class loader first
-                try {
-                    return Class.forName(
-                        className,
-                        true,
-                        Thread.currentThread().getContextClassLoader());
-                } catch (ClassNotFoundException e) {
-                	// Ignored
-                }
-                // try system class loader second
-                try {
-                    return Class.forName(
-                        className,
-                        true,
-                        ClassLoader.getSystemClassLoader());
-                } catch (ClassNotFoundException e1) {
-                	// Ignored
-                }
-                // return null, if fail to load class
-                return null;
-            }
-        });
-
-        if (cls == null) {
-            throw new ClassNotFoundException(
-                "class " + className + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
-        }
-
-        return cls;
-
-    }
-
-}
-
-
+ */
+
+
+package javax.naming.ldap;
+
+import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.apache.harmony.jndi.internal.EnvironmentReader;
+
+/**
+ * This abstract class is used for factories which create controls as used in 
+ * LDAPv3.
+ * These factories are used by service providers to obtain control instances 
+ * when they receive a response control.
+ *
+ * @see Control
+ * 
+ */
+public abstract class ControlFactory {
+
+    /*
+     * -------------------------------------------------------------------
+     * Constructors
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Constructs a <code>ControlFactory</code> instance with no parameters.
+     */
+    protected ControlFactory() {
+    	super();
+    }
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Uses this control factory to create a particular type of <code>Control
+     * </code> based on the supplied control.
+     * It is likely that the supplied control contains data encoded in BER 
+     * format as received from an LDAP server. Returns <code>null</code> if the
+     * factory cannot create a <code>Control</code> else it returns the type
of
+     * <code>Control</code> created by the factory.
+
+     * 
+     * @param c                 the supplied control
+     * @throws NamingException  If an error is encountered.
+     * @return the control
+     */
+    public abstract Control getControlInstance(Control c)
+        throws NamingException;
+
+    /**
+     * Creates a particular type of control based on the supplied control c.
+     * It is likely that the supplied control contains data encoded in BER 
+     * format as received from an LDAP server.
+     * <p>
+     * This method tries the factories in LdapContext.CONTROL_FACTORIES, 
+     * first from the supplied <code>Hashtable</code> then from the resource
+     * provider files of the supplied <code>Context</code>.</p>
+     * <p> 
+     * It returns the supplied control if no factories are loaded or a control
+     * cannot be created. Otherwise, a new <code>Control</code> instance is 
+     * returned.
+     * 
+     * @param c                 the supplied <code>Control</code> instance
+     * @param ctx               the supplied <code>Context</code> instance
+     * @param h                 the supplier JNDI environment properties
+     * @return                  the supplied control if no factories are loaded
+     *                          or a control cannot be created, otherwise a new 
+     *                          <code>Control</code> instance
+     * @throws NamingException  If an error is encountered.
+     */
+    public static Control getControlInstance(
+        Control c,
+        Context ctx,
+        Hashtable<?, ?> h)
+        throws NamingException {
+
+        // obtain control factories from hashtable and provider resource file
+        String fnames[] =
+            EnvironmentReader
+                .getFactoryNamesFromEnvironmentAndProviderResource(
+                h,
+                ctx,
+                LdapContext.CONTROL_FACTORIES);
+
+        // for each control factory
+        for (int i = 0; i < fnames.length; i++) {
+            // new factory instance by its class name
+            ControlFactory factory = null;
+            try {
+                factory =
+                    (ControlFactory) classForName(fnames[i]).newInstance();
+            } catch (Exception e) {
+                continue;
+            }
+            // try obtaining a Control using the factory
+            Control control = factory.getControlInstance(c);
+            // if a Control is obtained successfully, return it
+            if (null != control) {
+                return control;
+            }
+        }
+
+        // all factories failed, return the input argument c
+        return c;
+    }
+
+    /*
+     * Use the context class loader or the system class loader to load the
+     * specified class, in a privileged manner.
+     */
+    private static Class classForName(final String className)
+        throws ClassNotFoundException {
+
+        Class cls =
+            (Class) AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+                // try thread context class loader first
+                try {
+                    return Class.forName(
+                        className,
+                        true,
+                        Thread.currentThread().getContextClassLoader());
+                } catch (ClassNotFoundException e) {
+                	// Ignored
+                }
+                // try system class loader second
+                try {
+                    return Class.forName(
+                        className,
+                        true,
+                        ClassLoader.getSystemClassLoader());
+                } catch (ClassNotFoundException e1) {
+                	// Ignored
+                }
+                // return null, if fail to load class
+                return null;
+            }
+        });
+
+        if (cls == null) {
+            throw new ClassNotFoundException(
+                "class " + className + " not found"); //$NON-NLS-1$ //$NON-NLS-2$
+        }
+
+        return cls;
+
+    }
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java?rev=410833&r1=410832&r2=410833&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java
Thu Jun  1 04:00:26 2006
@@ -11,157 +11,157 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.ldap;
-
-import java.util.Hashtable;
-import javax.naming.directory.InitialDirContext;
-import javax.naming.NamingException;
-import javax.naming.NotContextException;
-
-/**
- * This is used as the starting context when the LDAPv3 extended functionality
- * provided by the <code>javax.naming.ldap</code> package is required.
- *
- * See <code>LdapContext</code> for a description of the Request and Response

- * controls.
- * 
- * @see LdapContext
- * 
- */
-public class InitialLdapContext
-    extends InitialDirContext
-    implements LdapContext {
-
-    /*
-     * -------------------------------------------------------------------
-     * Constants
-     * -------------------------------------------------------------------
-     */
-
-    /*
-     * This is set to the environment property java.naming.ldap.version. 
-     */
-    private static final String LDAP_VERSION = "java.naming.ldap.version"; //$NON-NLS-1$
-
-    /*
-     * This is set to the environment property java.naming.ldap.control.connect.
-     */
-    private static final String CONNECT_CONTROL =
-        "java.naming.ldap.control.connect"; //$NON-NLS-1$
-
-    /*
-     * The version of this LDAP context implementaton. 
-     */
-    private static final String THIS_LDAP_VERSION = "3"; //$NON-NLS-1$
-
-    /*
-     * -------------------------------------------------------------------
-     * Constructors
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Constructs an <code>InitialLdapContext</code> instance without using 
-     * any environment properties or connection controls.
-     * 
-     * @throws NamingException  If an error is encountered. 
-     */
-    public InitialLdapContext() throws NamingException {
-        this(null, null);
-    }
-
-    /**
-     * Constructs an <code>InitialLdapContext</code> instance using the supplied
-     * environment properties and connection controls.
-     * 
-     * @param h                 the environment properties which may be null
-     * @param cs                the connection controls which may be null
-     * @throws NamingException  If an error is encountered.
-     */
-    public InitialLdapContext(Hashtable h, Control[] cs)
-        throws NamingException {
-        super(true);
-
-        /* 
-         * Prepare the environment properties to be inherited by the 
-         * service provider.
-         */
-        Hashtable newEnvironment = null;
-        if (null == h) {
-            newEnvironment = new Hashtable();
-        } else {
-            newEnvironment = (Hashtable) h.clone();
-        }
-
-        // Set the environment property java.naming.ldap.control.connect
-        if (null != cs) {
-            Control[] cloneOfCs = new Control[cs.length];
-            System.arraycopy(cs, 0, cloneOfCs, 0, cs.length);
-            newEnvironment.put(CONNECT_CONTROL, cloneOfCs);
-        }
-
-        // Set the enviroment property java.naming.ldap.version to be 3
-        newEnvironment.put(LDAP_VERSION, THIS_LDAP_VERSION);
-
-        // Initialize the initial context
-        super.init(newEnvironment);
-    }
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /*
-     * Gets the default initial context and verify that it's an instance of
-     * LdapContext.
-     */
-    private LdapContext getDefaultInitLdapContext() throws NamingException {
-        if (!(super.defaultInitCtx instanceof LdapContext)) {
-            throw new NotContextException("Expected an LdapContext object."); //$NON-NLS-1$
-        }
-        return (LdapContext) super.defaultInitCtx;
-    }
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods of Interface LdapContext
-     * -------------------------------------------------------------------
-     */
-
-    public ExtendedResponse extendedOperation(ExtendedRequest e)
-        throws NamingException {
-        return getDefaultInitLdapContext().extendedOperation(e);
-    }
-
-    public LdapContext newInstance(Control[] ac) throws NamingException {
-        return getDefaultInitLdapContext().newInstance(ac);
-    }
-
-    public void reconnect(Control[] ac) throws NamingException {
-        getDefaultInitLdapContext().reconnect(ac);
-    }
-
-    public Control[] getConnectControls() throws NamingException {
-        return getDefaultInitLdapContext().getConnectControls();
-    }
-
-    public void setRequestControls(Control[] ac) throws NamingException {
-        getDefaultInitLdapContext().setRequestControls(ac);
-    }
-
-    public Control[] getRequestControls() throws NamingException {
-        return getDefaultInitLdapContext().getRequestControls();
-    }
-
-    public Control[] getResponseControls() throws NamingException {
-        return getDefaultInitLdapContext().getResponseControls();
-    }
-
-}
-
-
+ */
+
+
+package javax.naming.ldap;
+
+import java.util.Hashtable;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.NamingException;
+import javax.naming.NotContextException;
+
+/**
+ * This is used as the starting context when the LDAPv3 extended functionality
+ * provided by the <code>javax.naming.ldap</code> package is required.
+ *
+ * See <code>LdapContext</code> for a description of the Request and Response

+ * controls.
+ * 
+ * @see LdapContext
+ * 
+ */
+public class InitialLdapContext
+    extends InitialDirContext
+    implements LdapContext {
+
+    /*
+     * -------------------------------------------------------------------
+     * Constants
+     * -------------------------------------------------------------------
+     */
+
+    /*
+     * This is set to the environment property java.naming.ldap.version. 
+     */
+    private static final String LDAP_VERSION = "java.naming.ldap.version"; //$NON-NLS-1$
+
+    /*
+     * This is set to the environment property java.naming.ldap.control.connect.
+     */
+    private static final String CONNECT_CONTROL =
+        "java.naming.ldap.control.connect"; //$NON-NLS-1$
+
+    /*
+     * The version of this LDAP context implementaton. 
+     */
+    private static final String THIS_LDAP_VERSION = "3"; //$NON-NLS-1$
+
+    /*
+     * -------------------------------------------------------------------
+     * Constructors
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Constructs an <code>InitialLdapContext</code> instance without using 
+     * any environment properties or connection controls.
+     * 
+     * @throws NamingException  If an error is encountered. 
+     */
+    public InitialLdapContext() throws NamingException {
+        this(null, null);
+    }
+
+    /**
+     * Constructs an <code>InitialLdapContext</code> instance using the supplied
+     * environment properties and connection controls.
+     * 
+     * @param h                 the environment properties which may be null
+     * @param cs                the connection controls which may be null
+     * @throws NamingException  If an error is encountered.
+     */
+    public InitialLdapContext(Hashtable<?, ?> h, Control[] cs)
+        throws NamingException {
+        super(true);
+
+        /* 
+         * Prepare the environment properties to be inherited by the 
+         * service provider.
+         */
+        Hashtable<Object,Object> newEnvironment = null;
+        if (null == h) {
+            newEnvironment = new Hashtable<Object,Object>();
+        } else {
+            newEnvironment = (Hashtable<Object,Object>) h.clone();
+        }
+
+        // Set the environment property java.naming.ldap.control.connect
+        if (null != cs) {
+            Control[] cloneOfCs = new Control[cs.length];
+            System.arraycopy(cs, 0, cloneOfCs, 0, cs.length);
+            newEnvironment.put(CONNECT_CONTROL, cloneOfCs);
+        }
+
+        // Set the enviroment property java.naming.ldap.version to be 3
+        newEnvironment.put(LDAP_VERSION, THIS_LDAP_VERSION);
+
+        // Initialize the initial context
+        super.init(newEnvironment);
+    }
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /*
+     * Gets the default initial context and verify that it's an instance of
+     * LdapContext.
+     */
+    private LdapContext getDefaultInitLdapContext() throws NamingException {
+        if (!(super.defaultInitCtx instanceof LdapContext)) {
+            throw new NotContextException("Expected an LdapContext object."); //$NON-NLS-1$
+        }
+        return (LdapContext) super.defaultInitCtx;
+    }
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods of Interface LdapContext
+     * -------------------------------------------------------------------
+     */
+
+    public ExtendedResponse extendedOperation(ExtendedRequest e)
+        throws NamingException {
+        return getDefaultInitLdapContext().extendedOperation(e);
+    }
+
+    public LdapContext newInstance(Control[] ac) throws NamingException {
+        return getDefaultInitLdapContext().newInstance(ac);
+    }
+
+    public void reconnect(Control[] ac) throws NamingException {
+        getDefaultInitLdapContext().reconnect(ac);
+    }
+
+    public Control[] getConnectControls() throws NamingException {
+        return getDefaultInitLdapContext().getConnectControls();
+    }
+
+    public void setRequestControls(Control[] ac) throws NamingException {
+        getDefaultInitLdapContext().setRequestControls(ac);
+    }
+
+    public Control[] getRequestControls() throws NamingException {
+        return getDefaultInitLdapContext().getRequestControls();
+    }
+
+    public Control[] getResponseControls() throws NamingException {
+        return getDefaultInitLdapContext().getResponseControls();
+    }
+
+}
+
+

Modified: incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java?rev=410833&r1=410832&r2=410833&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java
Thu Jun  1 04:00:26 2006
@@ -11,97 +11,97 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- */
-
-
-package javax.naming.ldap;
-
-import java.util.Hashtable;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.ReferralException;
-
-/**
- * <code>LdapReferralException</code> is an abstract exception which extends
- * <code>ReferralException</code> to handle LDAPv3 request controls.
- * 
- */
-public abstract class LdapReferralException extends ReferralException {
-
-    /*
-     * -------------------------------------------------------------------
-     * Constants
-     * -------------------------------------------------------------------
-     */
-
-    /* 
-     * This constant is used during deserialization to check the J2SE version which
-     * created the serialized object.
-     */
-    static final long serialVersionUID = -1668992791764950804L; // J2SE 1.4.2
-
-    /*
-     * -------------------------------------------------------------------
-     * Constructors
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Default constructor.
-     */
-    protected LdapReferralException() {
-    	super();
-    }
-
-    /**
-     * Constructs an LdapReferralException instance using the supplied text of
-     * the message
-     * @param s				the supplied text of the message, which may be null
-     */
-    protected LdapReferralException(String s) {
-        super(s);
-    }
-
-    /*
-     * -------------------------------------------------------------------
-     * Methods
-     * -------------------------------------------------------------------
-     */
-
-    /**
-     * Gets referal context without environment properties.
-     * 
-     * @return 				referral context
-     * @throws NamingException
-     * 						If cannot get referral context correctly.
-     */
-    public abstract Context getReferralContext() throws NamingException;
-
-    /**
-     * Gets referal context with environment properties.
-     * 
-     * @param h				environment properties			
-     * @return 				referral context
-     * @throws NamingException
-     * 						If cannot get referral context correctly.
-     */
-    public abstract Context getReferralContext(Hashtable h)
-        throws NamingException;
-
-    /**
-     * Gets referal context with environment properties and an array of LDAPv3
-     * controls.
-     * 
-     * @param h				environment properties
-     * @param cs			array of LDAPv3 controls
-     * @return 				referral context
-     * @throws NamingException
-     * 						If cannot get referral context correctly.
-     */
-    public abstract Context getReferralContext(Hashtable h, Control[] cs)
-        throws NamingException;
-
-}
-
-
+ */
+
+
+package javax.naming.ldap;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.ReferralException;
+
+/**
+ * <code>LdapReferralException</code> is an abstract exception which extends
+ * <code>ReferralException</code> to handle LDAPv3 request controls.
+ * 
+ */
+public abstract class LdapReferralException extends ReferralException {
+
+    /*
+     * -------------------------------------------------------------------
+     * Constants
+     * -------------------------------------------------------------------
+     */
+
+    /* 
+     * This constant is used during deserialization to check the J2SE version which
+     * created the serialized object.
+     */
+    static final long serialVersionUID = -1668992791764950804L; // J2SE 1.4.2
+
+    /*
+     * -------------------------------------------------------------------
+     * Constructors
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Default constructor.
+     */
+    protected LdapReferralException() {
+    	super();
+    }
+
+    /**
+     * Constructs an LdapReferralException instance using the supplied text of
+     * the message
+     * @param s				the supplied text of the message, which may be null
+     */
+    protected LdapReferralException(String s) {
+        super(s);
+    }
+
+    /*
+     * -------------------------------------------------------------------
+     * Methods
+     * -------------------------------------------------------------------
+     */
+
+    /**
+     * Gets referal context without environment properties.
+     * 
+     * @return 				referral context
+     * @throws NamingException
+     * 						If cannot get referral context correctly.
+     */
+    public abstract Context getReferralContext() throws NamingException;
+
+    /**
+     * Gets referal context with environment properties.
+     * 
+     * @param h				environment properties			
+     * @return 				referral context
+     * @throws NamingException
+     * 						If cannot get referral context correctly.
+     */
+    public abstract Context getReferralContext(Hashtable<?, ?> h)
+        throws NamingException;
+
+    /**
+     * Gets referal context with environment properties and an array of LDAPv3
+     * controls.
+     * 
+     * @param h				environment properties
+     * @param cs			array of LDAPv3 controls
+     * @return 				referral context
+     * @throws NamingException
+     * 						If cannot get referral context correctly.
+     */
+    public abstract Context getReferralContext(Hashtable<?, ?> h, Control[] cs)
+        throws NamingException;
+
+}
+
+



Mime
View raw message