You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2007/06/23 22:53:48 UTC
svn commit: r550106 [9/16] - in
/harmony/enhanced/classlib/branches/java6/modules:
beans/src/main/java/java/beans/ jndi/META-INF/
jndi/src/main/java/javax/naming/ jndi/src/main/java/javax/naming/directory/
jndi/src/main/java/javax/naming/event/ jndi/sr...
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/BasicControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/BasicControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/BasicControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/BasicControl.java Sat Jun 23 13:53:42 2007
@@ -13,71 +13,45 @@
* 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 javax.naming.ldap.Control;
/**
- *
- * @ar.org.fitc.spec_ref
- * @version 0.0.1
- * @author Osvaldo C. Demo
+ * TODO: JavaDoc
*/
public class BasicControl implements Control {
private static final long serialVersionUID = -4233907508771791687L;
- /**
- * @ar.org.fitc.spec_ref
- */
protected String id;
- /**
- * @ar.org.fitc.spec_ref
- */
protected boolean criticality = false;
- /**
- * @ar.org.fitc.spec_ref
- */
protected byte[] value;
- /**
- * @ar.org.fitc.spec_ref
- */
public BasicControl(String id) {
this.id = id;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public BasicControl(String id, boolean criticality, byte[] value) {
this.id = id;
this.criticality = criticality;
this.value = value;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public byte[] getEncodedValue() {
return value;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean isCritical() {
return criticality;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String getID() {
return id;
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Control.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Control.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Control.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Control.java Sat Jun 23 13:53:42 2007
@@ -15,28 +15,19 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.io.Serializable;
/**
- * A <code>Control</code> corresponds to a control used in LDAPv3. Controls are
- * specified in RFC2251. A control provides extra information related to an
- * operation on the server. It may be a request control which is sent when a
- * request is made to the LDAPv3 server or it may be a response control which
- * is received from the LDAPv3 server.
- *
- *
+ * A <code>Control</code> corresponds to a control used in LDAPv3. Controls
+ * are specified in RFC2251. A control provides extra information related to an
+ * operation on the server. It may be a request control which is sent when a
+ * request is made to the LDAPv3 server or it may be a response control which is
+ * received from the LDAPv3 server.
*/
public interface Control extends Serializable {
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
/**
* The constant indicating that a <code>Control</code> is critical.
*/
@@ -47,24 +38,18 @@
*/
public static final boolean NONCRITICAL = false;
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Returns the object ID assigned to this <code>Control</code> instance.
* (see RFC2251).
*
- * @return the object ID assigned to the control
+ * @return the object ID assigned to the control
*/
String getID();
/**
* Indicates whether this <code>Control</code> instance is critical.
*
- * @return true if critical, otherwise false
+ * @return true if critical, otherwise false
*/
boolean isCritical();
@@ -72,10 +57,8 @@
* Returns the value of this <code>Control</code> instance encoded using
* ASN.1 Basic Encoding Rules (BER).
*
- * @return the encoded value of this <code>Control</code> instance
+ * @return the encoded value of this <code>Control</code> instance
*/
byte[] getEncodedValue();
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ControlFactory.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.util.Hashtable;
@@ -28,15 +27,14 @@
import org.apache.harmony.jndi.internal.nls.Messages;
/**
- * 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
+ * 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 {
+
/**
* Constructs a <code>ControlFactory</code> instance with no parameters.
*/
@@ -46,57 +44,62 @@
/**
* 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.
-
+ * </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.
+ * @param c
+ * the supplied control
+ * @throws NamingException
+ * If an error is encountered.
* @return the control
*/
public abstract Control getControlInstance(Control c)
- throws NamingException;
+ 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.
+ * 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>
- * 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
+ * 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.
+ * @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 {
+ 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);
+ String fnames[] = EnvironmentReader
+ .getFactoryNamesFromEnvironmentAndProviderResource(h, ctx,
+ LdapContext.CONTROL_FACTORIES);
for (String element : fnames) {
// new factory instance by its class name
ControlFactory factory = null;
try {
- factory =
- (ControlFactory) classForName(element).newInstance();
+ factory = (ControlFactory) classForName(element).newInstance();
} catch (Exception e) {
continue;
}
@@ -117,37 +120,37 @@
* specified class, in a privileged manner.
*/
private static Class<?> classForName(final String className)
- throws ClassNotFoundException {
+ throws ClassNotFoundException {
- Class<?> cls = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
- public Class<?> 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 e) {
- // Ignored
- }
- // return null, if fail to load class
- return null;
- }
- });
+ Class<?> cls = AccessController
+ .doPrivileged(new PrivilegedAction<Class<?>>() {
+ public Class<?> 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 e) {
+ // Ignored
+ }
+ // return null, if fail to load class
+ return null;
+ }
+ });
if (cls == null) {
// jndi.1C=class {0} not found
- throw new ClassNotFoundException(Messages.getString("jndi.1C", className)); //$NON-NLS-1$
+ throw new ClassNotFoundException(Messages.getString(
+ "jndi.1C", className)); //$NON-NLS-1$
}
return cls;
-
}
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedRequest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedRequest.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedRequest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedRequest.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.io.Serializable;
@@ -25,52 +24,47 @@
* See RFC2251 for the definition of an <code>ExtendedRequest</code>.
*
* @see ExtendedResponse
- *
*/
public interface ExtendedRequest extends Serializable {
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
- * Gets the object ID assigned to this request.
- * (see RFC2251)
+ * Gets the object ID assigned to this request. (see RFC2251)
*
- * @return the object ID assigned to this request
+ * @return the object ID assigned to this request
*/
String getID();
/**
* Gets the request encoded using ASN.1 Basic Encoding Rules (BER).
*
- * @return the request encoded using ASN.1 BER
+ * @return the request encoded using ASN.1 BER
*/
byte[] getEncodedValue();
/**
- * Returns a suitable <code>ExtendedResponse</code> object for this request.
- * The method parameters provide the data obtained by the service provider
- * from the LDAP server for this request.
+ * Returns a suitable <code>ExtendedResponse</code> object for this
+ * request. The method parameters provide the data obtained by the service
+ * provider from the LDAP server for this request.
*
- * @param s the object identifier of the response control. May be
- * null.
- * @param value holds the value of the response control as raw ASN.1 BER
- * encoded bytes, including the tag and length of the response
- * but excluding its OID.
- * @param i specifies the start index of useable data within array
- * <code>value</code>.
- * @param i2 specifies the number of data bytes to use within array
- * <code>value</code>.
- * @return a suitable <code>ExtendedResponse</code> object for this request.
+ * @param s
+ * the object identifier of the response control. May be null.
+ * @param value
+ * holds the value of the response control as raw ASN.1 BER
+ * encoded bytes, including the tag and length of the response
+ * but excluding its OID.
+ * @param i
+ * specifies the start index of useable data within array
+ * <code>value</code>.
+ * @param i2
+ * specifies the number of data bytes to use within array
+ * <code>value</code>.
+ * @return a suitable <code>ExtendedResponse</code> object for this
+ * request.
*
- * @throws NamingException If an error is encountered.
+ * @throws NamingException
+ * If an error is encountered.
*/
- ExtendedResponse createExtendedResponse(String s, byte[] value, int i, int i2)
- throws NamingException;
+ ExtendedResponse createExtendedResponse(String s, byte[] value, int i,
+ int i2) throws NamingException;
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedResponse.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedResponse.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedResponse.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ExtendedResponse.java Sat Jun 23 13:53:42 2007
@@ -15,39 +15,27 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.io.Serializable;
/**
* See RFC2251 for the definition of an <code>ExtendedResponse</code>.
- *
- *
*/
public interface ExtendedResponse extends Serializable {
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
- * Gets the object ID assigned to this response.
- * (see RFC2251)
+ * Gets the object ID assigned to this response. (see RFC2251)
*
- * @return the object ID assigned to the response
+ * @return the object ID assigned to the response
*/
String getID();
/**
* Gets the response encoded using ASN.1 Basic Encoding Rules (BER).
*
- * @return the response encoded using ASN.1 BER
+ * @return the response encoded using ASN.1 BER
*/
byte[] getEncodedValue();
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/HasControls.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/HasControls.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/HasControls.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/HasControls.java Sat Jun 23 13:53:42 2007
@@ -15,36 +15,25 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
-import java.io.Serializable;
import javax.naming.NamingException;
/**
- * Objects implementing this interface can return an array of <code>Control</code>
- * instances.
+ * Objects implementing this interface can return an array of
+ * <code>Control</code> instances.
*
* @see Control
- *
*/
public interface HasControls {
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Returns an array of <code>Control</code> instances which may be null.
- *
- * @return an array of <code>Control</code> instances which
- * may be null
- * @throws NamingException If an error is encountered.
+ *
+ * @return an array of <code>Control</code> instances which may be null
+ * @throws NamingException
+ * If an error is encountered.
*/
Control[] getControls() throws NamingException;
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/InitialLdapContext.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.util.Hashtable;
@@ -28,77 +27,66 @@
/**
* 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
+ *
+ * See <code>LdapContext</code> for a description of the Request and Response
* controls.
*
* @see LdapContext
- *
*/
-public class InitialLdapContext
- extends InitialDirContext
- implements LdapContext {
+public class InitialLdapContext extends InitialDirContext implements
+ LdapContext {
/*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /*
- * This is set to the environment property java.naming.ldap.version.
+ * 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$
+ private static final String CONNECT_CONTROL = "java.naming.ldap.control.connect"; //$NON-NLS-1$
/*
- * The version of this LDAP context implementation.
+ * The version of this LDAP context implementation.
*/
private static final String THIS_LDAP_VERSION = "3"; //$NON-NLS-1$
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
- * Constructs an <code>InitialLdapContext</code> instance without using
+ * Constructs an <code>InitialLdapContext</code> instance without using
* any environment properties or connection controls.
*
- * @throws NamingException If an error is encountered.
+ * @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.
+ * 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.
+ * @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.
*/
- @SuppressWarnings("unchecked") //$NON-NLS-1$
+ @SuppressWarnings("unchecked")
public InitialLdapContext(Hashtable<?, ?> h, Control[] cs)
- throws NamingException {
+ throws NamingException {
super(true);
- /*
- * Prepare the environment properties to be inherited by the
- * service provider.
+ /*
+ * Prepare the environment properties to be inherited by the service
+ * provider.
*/
- Hashtable<Object,Object> newEnvironment = null;
+ Hashtable<Object, Object> newEnvironment = null;
if (null == h) {
- newEnvironment = new Hashtable<Object,Object>();
+ newEnvironment = new Hashtable<Object, Object>();
} else {
- newEnvironment = (Hashtable<Object,Object>) h.clone();
+ newEnvironment = (Hashtable<Object, Object>) h.clone();
}
// Set the environment property java.naming.ldap.control.connect
@@ -116,31 +104,19 @@
}
/*
- * -------------------------------------------------------------------
- * 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)) {
// jndi.1D=Expected an LdapContext object.
- throw new NotContextException(Messages.getString("jndi.1D")); //$NON-NLS-1$
+ throw new NotContextException(Messages.getString("jndi.1D")); //$NON-NLS-1$
}
return (LdapContext) super.defaultInitCtx;
}
- /*
- * -------------------------------------------------------------------
- * Methods of Interface LdapContext
- * -------------------------------------------------------------------
- */
-
public ExtendedResponse extendedOperation(ExtendedRequest e)
- throws NamingException {
+ throws NamingException {
return getDefaultInitLdapContext().extendedOperation(e);
}
@@ -169,5 +145,3 @@
}
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapContext.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapContext.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapContext.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import javax.naming.NamingException;
@@ -25,114 +24,114 @@
* An <code>LdapContext</code> is used when LDAPv3 extended operations and/or
* controls are required.
* <p>
- * Extended operations are dealt with by the <code>extendedOperation</code>
- * method. All other methods relate to the use of controls. Controls are extra
+ * Extended operations are dealt with by the <code>extendedOperation</code>
+ * method. All other methods relate to the use of controls. Controls are extra
* information provided to or from an LDAP v3 server. Controls are either of the
- * type <code>Request</code> or <code>Response</code>. There is a special type of
- * request controls known as connection controls.</p>
+ * type <code>Request</code> or <code>Response</code>. There is a special
+ * type of request controls known as connection controls.
+ * </p>
* <p>
* Connection controls are used by a service provider when connecting or
* reconnecting to an LDAP server. These are associated with connections and are
* inherited by derived <code>Context</code>. It should be noted however that
- * subsequent changes to a derived <code>Context</code>'s own connection
+ * subsequent changes to a derived <code>Context</code>'s own connection
* controls has no impact on the <code>Context</code> from which it inherited.
* There are a number of environment properties which relate specifically to
* LDAP service providers. The one which is important here is:
- * <code>java.naming.ldap.control.connect</code> which holds the array of
+ * <code>java.naming.ldap.control.connect</code> which holds the array of
* connection controls for a <code>Context</code>. Service providers rely on
- * this to pass on the connection controls to derived <code>Context</code>.</p>
+ * this to pass on the connection controls to derived <code>Context</code>.
+ * </p>
* <p>
* Request controls are used by a service provider when performing operations
* other than connecting or reconnecting. These are referred to as Context
- * Request Controls as they relate to the specific <code>Context</code>
+ * Request Controls as they relate to the specific <code>Context</code>
* instance. It must be noted that, unlike connection controls, they are not
- * inherited. Connection and request controls being split like this allows
- * service provider implementations to pool connections.</p>
+ * inherited. Connection and request controls being split like this allows
+ * service provider implementations to pool connections.
+ * </p>
* <p>
- * Response controls are generated by an LDAPv3 server.</p>
+ * Response controls are generated by an LDAPv3 server.
+ * </p>
*
* @see DirContext
- *
*/
public interface LdapContext extends DirContext {
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
/**
- * This is set to the environment property java.naming.factory.control.
+ * This is set to the environment property java.naming.factory.control.
*/
static final String CONTROL_FACTORIES = "java.naming.factory.control"; //$NON-NLS-1$
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Deals with extended operations of LDAPv3.
*
- * @param e an extended request
- * @return an extended response for the supplied request
- * @throws NamingException If an error is encountered.
+ * @param e
+ * an extended request
+ * @return an extended response for the supplied request
+ * @throws NamingException
+ * If an error is encountered.
*/
ExtendedResponse extendedOperation(ExtendedRequest e)
- throws NamingException;
+ throws NamingException;
/**
* Creates a new instance of <code>LdapContext</code> using the supplied
* controls.
*
- * @param ac an array of controls
- * @return a new <code>LdapContext</code> instance
- * @throws NamingException If an error is encountered.
+ * @param ac
+ * an array of controls
+ * @return a new <code>LdapContext</code> instance
+ * @throws NamingException
+ * If an error is encountered.
*/
LdapContext newInstance(Control[] ac) throws NamingException;
/**
* Reconnects using the supplied controls.
*
- * @param ac an array of controls
- * @throws NamingException If an error is encountered.
+ * @param ac
+ * an array of controls
+ * @throws NamingException
+ * If an error is encountered.
*/
void reconnect(Control[] ac) throws NamingException;
/**
* Gets an array of connection controls.
*
- * @return an array of connection controls
- * @throws NamingException If an error is encountered.
+ * @return an array of connection controls
+ * @throws NamingException
+ * If an error is encountered.
*/
Control[] getConnectControls() throws NamingException;
/**
* Sets the request controls.
*
- * @param ac an array of request controls
- * @throws NamingException If an error is encountered.
+ * @param ac
+ * an array of request controls
+ * @throws NamingException
+ * If an error is encountered.
*/
void setRequestControls(Control[] ac) throws NamingException;
/**
* Gets the request controls.
*
- * @return an array of request controls
- * @throws NamingException If an error is encountered.
+ * @return an array of request controls
+ * @throws NamingException
+ * If an error is encountered.
*/
Control[] getRequestControls() throws NamingException;
/**
* Gets the response controls.
*
- * @return an array of response controls
- * @throws NamingException If an error is encountered.
+ * @return an array of response controls
+ * @throws NamingException
+ * If an error is encountered.
*/
Control[] getResponseControls() throws NamingException;
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapName.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -32,34 +32,25 @@
import org.apache.harmony.jndi.internal.parser.LdapNameParser;
/**
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
+ * TODO: JavaDoc
*/
public class LdapName implements Name {
private static final long serialVersionUID = -1595520034788997356L;
private transient List<Rdn> rdns;
-
+
private transient String rdnsStr;
- /**
- * @ar.org.fitc.spec_ref
- */
public LdapName(List<Rdn> rdns) {
if (rdns == null) {
throw new NullPointerException("rdns "
+ Messages.getString("ldap.00"));
}
- this.rdns = new ArrayList(rdns);
+ this.rdns = new ArrayList<Rdn>(rdns);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public LdapName(String name) throws InvalidNameException {
rdnsStr = name;
LdapNameParser parser = new LdapNameParser(rdnsStr);
@@ -67,9 +58,6 @@
this.rdns = parser.getList();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name add(int posn, Rdn comp) {
if (comp == null) {
throw new NullPointerException("comp "
@@ -85,30 +73,18 @@
return this;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name add(int posn, String comp) throws InvalidNameException {
return add(posn, new Rdn(comp));
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name add(Rdn comp) {
return add(rdns.size(), comp);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name add(String comp) throws InvalidNameException {
return add(rdns.size(), comp);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name addAll(int posn, List<Rdn> suffixRdns) {
if (suffixRdns == null) {
throw new NullPointerException("suffixRdns "
@@ -124,38 +100,25 @@
return this;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name addAll(int posn, Name suffix) throws InvalidNameException {
if (suffix instanceof LdapName) {
return addAll(posn, ((LdapName) suffix).rdns);
- } else {
- List<Rdn> rdns = new ArrayList<Rdn>();
- for (Enumeration<?> iter = suffix.getAll(); iter.hasMoreElements();) {
- rdns.add(new Rdn((String) iter.nextElement()));
- }
- return addAll(posn, rdns);
}
+ List<Rdn> rdns = new ArrayList<Rdn>();
+ for (Enumeration<?> iter = suffix.getAll(); iter.hasMoreElements();) {
+ rdns.add(new Rdn((String) iter.nextElement()));
+ }
+ return addAll(posn, rdns);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name addAll(List<Rdn> suffixRdns) {
return addAll(rdns.size(), suffixRdns);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name addAll(Name suffix) throws InvalidNameException {
return addAll(rdns.size(), suffix);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Object clone() {
try {
if (rdnsStr != null) {
@@ -170,37 +133,33 @@
return new LdapName(lista);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int compareTo(Object obj) {
if (obj == null || !(obj instanceof LdapName)) {
throw new ClassCastException("obj " + Messages.getString("ldap.01"));
}
LdapName ln = (LdapName) obj;
-
+
Iterator<?> iter = rdns.iterator();
Iterator<?> iter2 = ln.rdns.iterator();
- while (iter.hasNext() && iter2.hasNext() ) {
+ while (iter.hasNext() && iter2.hasNext()) {
int c = iter.next().toString().toLowerCase().compareTo(
iter2.next().toString().toLowerCase());
- if( c != 0 ) {
+ if (c != 0) {
return c;
}
}
- if( iter.hasNext() ) return 1;
- if( iter2.hasNext() ) return -1;
-
+ if (iter.hasNext())
+ return 1;
+ if (iter2.hasNext())
+ return -1;
+
return 0;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean endsWith(List<Rdn> rdns) {
try {
Iterator<?> iter = rdns.iterator();
@@ -219,9 +178,6 @@
}
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean endsWith(Name n) {
try {
return n.equals(getSuffix(rdns.size() - n.size()));
@@ -229,9 +185,7 @@
return false;
}
}
- /**
- * @ar.org.fitc.spec_ref
- */
+
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof LdapName)) {
return false;
@@ -253,16 +207,10 @@
return true;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String get(int posn) {
return getRdn(posn).toString();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Enumeration<String> getAll() {
final Iterator<Rdn> rdns = getRdns().iterator();
@@ -278,9 +226,6 @@
};
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name getPrefix(int posn) {
if (posn < 0) {
throw new IndexOutOfBoundsException(Messages.getString("ldap.02"));
@@ -288,23 +233,14 @@
return new LdapName(rdns.subList(0, posn));
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Rdn getRdn(int posn) {
return rdns.get(posn);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public List<Rdn> getRdns() {
return rdns;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Name getSuffix(int posn) {
if (posn > rdns.size()) {
throw new IndexOutOfBoundsException(Messages.getString("ldap.02"));
@@ -313,9 +249,6 @@
return new LdapName(rdns.subList(posn, rdns.size()));
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int hashCode() {
int sum = 0;
for (Iterator<?> iter = rdns.iterator(); iter.hasNext();) {
@@ -324,31 +257,19 @@
return sum;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean isEmpty() {
return rdns.size() == 0;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Object remove(int posn) throws InvalidNameException {
rdnsStr = null;
return rdns.remove(posn).toString();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int size() {
return rdns.size();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean startsWith(List<Rdn> rdns) {
try {
Iterator<?> iter = rdns.iterator();
@@ -366,9 +287,6 @@
}
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean startsWith(Name n) {
try {
return n.equals(getPrefix(n.size()));
@@ -378,15 +296,12 @@
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String toString() {
if (rdnsStr != null) {
return rdnsStr;
}
if (rdns.size() == 0) {
- return "";
+ return ""; //$NON-NLS-1$
}
StringBuffer sb = new StringBuffer();
@@ -397,7 +312,8 @@
}
return sb.toString();
}
-
+
+ @SuppressWarnings("unchecked")
private void readObject(ObjectInputStream ois) throws IOException,
ClassNotFoundException, InvalidNameException {
ois.defaultReadObject();
@@ -409,4 +325,5 @@
oos.defaultWriteObject();
oos.writeObject(this.toString());
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/LdapReferralException.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.util.Hashtable;
@@ -27,56 +26,39 @@
/**
* <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
+ * This constant is used during deserialization to check the version which
* created the serialized object.
*/
- static final long serialVersionUID = -1668992791764950804L; // J2SE 1.4.2
-
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
+ static final long serialVersionUID = -1668992791764950804L;
/**
* Default constructor.
*/
protected LdapReferralException() {
- super();
+ super();
}
/**
* Constructs an LdapReferralException instance using the supplied text of
* the message
- * @param s the supplied text of the message, which may be null
+ *
+ * @param s
+ * the supplied text of the message, which may be null
*/
protected LdapReferralException(String s) {
super(s);
}
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Gets referral context without environment properties.
*
- * @return referral context
+ * @return referral context
* @throws NamingException
- * If cannot get referral context correctly.
+ * If cannot get referral context correctly.
*/
@Override
public abstract Context getReferralContext() throws NamingException;
@@ -84,28 +66,29 @@
/**
* Gets referral context with environment properties.
*
- * @param h environment properties
- * @return referral context
+ * @param h
+ * environment properties
+ * @return referral context
* @throws NamingException
- * If cannot get referral context correctly.
+ * If cannot get referral context correctly.
*/
@Override
public abstract Context getReferralContext(Hashtable<?, ?> h)
- throws NamingException;
+ throws NamingException;
/**
* Gets referral context with environment properties and an array of LDAPv3
* controls.
*
- * @param h environment properties
- * @param cs array of LDAPv3 controls
- * @return referral context
+ * @param h
+ * environment properties
+ * @param cs
+ * array of LDAPv3 controls
+ * @return referral context
* @throws NamingException
- * If cannot get referral context correctly.
+ * If cannot get referral context correctly.
*/
public abstract Context getReferralContext(Hashtable<?, ?> h, Control[] cs)
- throws NamingException;
+ throws NamingException;
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ManageReferralControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ManageReferralControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ManageReferralControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/ManageReferralControl.java Sat Jun 23 13:53:42 2007
@@ -13,36 +13,23 @@
* 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;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- * @author Osvaldo C. Demo
+ * TODO: JavaDoc
*/
public final class ManageReferralControl extends BasicControl {
private static final long serialVersionUID = 3017756160149982566L;
- /**
- * @ar.org.fitc.spec_ref
- */
- public static final String OID = "2.16.840.1.113730.3.4.2";
-
- /**
- * @ar.org.fitc.spec_ref
- */
+ public static final String OID = "2.16.840.1.113730.3.4.2"; //$NON-NLS-1$
+
public ManageReferralControl() {
super(OID, Control.CRITICAL, null);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public ManageReferralControl(boolean criticality) {
super(OID, criticality, null);
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsControl.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -28,16 +28,16 @@
import org.apache.harmony.security.asn1.BerInputStream;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
+ * TODO: JavaDoc
*/
public final class PagedResultsControl extends BasicControl {
+ private static final long serialVersionUID = 6684806685736844298L;
+
+ public static final String OID = "1.2.840.113556.1.4.319"; //$NON-NLS-1$
+
/**
- * static ASN1 Encoder for Paged Result Control using
+ * Static ASN1 Encoder for Paged Result Control using
* PagedResultSearchControlValue
*/
static ASN1Type ASN1_ENCODER = new ASN1Sequence(new ASN1Type[] {
@@ -56,7 +56,7 @@
PagedResultSearchControlValue pg = (PagedResultSearchControlValue) object;
values[0] = BigInteger.valueOf(pg.getSize()).toByteArray();
if (pg.getCookie() == null) {
- values[1] = "".getBytes();
+ values[1] = "".getBytes(); //$NON-NLS-1$
} else {
values[1] = pg.getCookie();
}
@@ -64,26 +64,13 @@
}
};
- private static final long serialVersionUID = 6684806685736844298L;
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public static final String OID = "1.2.840.113556.1.4.319";
-
- /**
- * @ar.org.fitc.spec_ref
- */
public PagedResultsControl(int pageSize, boolean criticality)
throws IOException {
super(OID, criticality, null);
this.value = ASN1_ENCODER.encode(new PagedResultSearchControlValue(
- pageSize, "".getBytes()));
+ pageSize, "".getBytes())); //$NON-NLS-1$
}
- /**
- * @ar.org.fitc.spec_ref
- */
public PagedResultsControl(int pageSize, byte[] cookie, boolean criticality)
throws IOException {
super(OID, criticality, null);
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsResponseControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsResponseControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsResponseControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/PagedResultsResponseControl.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -22,28 +22,18 @@
import org.apache.harmony.jndi.internal.PagedResultSearchControlValue;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- * @author Osvaldo C. Demo
- *
+ * TODO: JavaDoc
*/
public final class PagedResultsResponseControl extends BasicControl {
private static final long serialVersionUID = -8819778744844514666L;
-
+
+ public static final String OID = "1.2.840.113556.1.4.319"; //$NON-NLS-1$
+
private int resultSize;
+
private byte[] cookie;
- /**
- * @ar.org.fitc.spec_ref
- */
- public static final String OID = "1.2.840.113556.1.4.319";
-
- /**
- * @ar.org.fitc.spec_ref
- */
public PagedResultsResponseControl(String id, boolean criticality,
byte[] value) throws IOException {
super(id, criticality, value);
@@ -53,20 +43,13 @@
cookie = pgscv.getCookie();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public byte[] getCookie() {
if (cookie.length == 0) {
return null;
- } else {
- return cookie;
}
+ return cookie;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int getResultSize() {
return resultSize;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Rdn.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Rdn.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Rdn.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/Rdn.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -39,33 +39,24 @@
import org.apache.harmony.jndi.internal.parser.LdapTypeAndValueList;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 1.0
- * @author Osvaldo C. Demo
- *
+ * TODO: JavaDoc
*/
public class Rdn implements Serializable, Comparable<Object> {
private static final long serialVersionUID = -5994465067210009656L;
- /**
- * @ar.org.fitc.spec_ref
- */
public static String escapeValue(Object val) {
if (val == null) {
- throw new NullPointerException("val "+Messages.getString("ldap.00"));
+ throw new NullPointerException("val "
+ + Messages.getString("ldap.00"));
}
return LdapRdnParser.escapeValue(val);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public static Object unescapeValue(String val) {
if (val == null) {
- throw new NullPointerException("val "+Messages.getString("ldap.00"));
+ throw new NullPointerException("val "
+ + Messages.getString("ldap.00"));
}
return LdapRdnParser.unescapeValue(val);
}
@@ -74,19 +65,18 @@
private transient LdapRdnParser parser;
- /**
- * @ar.org.fitc.spec_ref
- */
public Rdn(Attributes attrSet) throws InvalidNameException {
if (attrSet == null) {
- throw new NullPointerException("attrSet "+Messages.getString("ldap.00"));
+ throw new NullPointerException("attrSet "
+ + Messages.getString("ldap.00"));
}
if (attrSet.size() == 0) {
- throw new InvalidNameException("atrrSet "+Messages.getString("ldap.03"));
+ throw new InvalidNameException("atrrSet "
+ + Messages.getString("ldap.03"));
}
- //check all the elements to follow RI's behavior
+ // check all the elements to follow RI's behavior
NamingEnumeration<? extends Attribute> ne = attrSet.getAll();
while (ne.hasMoreElements()) {
Attribute at = ne.nextElement();
@@ -99,23 +89,19 @@
list = convertToAttributeArrayList(attrSet);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Rdn(Rdn rdn) {
if (rdn == null) {
- throw new NullPointerException("rdn "+Messages.getString("ldap.00"));
+ throw new NullPointerException("rdn "
+ + Messages.getString("ldap.00"));
}
list = convertToAttributeArrayList(rdn.toAttributes());
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Rdn(String rdnString) throws InvalidNameException {
if (rdnString == null) {
- throw new NullPointerException("rdnString "+Messages.getString("ldap.00"));
+ throw new NullPointerException("rdnString "
+ + Messages.getString("ldap.00"));
}
if (rdnString.length() != 0) {
@@ -126,9 +112,6 @@
}
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Rdn(String type, Object value) throws InvalidNameException {
if (type == null) {
throw new NullPointerException("type "
@@ -154,31 +137,37 @@
true));
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int compareTo(Object obj) {
if (!(obj instanceof Rdn)) {
- throw new ClassCastException(Messages.getString("ldap.06"));
+ throw new ClassCastException(Messages.getString("ldap.06")); //$NON-NLS-1$
}
Rdn rdn = (Rdn) obj;
- String s1 = "", s2 = "";
+ String s1 = ""; //$NON-NLS-1$
+ String s2 = ""; //$NON-NLS-1$
- for (Enumeration<?> iter = toAttributes().getAll(); iter.hasMoreElements();) {
+ for (Enumeration<?> iter = toAttributes().getAll(); iter
+ .hasMoreElements();) {
s1 = s1 + escapeValue(iter.nextElement().toString());
-
- //this one does not seem necessary. Spec does not require it, if there are apps that depend on commas, uncomment it
- //if (iter.hasMoreElements()) {
- // s1 = s1 + ",";
- //}
+
+ /*
+ * this one does not seem necessary. Spec does not require it, if
+ * there are apps that depend on commas, uncomment it
+ */
+ // if (iter.hasMoreElements()) {
+ // s1 = s1 + ",";
+ // }
}
- for (Enumeration<?> iter = rdn.toAttributes().getAll(); iter.hasMoreElements();) {
+ for (Enumeration<?> iter = rdn.toAttributes().getAll(); iter
+ .hasMoreElements();) {
s2 = s2 + escapeValue(iter.nextElement().toString());
- //this one does not seem necessary. Spec does not require it, if there are apps that depend on commas, uncomment it
- //if (iter.hasMoreElements()) {
- // s2 = s2 + ",";
- //}
+ /*
+ * this one does not seem necessary. Spec does not require it, if
+ * there are apps that depend on commas, uncomment it
+ */
+ // if (iter.hasMoreElements()) {
+ // s2 = s2 + ",";
+ // }
}
return s1.toLowerCase().compareTo(s2.toLowerCase());
}
@@ -192,15 +181,12 @@
Attribute attr = ne.nextElement();
myList.put(attr.getID(), attr.get());
}
- } catch (NamingException e){
-
+ } catch (NamingException e) {
+
}
return myList.toAttributeList();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean equals(Object obj) {
if (!(obj instanceof Rdn) || this.size() != ((Rdn) obj).size()) {
@@ -212,7 +198,8 @@
}
NamingEnumeration<? extends Attribute> iter1 = toAttributes().getAll();
- NamingEnumeration<? extends Attribute> iter2 = ((Rdn) obj).toAttributes().getAll();
+ NamingEnumeration<? extends Attribute> iter2 = ((Rdn) obj)
+ .toAttributes().getAll();
while (iter1.hasMoreElements()) {
Attribute a1 = iter1.nextElement();
@@ -229,16 +216,18 @@
en1 = a1.getAll();
en2 = a2.getAll();
} catch (NamingException e) {
- //what is the correct way for this?
+ // what is the correct way for this?
return false;
}
while (en1.hasMoreElements()) {
Object o1 = en1.nextElement();
- String s1 = (o1 instanceof String) ? (String)o1 : escapeValue(o1);
+ String s1 = (o1 instanceof String) ? (String) o1
+ : escapeValue(o1);
Object o2 = en2.nextElement();
- String s2 = (o2 instanceof String) ? (String)o2 : escapeValue(o2);
+ String s2 = (o2 instanceof String) ? (String) o2
+ : escapeValue(o2);
if (!(s1.toLowerCase().equals(s2.toLowerCase()))) {
return false;
@@ -248,16 +237,10 @@
return true;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String getType() {
return list.get(0).getID();
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Object getValue() {
Object a = null;
try {
@@ -268,9 +251,6 @@
return a;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int hashCode() {
int sum = 0;
@@ -288,7 +268,7 @@
while (en.hasMoreElements()) {
Object obj = en.nextElement();
if (obj instanceof byte[]) {
- obj = new String((byte[])obj);
+ obj = new String((byte[]) obj);
}
try {
String s = (String) obj;
@@ -301,9 +281,6 @@
return sum;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public int size() {
int result = 0;
for (Iterator<Attribute> iter = list.iterator(); iter.hasNext();) {
@@ -312,9 +289,6 @@
return result;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public Attributes toAttributes() {
BasicAttributes bas = new BasicAttributes(true);
for (Iterator<Attribute> iter = list.iterator(); iter.hasNext();) {
@@ -333,9 +307,6 @@
return bas;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String toString() {
StringBuffer sb = new StringBuffer();
for (Iterator<Attribute> iter = list.iterator(); iter.hasNext();) {
@@ -369,7 +340,8 @@
ois.defaultReadObject();
String rdnString = (String) ois.readObject();
if (rdnString == null) {
- throw new NullPointerException("rdnString "+Messages.getString("ldap.00"));
+ throw new NullPointerException("rdnString "
+ + Messages.getString("ldap.00"));
}
if (rdnString.length() != 0) {
parser = new LdapRdnParser(rdnString);
@@ -383,4 +355,5 @@
oos.defaultWriteObject();
oos.writeObject(this.toString());
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortControl.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -29,11 +29,7 @@
import org.apache.harmony.security.asn1.ASN1Type;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
+ * TODO: JavaDoc
*/
public final class SortControl extends BasicControl {
@@ -75,56 +71,42 @@
* Represents the following ASN1 Syntax:
*
* SortKeyList ::= SEQUENCE OF SortKey;
- *
*/
- static ASN1SequenceOf ASN1_SORTKEYLIST = new ASN1SequenceOf(
- ASN1_SORTKEY);
+ static ASN1SequenceOf ASN1_SORTKEYLIST = new ASN1SequenceOf(ASN1_SORTKEY);
private static final long serialVersionUID = -1965961680233330744L;
- /**
- * @ar.org.fitc.spec_ref
- */
- public static final String OID = "1.2.840.113556.1.4.473";
+ public static final String OID = "1.2.840.113556.1.4.473"; //$NON-NLS-1$
- /**
- * @ar.org.fitc.spec_ref
- */
public SortControl(String sortBy, boolean criticality) throws IOException {
super(OID, criticality, null);
- ArrayList list = new ArrayList();
+ ArrayList<SortKey> list = new ArrayList<SortKey>();
if (sortBy != null) {
list.add(new SortKey(sortBy, true, null));
} else {
- list.add(new SortKey("", true, null));
+ list.add(new SortKey("", true, null)); //$NON-NLS-1$
}
value = ASN1_SORTKEYLIST.encode(list);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public SortControl(String[] sortBy, boolean criticality) throws IOException {
super(OID, criticality, null);
- ArrayList list = new ArrayList();
+ ArrayList<SortKey> list = new ArrayList<SortKey>();
for (int i = 0; i < sortBy.length; i++) {
list.add(new SortKey(sortBy[i], true, null));
}
value = ASN1_SORTKEYLIST.encode(list);
}
- /**
- * @ar.org.fitc.spec_ref
- */
public SortControl(SortKey[] sortBy, boolean criticality)
throws IOException {
super(OID, criticality, null);
- ArrayList list = new ArrayList();
+ ArrayList<SortKey> list = new ArrayList<SortKey>();
for (int i = 0; i < sortBy.length; i++) {
list.add(sortBy[i]);
}
this.value = ASN1_SORTKEYLIST.encode(list);
-
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortKey.java Sat Jun 23 13:53:42 2007
@@ -13,17 +13,12 @@
* 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;
-
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
+ * TODO: JavaDoc
*/
public class SortKey {
@@ -33,40 +28,25 @@
boolean ascendingOrder;
- /**
- * @ar.org.fitc.spec_ref
- */
public SortKey(String attrID) {
this.attrID = attrID;
this.ascendingOrder = true;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public SortKey(String attrID, boolean ascendingOrder, String matchingRuleID) {
this.attrID = attrID;
this.ascendingOrder = ascendingOrder;
this.matchingRuleID = matchingRuleID;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String getAttributeID() {
return attrID;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String getMatchingRuleID() {
return matchingRuleID;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public boolean isAscending() {
return ascendingOrder;
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortResponseControl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortResponseControl.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortResponseControl.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/SortResponseControl.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -30,85 +30,63 @@
import org.apache.harmony.security.asn1.ASN1Type;
import org.apache.harmony.security.asn1.BerInputStream;
-
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- * @author Osvaldo C. Demo
- *
+ * TODO: JavaDoc
*/
public final class SortResponseControl extends BasicControl {
-
+
/**
- * Represents the following ASN1 Syntax to use with the Harmony ASN1 Parser:<br><br>
+ * Represents the following ASN1 Syntax to use with the Harmony ASN1 Parser:<br>
+ * <br>
+ *
+ * SortResult ::= SEQUENCE { sortResult ENUMERATED { success (0), -- results
+ * are sorted operationsError (1), -- server internal failure
+ * timeLimitExceeded (3), -- timelimit reached before -- sorting was
+ * completed strongAuthRequired (8), -- refused to return sorted -- results
+ * via insecure -- protocol adminLimitExceeded (11), -- too many matching
+ * entries -- for the server to sort noSuchAttribute (16), -- unrecognized
+ * attribute -- type in sort key inappropriateMatching (18), -- unrecognized
+ * or -- inappropriate matching -- rule in sort key insufficientAccessRights
+ * (50), -- refused to return sorted -- results to this client busy (51), --
+ * too busy to process unwillingToPerform (53), -- unable to sort other (80) },
+ * attributeType [0] AttributeDescription OPTIONAL }
*
- * SortResult ::= SEQUENCE {
- * sortResult ENUMERATED {
- * success (0), -- results are sorted
- * operationsError (1), -- server internal failure
- * timeLimitExceeded (3), -- timelimit reached before
- * -- sorting was completed
- * strongAuthRequired (8), -- refused to return sorted
- * -- results via insecure
- * -- protocol
- * adminLimitExceeded (11), -- too many matching entries
- * -- for the server to sort
- * noSuchAttribute (16), -- unrecognized attribute
- * -- type in sort key
- * inappropriateMatching (18), -- unrecognized or
- * -- inappropriate matching
- * -- rule in sort key
- * insufficientAccessRights (50), -- refused to return sorted
- * -- results to this client
- * busy (51), -- too busy to process
- * unwillingToPerform (53), -- unable to sort
- * other (80)
- * },
- * attributeType [0] AttributeDescription OPTIONAL }
- *
*/
static ASN1Type ASN1_SORTRESPONSE = new ASN1Sequence(new ASN1Type[] {
- ASN1Enumerated.getInstance(), // sortResult
- ASN1OctetString.getInstance(), // attributeType
+ ASN1Enumerated.getInstance(), // sortResult
+ ASN1OctetString.getInstance(), // attributeType
}) {
-
+
{
setOptional(1);
}
-
+
public Object getDecodedObject(BerInputStream in) {
- Object values[] = (Object[])in.content;
+ Object values[] = (Object[]) in.content;
int sortresult = new BigInteger((byte[]) values[0]).intValue();
- String attrtype= null;
+ String attrtype = null;
try {
- attrtype = new String((byte[])values[1]);
+ attrtype = new String((byte[]) values[1]);
} catch (NullPointerException e) {
}
- return new SortResult(sortresult,attrtype);
+ return new SortResult(sortresult, attrtype);
}
-
+
};
-
+
private static final long serialVersionUID = 5142939176006310877L;
-
+
private int resultCode;
-
- private String badAttrId;
-
+
+ private String badAttrId;
+
private transient boolean sorted = false;
-
- /**
- * @ar.org.fitc.spec_ref
- */
+
public static final String OID = "1.2.840.113556.1.4.474";
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public SortResponseControl(String id, boolean criticality, byte[] value) throws IOException {
- super(OID,criticality,value);
+
+ public SortResponseControl(String id, boolean criticality, byte[] value)
+ throws IOException {
+ super(OID, criticality, value);
SortResult sr;
sr = (SortResult) ASN1_SORTRESPONSE.decode(value);
resultCode = sr.getSortresult();
@@ -119,32 +97,21 @@
sorted = false;
}
}
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public String getAttributeID () {
+
+ public String getAttributeID() {
return badAttrId;
}
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public int getResultCode () {
+
+ public int getResultCode() {
return resultCode;
}
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public boolean isSorted () {
+
+ public boolean isSorted() {
return sorted;
}
-
- /**
- * @ar.org.fitc.spec_ref
- */
- public NamingException getException () {
+
+ public NamingException getException() {
return Util.getExceptionFromErrorCode(getResultCode());
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsRequest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsRequest.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsRequest.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsRequest.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -28,53 +28,34 @@
import org.apache.harmony.jndi.internal.nls.Messages;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
- * @author Osvaldo C. Demo
- *
+ * TODO: JavaDoc
*/
public class StartTlsRequest implements ExtendedRequest {
private static final long serialVersionUID = 4441679576360753397L;
- /**
- * @ar.org.fitc.spec_ref
- */
- public static final String OID = "1.3.6.1.4.1.1466.20037";
-
- /**
- * @ar.org.fitc.spec_ref
- */
+ public static final String OID = "1.3.6.1.4.1.1466.20037"; //$NON-NLS-1$
+
public byte[] getEncodedValue() {
return null;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public String getID() {
return OID;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public ExtendedResponse createExtendedResponse(String id, byte[] berValue,
int offset, int length) throws NamingException {
if (id != null && !OID.equals(id)) {
- throw new NamingException(
- Messages.getString("ldap.07") +" "+ id);
+ throw new NamingException(Messages.getString("ldap.07") + " " + id);
}
ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Enumeration<URL> en = cl
- .getResources("META-INF/services/javax.naming.ldap.StartTlsResponse");
+ .getResources("META-INF/services/javax.naming.ldap.StartTlsResponse"); //$NON-NLS-1$
while (en.hasMoreElements()) {
URL confFile = en.nextElement();
BufferedReader reader = null;
@@ -85,15 +66,18 @@
String line;
while ((line = reader.readLine()) != null) {
// remove comments, spaces, and tabs
- String className = line.split("#")[0].trim();
+ String className = line.split("#")[0].trim(); //$NON-NLS-1$
// try to load class
- if (!(className.equals(""))) {
+ if (!(className.equals(""))) { //$NON-NLS-1$
try {
- // TODO: the spec requires to return an instanse
- // of the first class that might be successfully
- // instantiated, RI breaks on the first
- // unsuccessful attempt. We follow the spec here
+ /*
+ * TODO: the spec requires to return an instance
+ * of the first class that might be successfully
+ * instantiated, RI breaks on the first
+ * unsuccessful attempt. We follow the spec
+ * here.
+ */
return (StartTlsResponse) Class.forName(
className, true, cl).newInstance();
} catch (Exception ignore) {
@@ -114,6 +98,6 @@
}
// TODO: return a provider default implementation
- throw new NamingException(Messages.getString("ldap.09"));
+ throw new NamingException(Messages.getString("ldap.09")); //$NON-NLS-1$
}
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsResponse.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsResponse.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsResponse.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/StartTlsResponse.java Sat Jun 23 13:53:42 2007
@@ -13,7 +13,7 @@
* 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;
@@ -24,62 +24,32 @@
import javax.net.ssl.SSLSocketFactory;
/**
- *
- * @ar.org.fitc.spec_ref
- *
- * @version 0.0.1
- *
- * @author Osvaldo C. Demo
- *
+ * TODO: JavaDoc
*/
public abstract class StartTlsResponse implements ExtendedResponse {
- public static final String OID = "1.3.6.1.4.1.1466.20037";
+ public static final String OID = "1.3.6.1.4.1.1466.20037"; //$NON-NLS-1$
- /**
- * @ar.org.fitc.spec_ref
- */
protected StartTlsResponse() {
-
}
- /**
- * @ar.org.fitc.spec_ref
- */
public byte[] getEncodedValue() {
return null;
}
- /**
- * @ar.org.fitc.spec_ref
- */
public abstract SSLSession negotiate() throws IOException;
- /**
- * @ar.org.fitc.spec_ref
- */
public abstract SSLSession negotiate(SSLSocketFactory factory)
throws IOException;
- /**
- * @ar.org.fitc.spec_ref
- */
public abstract void setEnabledCipherSuites(String[] suites);
- /**
- * @ar.org.fitc.spec_ref
- */
public abstract void setHostnameVerifier(HostnameVerifier verifier);
- /**
- * @ar.org.fitc.spec_ref
- */
public abstract void close() throws IOException;
- /**
- * @ar.org.fitc.spec_ref
- */
public String getID() {
return OID;
}
+
}
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotification.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotification.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotification.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotification.java Sat Jun 23 13:53:42 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import javax.naming.NamingException;
@@ -25,35 +24,29 @@
*
* @see ExtendedResponse
* @see HasControls
- *
*/
-public interface UnsolicitedNotification
- extends ExtendedResponse, HasControls {
-
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
+public interface UnsolicitedNotification extends ExtendedResponse, HasControls {
/**
* Gets the referrals associated with this <code>UnsolicitedNotification
- * </code> instance.
+ * </code>
+ * instance.
*
- * @return the referrals associated with this <code>
- * UnsolicitedNotification</code> instance
+ * @return the referrals associated with this <code>
+ * UnsolicitedNotification</code>
+ * instance
*/
String[] getReferrals();
/**
* Gets the naming exception associated with this <code>
- * UnsolicitedNotification</code> instance.
+ * UnsolicitedNotification</code>
+ * instance.
*
- * @return the naming exception associated with this <code>
- * UnsolicitedNotification</code> instance
+ * @return the naming exception associated with this <code>
+ * UnsolicitedNotification</code>
+ * instance
*/
NamingException getException();
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationEvent.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationEvent.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationEvent.java Sat Jun 23 13:53:42 2007
@@ -15,90 +15,64 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import java.util.EventObject;
/**
- * This event is fired when an LDAP server sends an unsolited notification.
- * (See RFC2251).
- *
- *
+ * This event is fired when an LDAP server sends an unsolicited notification.
+ * (See RFC2251).
*/
public class UnsolicitedNotificationEvent extends EventObject {
/*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /*
- * This constant is used during deserialization to check the J2SE version
- * which created the serialized object.
- */
- static final long serialVersionUID = -2382603380799883705L; //J2SE 1.4.2
-
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
+ * This constant is used during deserialization to check the version which
+ * created the serialized object.
*/
+ static final long serialVersionUID = -2382603380799883705L;
/**
* The specific notification.
*
* @serial
- */
+ */
private UnsolicitedNotification notice;
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
* Constructs an <code>UnsolicitedNotificationEvent</code> instance using
* the supplied <code>UnsolicitedNotification</code> instance.
*
- * @param o the source of the event which cannot be null
- * @param un the <code>UnsolicitedNotification</code> instance which
- * cannot be null
- */
+ * @param o
+ * the source of the event which cannot be null
+ * @param un
+ * the <code>UnsolicitedNotification</code> instance which
+ * cannot be null
+ */
public UnsolicitedNotificationEvent(Object o, UnsolicitedNotification un) {
super(o);
this.notice = un;
}
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
- * Returns the <code>UnsolicitedNotification</code> instance associated with
- * this event.
+ * Returns the <code>UnsolicitedNotification</code> instance associated
+ * with this event.
*
- * @return the <code>UnsolicitedNotification</code> instance associated
- * with this event
+ * @return the <code>UnsolicitedNotification</code> instance associated
+ * with this event
*/
public UnsolicitedNotification getNotification() {
return notice;
}
/**
- * Uses this event to trigger a notification received on the supplied
+ * Uses this event to trigger a notification received on the supplied
* listener.
*
- * @param unl the listener to dispatch this event to. It cannot be null.
+ * @param unl
+ * the listener to dispatch this event to. It cannot be null.
*/
public void dispatch(UnsolicitedNotificationListener unl) {
unl.notificationReceived(this);
}
}
-
-
Modified: harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationListener.java?view=diff&rev=550106&r1=550105&r2=550106
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationListener.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/jndi/src/main/java/javax/naming/ldap/UnsolicitedNotificationListener.java Sat Jun 23 13:53:42 2007
@@ -15,33 +15,24 @@
* limitations under the License.
*/
-
package javax.naming.ldap;
import javax.naming.event.NamingListener;
/**
- * A listener that wishes to receive unsolicited notifications.
- * See RFC2251 for the definition of an <code>UnsolicitedNotification</code>.
+ * A listener that wishes to receive unsolicited notifications. See RFC2251 for
+ * the definition of an <code>UnsolicitedNotification</code>.
*
* @see UnsolicitedNotification
- *
*/
public interface UnsolicitedNotificationListener extends NamingListener {
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Accepts an unsolicited notification.
*
- * @param e an unsolicited notification
+ * @param e
+ * an unsolicited notification
*/
void notificationReceived(UnsolicitedNotificationEvent e);
}
-
-