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/22 22:48:56 UTC
svn commit: r549955 [8/16] - in
/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java: javax/naming/
javax/naming/directory/ javax/naming/event/ javax/naming/ldap/
javax/naming/spi/ org/apache/harmony/jndi/internal/
org/apache/harmony/jndi/intern...
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/ModificationItem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/ModificationItem.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/ModificationItem.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/ModificationItem.java Fri Jun 22 13:48:49 2007
@@ -24,33 +24,21 @@
/**
* This class is a combination of a modification code and attribute.
* <p>
- * It is used by exception reporting (see
- * <code>AttributeModificationException</code> for an example).</p>
+ * It is used by exception reporting (see
+ * <code>AttributeModificationException</code> for an example).
+ * </p>
* <p>
- * The class is not thread-safe.</p>
- *
- *
+ * The class is not thread-safe.
+ * </p>
*/
public class ModificationItem implements Serializable {
/*
- * -------------------------------------------------------------------
- * 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
*/
private static final long serialVersionUID = 0x69199e89ac11aae2L;
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
/**
* Contains the modification to be performed.
*
@@ -62,52 +50,46 @@
/**
* The Attribute or value that is the source of the modification.
*
- * @serial
+ * @serial
*/
private Attribute attr;
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
- * Constructs a <code>ModificationItem</code> instance with all parameters.
+ * Constructs a <code>ModificationItem</code> instance with all
+ * parameters.
*
- * @param operation an operation code chosen from <code>DirContext.ADD_ATTRIBUTE</code>,
- * <code>DirContext.REPLACE_ATTRIBUTE</code>,
- * <code>DirContext.REMOVE_ATTRIBUTE</code>
- * @param attribute the <code>Attribute</code> or value that is the
- * source of the modification
+ * @param operation
+ * an operation code chosen from
+ * <code>DirContext.ADD_ATTRIBUTE</code>,
+ * <code>DirContext.REPLACE_ATTRIBUTE</code>,
+ * <code>DirContext.REMOVE_ATTRIBUTE</code>
+ * @param attribute
+ * the <code>Attribute</code> or value that is the source of
+ * the modification
*/
public ModificationItem(int operation, Attribute attribute) {
if (null == attribute) {
// jndi.13=Non-null attribute is required for modification
- throw new IllegalArgumentException(Messages.getString("jndi.13")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("jndi.13")); //$NON-NLS-1$
}
if (!(DirContext.ADD_ATTRIBUTE == operation
- || DirContext.REPLACE_ATTRIBUTE == operation
- || DirContext.REMOVE_ATTRIBUTE == operation)) {
- // jndi.14=Modification code {0} must be one of DirContext.ADD_ATTRIBUTE, DirContext.REPLACE_ATTRIBUTE and DirContext.REMOVE_ATTRIBUTE
- throw new IllegalArgumentException(Messages.getString("jndi.14", operation)); //$NON-NLS-1$
+ || DirContext.REPLACE_ATTRIBUTE == operation || DirContext.REMOVE_ATTRIBUTE == operation)) {
+ // jndi.14=Modification code {0} must be one of
+ // DirContext.ADD_ATTRIBUTE, DirContext.REPLACE_ATTRIBUTE and
+ // DirContext.REMOVE_ATTRIBUTE
+ throw new IllegalArgumentException(Messages.getString(
+ "jndi.14", operation)); //$NON-NLS-1$
}
this.mod_op = operation;
this.attr = attribute;
}
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
- * Gets the <code>Attribute</code> or value that is the source of the
+ * Gets the <code>Attribute</code> or value that is the source of the
* modification.
*
- * @return the <code>Attribute</code> or value that is the
- * source of the modification
+ * @return the <code>Attribute</code> or value that is the source of the
+ * modification
*/
public Attribute getAttribute() {
return this.attr;
@@ -116,8 +98,9 @@
/**
* Gets the operation code.
*
- * @return an operation code chosen from <code>
- * DirContext.ADD_ATTRIBUTE</code>, <code>
+ * @return an operation code chosen from <code>
+ * DirContext.ADD_ATTRIBUTE</code>,
+ * <code>
* DirContext.REPLACE_ATTRIBUTE</code>, <code>
* DirContext.REMOVE_ATTRIBUTE</code>
*/
@@ -125,35 +108,27 @@
return this.mod_op;
}
- /*
- * -------------------------------------------------------------------
- * Methods override parent class Object
- * -------------------------------------------------------------------
- */
-
/**
- * Returns string representations of this <code>ModificationItem</code>
+ * Returns string representations of this <code>ModificationItem</code>
* instance.
- *
- * @return a concatenation of string values for the operation
- * and the attribute
+ *
+ * @return a concatenation of string values for the operation and the
+ * attribute
*/
@Override
public String toString() {
StringBuffer sb = new StringBuffer();
switch (mod_op) {
- case DirContext.ADD_ATTRIBUTE :
+ case DirContext.ADD_ATTRIBUTE:
sb.append("Operation is add attribute: "); //$NON-NLS-1$
break;
- case DirContext.REMOVE_ATTRIBUTE :
+ case DirContext.REMOVE_ATTRIBUTE:
sb.append("Operation is remove attribute: "); //$NON-NLS-1$
break;
- case DirContext.REPLACE_ATTRIBUTE :
+ case DirContext.REPLACE_ATTRIBUTE:
sb.append("Operation is replace attribute: "); //$NON-NLS-1$
break;
}
return sb.append(attr.toString()).toString();
}
}
-
-
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/NoSuchAttributeException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/NoSuchAttributeException.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/NoSuchAttributeException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/NoSuchAttributeException.java Fri Jun 22 13:48:49 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.directory;
import javax.naming.NamingException;
@@ -25,37 +24,23 @@
*/
public class NoSuchAttributeException extends NamingException {
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /* Serialization information - start. */
- private static final long serialVersionUID = 0x431e6668495bfb09L;
- /* Serialization information - end. */
-
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
- /**
- * This is the default constructor. All fields are initialized to null.
- */
- public NoSuchAttributeException() {
- super();
- }
-
- /**
- * Construct a <code>NoSuchAttributeException</code> with given message.
- * @param s a message about the exception detail
- */
- public NoSuchAttributeException(String s) {
- super(s);
- }
-
-}
+ private static final long serialVersionUID = 0x431e6668495bfb09L;
+ /**
+ * This is the default constructor. All fields are initialized to null.
+ */
+ public NoSuchAttributeException() {
+ super();
+ }
+
+ /**
+ * Construct a <code>NoSuchAttributeException</code> with given message.
+ *
+ * @param s
+ * a message about the exception detail
+ */
+ public NoSuchAttributeException(String s) {
+ super(s);
+ }
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SchemaViolationException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SchemaViolationException.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SchemaViolationException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SchemaViolationException.java Fri Jun 22 13:48:49 2007
@@ -15,43 +15,31 @@
* limitations under the License.
*/
-
package javax.naming.directory;
import javax.naming.NamingException;
/**
* Thrown when attempting to make a modification that contravenes the directory
- * schema.<p>
+ * schema.
+ * <p>
*
* For example, this exception is thrown if an attempt is made to modify the set
* of attributes that is defined on an entry to a state that is invalid by the
- * object attributes schema. Another example is if the naming schema is contravened
- * by attempting to move the entry to a new part of the directory.<p>
- *
- * The directory service provider throws these exceptions.<p>
+ * object attributes schema. Another example is if the naming schema is
+ * contravened by attempting to move the entry to a new part of the directory.
+ * <p>
*
- * The specification for serialization and thread-safety of <code>NamingException</code>
- * applies equally to this class.<p>
+ * The directory service provider throws these exceptions.
+ * <p>
*
+ * The specification for serialization and thread-safety of
+ * <code>NamingException</code> applies equally to this class.
+ * <p>
*/
public class SchemaViolationException extends NamingException {
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /* Serialization information - start. */
private static final long serialVersionUID = 0xd5c97d2fb107bec1L;
- /* Serialization information - end. */
-
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
/**
* This is the default constructor. All fields are initialized to null.
@@ -62,11 +50,12 @@
/**
* Construct a <code>SchemaViolationException</code> with given message.
- * @param s a message about exception detail
+ *
+ * @param s
+ * a message about exception detail
*/
public SchemaViolationException(String s) {
super(s);
}
-}
-
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchControls.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchControls.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchControls.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchControls.java Fri Jun 22 13:48:49 2007
@@ -20,82 +20,75 @@
import java.io.Serializable;
/**
- *
- * This class represents the scope of a search, and the list of attributes that
+ * This class represents the scope of a search, and the list of attributes that
* the search encompasses.
* <p>
- * The various scopes are defined by class constants representing Object,
- * Single-depth, and Full-depth searches of the directory.</p>
+ * The various scopes are defined by class constants representing Object,
+ * Single-depth, and Full-depth searches of the directory.
+ * </p>
* <p>
- * This class is not thread-safe.</p>
- *
- *
+ * This class is not thread-safe.
+ * </p>
*/
public class SearchControls implements Serializable {
/*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
+ * This constant is used during deserialization to check the version which
+ * created the serialized object
*/
+ private static final long serialVersionUID = 0xdd935921dd0f3e33L;
/**
* Bounds the search to the object scope only.
* <p>
- * The search takes place over the given object. The resulting enumeration
- * will therefore only contain either zero or one (the given) object depending
- * upon whether the object matches the search criteria.</p>
- * <p>
- * If the object does match, its name in the enumeration will be empty since
- * names are specified relative to the root of the search.</p>
+ * The search takes place over the given object. The resulting enumeration
+ * will therefore only contain either zero or one (the given) object
+ * depending upon whether the object matches the search criteria.
+ * </p>
+ * <p>
+ * If the object does match, its name in the enumeration will be empty since
+ * names are specified relative to the root of the search.
+ * </p>
*/
public static final int OBJECT_SCOPE = 0;
/**
- * Bounds the search to a single level of the naming context rooted at the
+ * Bounds the search to a single level of the naming context rooted at the
* given object.
* <p>
- * The search will take place over the object, or if the object is a context
- * then the object and all objects that are one level removed from the given
- * context.</p>
+ * The search will take place over the object, or if the object is a context
+ * then the object and all objects that are one level removed from the given
+ * context.
+ * </p>
* <p>
- * Matches are named by a relative name to the given root, so will have atomic
- * (single level valid) names.</p>
+ * Matches are named by a relative name to the given root, so will have
+ * atomic (single level valid) names.
+ * </p>
*/
public static final int ONELEVEL_SCOPE = 1;
/**
- * Bounds the search to the subtree rooted at the given object or naming
+ * Bounds the search to the subtree rooted at the given object or naming
* context.
* <p>
- * The search will take place over the object, or if the object is a
- * context then the object and all objects that are reachable from he
- * given context.</p>
- * <p>
- * The names that are returned in the enumeration are defined to be
- * either relative names to the given root, or full URIs of the matching
- * objects.</p>
+ * The search will take place over the object, or if the object is a context
+ * then the object and all objects that are reachable from he given context.
+ * </p>
+ * <p>
+ * The names that are returned in the enumeration are defined to be either
+ * relative names to the given root, or full URIs of the matching objects.
+ * </p>
* <p>
- * The search is defined to no cross naming system boundaries.</p>
+ * The search is defined to no cross naming system boundaries.
+ * </p>
*/
public static final int SUBTREE_SCOPE = 2;
- /*
- * This constant is used during deserialization to check the J2SE version which
- * created the serialized object
- */
- private static final long serialVersionUID = 0xdd935921dd0f3e33L;
-
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
/**
* The scope of the search.
* <p>
- * Constrained to be one of ONELEVEL_SCOPE, OBJECT_SCOPE, or SUBTREE_SCOPE.</p>
+ * Constrained to be one of ONELEVEL_SCOPE, OBJECT_SCOPE, or SUBTREE_SCOPE.
+ * </p>
*
* @serial
*/
@@ -104,7 +97,8 @@
/**
* search time limitation.
* <p>
- * Maximum number of milliseconds to wait for the search to complete.</p>
+ * Maximum number of milliseconds to wait for the search to complete.
+ * </p>
*
* @serial
*/
@@ -117,14 +111,14 @@
*/
private boolean derefLink;
- /**
+ /**
* Flag showing whether an Object is returned in the search results.
*
* @serial
*/
private boolean returnObj;
- /**
+ /**
* Maximum number of search results that will be returned.
*
* @serial
@@ -135,23 +129,19 @@
* Lists attributes to match.
* <p>
* Contains a single entry for each attribute that is to be matches -- or it
- * is null if all attributes are to be matched.</p>
+ * is null if all attributes are to be matched.
+ * </p>
*
* @serial
*/
private String attributesToReturn[];
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
* Default constructor.
* <p>
- * Equivalent to:
- * <code>SearchControls (ONELEVEL_SCOPE, 0, 0, null, false, false)</code>.</p>
+ * Equivalent to:
+ * <code>SearchControls (ONELEVEL_SCOPE, 0, 0, null, false, false)</code>.
+ * </p>
*/
public SearchControls() {
this(ONELEVEL_SCOPE, 0, 0, null, false, false);
@@ -160,31 +150,31 @@
/**
* Constructs a search control instance with all parameters.
*
- * @param searchScope the search scope, chosen from OBJECT_SCOPE,
- * ONELEVEL_SCOPE or SUBTREE_SCOPE.
- * @param countLimit the maximum number of search results. If is zero,
- * then the number of search results returned is
- * unlimited.
- * @param timeLimit the maximum number of search time in milliseconds,
- * for the search. If is zero, then there is no time
- * limit for the search.
+ * @param searchScope
+ * the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or
+ * SUBTREE_SCOPE.
+ * @param countLimit
+ * the maximum number of search results. If is zero, then the
+ * number of search results returned is unlimited.
+ * @param timeLimit
+ * the maximum number of search time in milliseconds, for the
+ * search. If is zero, then there is no time limit for the
+ * search.
* @param attributesToReturn
- * an array of identifiers of attributes to return for
- * each result. If is null, then all attributes are
- * returned for each result.
- * @param returnObj an flag. If true then search results contain an object,
- * otherwise they contain only a name and class pair.
- * @param derefLink an flag. If true then <code>LinkRef</code> references
- * are followed in the search, otherwise they are not.
- *
- */
- public SearchControls(
- int searchScope,
- long countLimit,
- int timeLimit,
- String attributesToReturn[],
- boolean returnObj,
- boolean derefLink) {
+ * an array of identifiers of attributes to return for each
+ * result. If is null, then all attributes are returned for each
+ * result.
+ * @param returnObj
+ * an flag. If true then search results contain an object,
+ * otherwise they contain only a name and class pair.
+ * @param derefLink
+ * an flag. If true then <code>LinkRef</code> references are
+ * followed in the search, otherwise they are not.
+ *
+ */
+ public SearchControls(int searchScope, long countLimit, int timeLimit,
+ String attributesToReturn[], boolean returnObj, boolean derefLink) {
+
this.searchScope = searchScope;
this.countLimit = countLimit;
this.timeLimit = timeLimit;
@@ -193,16 +183,10 @@
this.returnObj = returnObj;
}
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Gets the maximum number of search results.
*
- * @return the maximum number of search results to return.
+ * @return the maximum number of search results to return.
*/
public long getCountLimit() {
return countLimit;
@@ -211,32 +195,30 @@
/**
* Gets the flag indicates whether search will follow LinkRef references.
*
- * @return flag indicates whether searches will follow
- * <code>LinkRef</code> references. If true then
- * <code>LinkRef</code> references are
- * followed in the search, otherwise they are not.
+ * @return flag indicates whether searches will follow <code>LinkRef</code>
+ * references. If true then <code>LinkRef</code> references are
+ * followed in the search, otherwise they are not.
*/
public boolean getDerefLinkFlag() {
return derefLink;
}
/**
- * Gets identifiers of attributes to return for each result.
+ * Gets identifiers of attributes to return for each result.
*
- * @return an array of identifiers of attributes to return for
- * each result. If is null, then all attributes are
- * returned for each result.
+ * @return an array of identifiers of attributes to return for each result.
+ * If is null, then all attributes are returned for each result.
*/
public String[] getReturningAttributes() {
return attributesToReturn;
}
/**
- * Gets the flag whether search results will include the object (true) or
+ * Gets the flag whether search results will include the object (true) or
* not (false).
*
- * @return if true then search results contain an object,
- * otherwise they contain only a name and class pair.
+ * @return if true then search results contain an object, otherwise they
+ * contain only a name and class pair.
*/
public boolean getReturningObjFlag() {
return returnObj;
@@ -245,8 +227,8 @@
/**
* Gets the search scope.
*
- * @return the search scope, chosen from OBJECT_SCOPE,
- * ONELEVEL_SCOPE or SUBTREE_SCOPE.
+ * @return the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or
+ * SUBTREE_SCOPE.
*/
public int getSearchScope() {
return searchScope;
@@ -255,9 +237,8 @@
/**
* Gets the the maximum number of search time.
*
- * @return the maximum number of search time in milliseconds,
- * for the search. If is zero, then there is no time
- * limit for the search.
+ * @return the maximum number of search time in milliseconds, for the
+ * search. If is zero, then there is no time limit for the search.
*/
public int getTimeLimit() {
return timeLimit;
@@ -266,44 +247,47 @@
/**
* Sets the maximum number of search results.
*
- * @param l the maximum number of search results. If is zero,
- * then the number of search results returned is
- * unlimited.
+ * @param l
+ * the maximum number of search results. If is zero, then the
+ * number of search results returned is unlimited.
*/
public void setCountLimit(long l) {
countLimit = l;
}
/**
- * Sets the flag indicates whether search will follow <code>LinkRef</code>
+ * Sets the flag indicates whether search will follow <code>LinkRef</code>
* references.
*
- * @param flag flag indicates whether searches will follow
- * <code>LinkRef</code> references. If true then
- * <code>LinkRef</code> references are
- * followed in the search, otherwise they are not.
+ * @param flag
+ * flag indicates whether searches will follow
+ * <code>LinkRef</code> references. If true then
+ * <code>LinkRef</code> references are followed in the search,
+ * otherwise they are not.
*/
public void setDerefLinkFlag(boolean flag) {
derefLink = flag;
}
/**
- * Sets identifiers of attributes to return for each result.
+ * Sets identifiers of attributes to return for each result.
*
- * @param as an array of identifiers of attributes to return for
- * each result. If is null, then all attributes are
- * returned for each result.
+ * @param as
+ * an array of identifiers of attributes to return for each
+ * result. If is null, then all attributes are returned for each
+ * result.
*/
public void setReturningAttributes(String as[]) {
attributesToReturn = as;
}
/**
- * Sets the flag whether search results will include the object (true) or
+ * Sets the flag whether search results will include the object (true) or
* not (false).
*
- * @param flag if true then search results contain an object,
- * otherwise they contain only a name and class pair.
+ * @param flag
+ * if true then search results contain an object, otherwise they
+ * contain only a name and class pair.
*/
public void setReturningObjFlag(boolean flag) {
returnObj = flag;
@@ -312,8 +296,9 @@
/**
* Sets the search scope.
*
- * @param i the search scope, chosen from OBJECT_SCOPE,
- * ONELEVEL_SCOPE or SUBTREE_SCOPE.
+ * @param i
+ * the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or
+ * SUBTREE_SCOPE.
*/
public void setSearchScope(int i) {
searchScope = i;
@@ -322,14 +307,13 @@
/**
* Sets the the maximum number of search time.
*
- * @param i the maximum number of search time in milliseconds,
- * for the search. If is zero, then there is no time
- * limit for the search.
+ * @param i
+ * the maximum number of search time in milliseconds, for the
+ * search. If is zero, then there is no time limit for the
+ * search.
*/
public void setTimeLimit(int i) {
timeLimit = i;
}
}
-
-
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchResult.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchResult.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchResult.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/directory/SearchResult.java Fri Jun 22 13:48:49 2007
@@ -22,91 +22,79 @@
import org.apache.harmony.jndi.internal.nls.Messages;
/**
- * <code>SearchResult</code> returned from a search on a directory context
- * and is provided by a <code>NamingEnumeration</code>.
+ * <code>SearchResult</code> returned from a search on a directory context and
+ * is provided by a <code>NamingEnumeration</code>.
* <p>
- * This class is not thread-safe.</p>
- *
- *
+ * This class is not thread-safe.
+ * </p>
*/
public class SearchResult extends Binding {
/*
- * -------------------------------------------------------------------
- * 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.
*/
private static final long serialVersionUID = 0x80e805ecc9ed1c5cL;
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
/**
- * The attributes that were matched for this object.
+ * The attributes that were matched for this object.
*
* @serial
*/
private Attributes attrs;
- /*
- * -------------------------------------------------------------------
- * Constructors
- * -------------------------------------------------------------------
- */
-
/**
- * Creates a new instance of <code>SearchResult</code> with name <code>s</code>,
- * bound object <code>o</code> and an <code>attributes</code>
- *
- * @param s the name of this result. <code>s</code> should be
- * relative to the target context for the search that
- * produces this result.
- * @param o bound object of this result. The class of
- * <code>o</code> is the value that will
- * be returned by <code>Binding.getClassName()</code>
- * for this search result, except where
- * <code>setClassName()</code> is used to set a different
- * value. If <code>o</code> is null,
- * <code>getClassName()</code> will return null.
- * @param attributes The <code>attributes</code> should not be null. If
- * there are no attributes for this search result,
- * this parameter should be an empty collection.
+ * Creates a new instance of <code>SearchResult</code> with name
+ * <code>s</code>, bound object <code>o</code> and an
+ * <code>attributes</code>
+ *
+ * @param s
+ * the name of this result. <code>s</code> should be relative
+ * to the target context for the search that produces this
+ * result.
+ * @param o
+ * bound object of this result. The class of <code>o</code> is
+ * the value that will be returned by
+ * <code>Binding.getClassName()</code> for this search result,
+ * except where <code>setClassName()</code> is used to set a
+ * different value. If <code>o</code> is null,
+ * <code>getClassName()</code> will return null.
+ * @param attributes
+ * The <code>attributes</code> should not be null. If there are
+ * no attributes for this search result, this parameter should be
+ * an empty collection.
*/
public SearchResult(String s, Object o, Attributes attributes) {
this(s, null, o, attributes, true);
}
/**
- * Creates a new instance of <code>SearchResult</code> with name <code>s</code>,
- * bound object <code>o</code>, an <code>attributes</code> and a boolean
- * <code>flag</code>
+ * Creates a new instance of <code>SearchResult</code> with name
+ * <code>s</code>, bound object <code>o</code>, an
+ * <code>attributes</code> and a boolean <code>flag</code>
*
- * @param s the name of this result. A true value of
- * <code>flag</code> means <code>s</code> is relative
- * to the target context of the search that produces
- * this result. A false value of <code>flag</code>
- * means that <code>s</code> is a URL string.
- * @param o bound object of this result. The class of
- * <code>o</code> is the value that will
- * be returned by <code>Binding.getClassName()</code>
- * for this search result, except where
- * <code>setClassName()</code> is used
- * to set a different value. If <code>o</code> is null,
- * <code>getClassName()</code> will return null.
- * @param attributes The <code>attributes</code> should not be null. If
- * there are no attributes for this search result,
- * this parameter should be an empty collection.
- * @param flag A true value of <code>flag</code> means <code>s</code>
- * is relative to the target context of the search that
- * produces this result. A false value of <code>flag</code>
- * means that <code>s</code> is a URL string.
+ * @param s
+ * the name of this result. A true value of <code>flag</code>
+ * means <code>s</code> is relative to the target context of
+ * the search that produces this result. A false value of
+ * <code>flag</code> means that <code>s</code> is a URL
+ * string.
+ * @param o
+ * bound object of this result. The class of <code>o</code> is
+ * the value that will be returned by
+ * <code>Binding.getClassName()</code> for this search result,
+ * except where <code>setClassName()</code> is used to set a
+ * different value. If <code>o</code> is null,
+ * <code>getClassName()</code> will return null.
+ * @param attributes
+ * The <code>attributes</code> should not be null. If there are
+ * no attributes for this search result, this parameter should be
+ * an empty collection.
+ * @param flag
+ * A true value of <code>flag</code> means <code>s</code> is
+ * relative to the target context of the search that produces
+ * this result. A false value of <code>flag</code> means that
+ * <code>s</code> is a URL string.
*
*/
public SearchResult(String s, Object o, Attributes attributes, boolean flag) {
@@ -114,89 +102,86 @@
}
/**
- * Creates a new instance of <code>SearchResult</code> with name <code>s</code>,
- * class name <code>s1</code> bound object <code>o</code> and an
- * <code>attributes</code>
- *
- * @param s the name of this result. <code>s</code> should be
- * relative to the target context for the search that
- * produces this result.
- * @param s1 If <code>s1</code> is not null, it specifies the
- * name of the class of the bound object <code>o</code>.
- * Passing a null value for <code>s1</code> will not
- * stop <code>Binding.getClassName()</code> returning the
- * name of the class of <code>o</code>.
- * @param o bound object of this result. The class of
- * <code>o</code> is the value that will
- * be returned by <code>Binding.getClassName()</code> for
- * this search result, except where
- * <code>setClassName()</code> is used
- * to set a different value. If <code>o</code> is null,
- * <code>getClassName()</code> will return null.
- * @param attributes The <code>attributes</code> should not be null. If
- * there are no attributes for this search result,
- * this parameter should be an empty collection.
+ * Creates a new instance of <code>SearchResult</code> with name
+ * <code>s</code>, class name <code>s1</code> bound object
+ * <code>o</code> and an <code>attributes</code>
+ *
+ * @param s
+ * the name of this result. <code>s</code> should be relative
+ * to the target context for the search that produces this
+ * result.
+ * @param s1
+ * If <code>s1</code> is not null, it specifies the name of the
+ * class of the bound object <code>o</code>. Passing a null
+ * value for <code>s1</code> will not stop
+ * <code>Binding.getClassName()</code> returning the name of
+ * the class of <code>o</code>.
+ * @param o
+ * bound object of this result. The class of <code>o</code> is
+ * the value that will be returned by
+ * <code>Binding.getClassName()</code> for this search result,
+ * except where <code>setClassName()</code> is used to set a
+ * different value. If <code>o</code> is null,
+ * <code>getClassName()</code> will return null.
+ * @param attributes
+ * The <code>attributes</code> should not be null. If there are
+ * no attributes for this search result, this parameter should be
+ * an empty collection.
*/
public SearchResult(String s, String s1, Object o, Attributes attributes) {
this(s, s1, o, attributes, true);
}
/**
- * Creates a new instance of <code>SearchResult</code> with name <code>s</code>,
- * class name <code>s1</code> bound object <code>o</code> , an
- * <code>attributes</code> and a boolean <code>flag</code>
+ * Creates a new instance of <code>SearchResult</code> with name
+ * <code>s</code>, class name <code>s1</code> bound object
+ * <code>o</code> , an <code>attributes</code> and a boolean
+ * <code>flag</code>
*
- * @param s the name of this result. A true value of
- * <code>flag</code> means <code>s</code> is relative
- * to the target context of the search that produces
- * this result. A false value of <code>flag</code>
- * means that <code>s</code> is a URL string.
- * @param s1 If <code>s1</code> is not null, it specifies the
- * name of the class of the bound object <code>o</code>.
- * Passing a null value for <code>s1</code> will not
- * stop <code>Binding.getClassName()</code> returning
- * the name of the class of <code>o</code>.
- * @param o bound object of this result. The class of
- * <code>o</code> is the value that will
- * be returned by <code>Binding.getClassName()</code>
- * for this search result, except where
- * <code>setClassName()</code> is used
- * to set a different value. If <code>o</code> is null,
- * <code>getClassName()</code> will return null.
- * @param attributes The <code>attributes</code> should not be null. If
- * there are no attributes for this search result,
- * this parameter should be an empty collection.
- * @param flag A true value of <code>flag</code> means <code>s</code>
- * is relative to the target context of the search that
- * produces this result. A false value of <code>flag</code>
- * means that <code>s</code> is a URL string.
- */
- public SearchResult(
- String s,
- String s1,
- Object o,
- Attributes attributes,
- boolean flag) {
+ * @param s
+ * the name of this result. A true value of <code>flag</code>
+ * means <code>s</code> is relative to the target context of
+ * the search that produces this result. A false value of
+ * <code>flag</code> means that <code>s</code> is a URL
+ * string.
+ * @param s1
+ * If <code>s1</code> is not null, it specifies the name of the
+ * class of the bound object <code>o</code>. Passing a null
+ * value for <code>s1</code> will not stop
+ * <code>Binding.getClassName()</code> returning the name of
+ * the class of <code>o</code>.
+ * @param o
+ * bound object of this result. The class of <code>o</code> is
+ * the value that will be returned by
+ * <code>Binding.getClassName()</code> for this search result,
+ * except where <code>setClassName()</code> is used to set a
+ * different value. If <code>o</code> is null,
+ * <code>getClassName()</code> will return null.
+ * @param attributes
+ * The <code>attributes</code> should not be null. If there are
+ * no attributes for this search result, this parameter should be
+ * an empty collection.
+ * @param flag
+ * A true value of <code>flag</code> means <code>s</code> is
+ * relative to the target context of the search that produces
+ * this result. A false value of <code>flag</code> means that
+ * <code>s</code> is a URL string.
+ */
+ public SearchResult(String s, String s1, Object o, Attributes attributes,
+ boolean flag) {
super(s, s1, o, flag);
if (attributes == null) {
// jndi.8B=attrs must not be null
throw new IllegalArgumentException(Messages.getString("jndi.8B")); //$NON-NLS-1$
- } else {
- this.attrs = attributes;
}
+ this.attrs = attributes;
}
- /*
- * -------------------------------------------------------------------
- * Methods
- * -------------------------------------------------------------------
- */
-
/**
* Gets attributes of this search result
*
- * @return an attributes. It should not be null.
+ * @return an attributes. It should not be null.
*/
public Attributes getAttributes() {
return attrs;
@@ -205,36 +190,28 @@
/**
* Sets attributes of this search result
*
- * @param attributes an attributes. It should not be null.
+ * @param attributes
+ * an attributes. It should not be null.
*/
public void setAttributes(Attributes attributes) {
if (attributes == null) {
// jndi.8B=attrs must not be null
throw new IllegalArgumentException(Messages.getString("jndi.8B")); //$NON-NLS-1$
- } else {
- this.attrs = attributes;
}
+ this.attrs = attributes;
}
- /*
- * -------------------------------------------------------------------
- * Methods override parent class Object
- * -------------------------------------------------------------------
- */
-
/**
- * Return a concatenation of the <code>toString()</code> value for the
- * binding, and the <code>toString()</code> values for the attributes,
+ * Return a concatenation of the <code>toString()</code> value for the
+ * binding, and the <code>toString()</code> values for the attributes,
* joined by colons.
*
- * @return string representation of this search result
+ * @return string representation of this search result
*/
@Override
public String toString() {
- return new StringBuffer(super.toString())
- .append(":") //$NON-NLS-1$
- .append(attrs.toString())
- .toString();
+ return new StringBuffer(super.toString()).append(":") //$NON-NLS-1$
+ .append(attrs.toString()).toString();
}
-}
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventContext.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventContext.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventContext.java Fri Jun 22 13:48:49 2007
@@ -28,129 +28,127 @@
* Listeners register an interest in a target object or objects. The context
* might not yet have a binding for the target, and it is optional whether a
* context will support registering for events about an object that is not
- * bound. If the context does not support it then
- * <code>addNamingListener()</code> should throw a
- * <code>NameNotFoundException</code>. Alternatively, if this is not possible,
- * the <code>EventContext</code> should send the listener a
- * <code>NamingExceptionEvent</code> with the information. A
- * <code>NamingExceptionEvent</code> is also used to notify listeners who
- * have registered interest in a target that is subsequently deleted, if the
- * context only allows registration for currently bound objects.</p>
+ * bound. If the context does not support it then
+ * <code>addNamingListener()</code> should throw a
+ * <code>NameNotFoundException</code>. Alternatively, if this is not
+ * possible, the <code>EventContext</code> should send the listener a
+ * <code>NamingExceptionEvent</code> with the information. A
+ * <code>NamingExceptionEvent</code> is also used to notify listeners who have
+ * registered interest in a target that is subsequently deleted, if the context
+ * only allows registration for currently bound objects.
+ * </p>
* <p>
* Listeners can register for events affecting the context itself, which as
- * usual is referred to by the empty name.</p>
+ * usual is referred to by the empty name.
+ * </p>
* <p>
- * When a listener receives a <code>NamingExceptionEvent</code> it is deregistered.
+ * When a listener receives a <code>NamingExceptionEvent</code> it is
+ * deregistered.
* </p>
* <p>
* When <code>Context</code>.closed is called on an <code>EventContext</code>,
- * all of its listeners are deregistered.</p>
+ * all of its listeners are deregistered.
+ * </p>
* <p>
* Listener implementations may choose to implement more than one sub-interface
- * of <code>NamingListener</code>, in order to be notified of more than one type
- * of event.</p>
+ * of <code>NamingListener</code>, in order to be notified of more than one
+ * type of event.
+ * </p>
* <p>
- * Event context implementations are not expected to be thread safe. </p>
- *
- *
+ * Event context implementations are not expected to be thread safe.
+ * </p>
*/
-public interface EventContext extends Context{
-
- /*
- * -------------------------------------------------------------------
- * Constants
- * -------------------------------------------------------------------
- */
-
- /**
- * This constant indicates interest in the named object only.
- */
- public static final int OBJECT_SCOPE = 0;
-
- /**
- * This constant indicates interest in objects bound in the named context,
- * but not the context itself.
- */
- public static final int ONELEVEL_SCOPE = 1;
-
- /**
- * This constant indicates interest in the named object and its subtree.
- * <p>
- * When the named object is not a context, "subtree" here refers to the
- * subtree of the context that contains the bound object. Where the named
- * object is itself a context, "subtree" refers to the subtree of the
- * named context.</p>
- */
- public static final int SUBTREE_SCOPE = 2;
-
- /*
- * -----------------------------------------
- * methods
- * -----------------------------------------
- */
-
- /**
- * Registers <code>namingListener</code> for events concerning <code>name</code>,
- * with scope <code>i</code>.
- * <p>
- * The scope must be one of <code>OBJECT_SCOPE</code>,
- * <code>NELEVEL_SCOPE</code>, or <code>SUBTREE_SCOPE</code>.
- * </p>
- * <p>
- * When the scope is <code>ONELEVEL_SCOPE</code>, <code>name</code> must be a context.
- * Otherwise <code>name</code> can be a context or a bound object.
- * </p>
- * <p>
- * Name is relative to this context.
- * </p>
- * @param name the concerning name
- * @param i the scope
- * @param namingListener the listener to be registered
- * @throws NamingException If any exception occured.
- */
- void addNamingListener(
- Name name,
- int i,
- NamingListener namingListener)
- throws NamingException;
-
- /**
- * Registers <code>namingListener</code> for events concerning name, with
- * scope <code>i</code>.
- *
- * @param s the concerning name string
- * @param i the scope
- * @param namingListener the listener to be registered
- * @throws NamingException If any exception occured.
- * @see #addNamingListener(Name, int, NamingListener)
- */
- void addNamingListener(
- String s,
- int i,
- NamingListener namingListener)
- throws NamingException;
-
- /**
- * Removes all registrations for <code>namingListener</code> in this
- * <code>EventContext</code>. If there are no registrations this method
- * does nothing.
- *
- * @param namingListener the listener to be unregistered
- * @throws NamingException If any exception occured.
- */
- void removeNamingListener(NamingListener namingListener)
- throws NamingException;
-
- /**
- * Checks if the implementation supports registration for names that are
- * not (yet) bound in this context.
- *
- * @return false if implementation supports this, otherwise
- * true if the implementation does not support this.
- * @throws NamingException If the support is not known.
- */
- boolean targetMustExist() throws NamingException;
-}
-
+public interface EventContext extends Context {
+ /**
+ * This constant indicates interest in the named object only.
+ */
+ public static final int OBJECT_SCOPE = 0;
+
+ /**
+ * This constant indicates interest in objects bound in the named context,
+ * but not the context itself.
+ */
+ public static final int ONELEVEL_SCOPE = 1;
+
+ /**
+ * This constant indicates interest in the named object and its subtree.
+ * <p>
+ * When the named object is not a context, "subtree" here refers to the
+ * subtree of the context that contains the bound object. Where the named
+ * object is itself a context, "subtree" refers to the subtree of the named
+ * context.
+ * </p>
+ */
+ public static final int SUBTREE_SCOPE = 2;
+
+ /**
+ * Registers <code>namingListener</code> for events concerning
+ * <code>name</code>, with scope <code>i</code>.
+ * <p>
+ * The scope must be one of <code>OBJECT_SCOPE</code>,
+ * <code>NELEVEL_SCOPE</code>, or <code>SUBTREE_SCOPE</code>.
+ * </p>
+ * <p>
+ * When the scope is <code>ONELEVEL_SCOPE</code>, <code>name</code>
+ * must be a context. Otherwise <code>name</code> can be a context or a
+ * bound object.
+ * </p>
+ * <p>
+ * Name is relative to this context.
+ * </p>
+ *
+ * @param name
+ * the concerning name
+ * @param i
+ * the scope
+ * @param namingListener
+ * the listener to be registered
+ * @throws NamingException
+ * If any exception occured.
+ */
+ void addNamingListener(Name name, int i, NamingListener namingListener)
+ throws NamingException;
+
+ /**
+ * Registers <code>namingListener</code> for events concerning name, with
+ * scope <code>i</code>.
+ *
+ * @param s
+ * the concerning name string
+ * @param i
+ * the scope
+ * @param namingListener
+ * the listener to be registered
+ * @throws NamingException
+ * If any exception occured.
+ * @see #addNamingListener(Name, int, NamingListener)
+ */
+ void addNamingListener(String s, int i, NamingListener namingListener)
+ throws NamingException;
+
+ /**
+ * Removes all registrations for <code>namingListener</code> in this
+ * <code>EventContext</code>. If there are no registrations this method
+ * does nothing.
+ *
+ * @param namingListener
+ * the listener to be unregistered
+ * @throws NamingException
+ * If any exception occured.
+ */
+ void removeNamingListener(NamingListener namingListener)
+ throws NamingException;
+
+ /**
+ * Checks if the implementation supports registration for names that are not
+ * (yet) bound in this context.
+ *
+ * @return false if implementation supports this, otherwise true if the
+ * implementation does not support this.
+ * @throws NamingException
+ * If the support is not known.
+ */
+ boolean targetMustExist() throws NamingException;
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventDirContext.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventDirContext.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventDirContext.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/EventDirContext.java Fri Jun 22 13:48:49 2007
@@ -27,114 +27,114 @@
* bound in a directory context.
* <p>
* The registration methods take an RFC2254 search filter as a parameter, which
- * is used to select the objects to generate events for.</p>
+ * is used to select the objects to generate events for.
+ * </p>
* <p>
* Sometimes objects that satisfy a search filter may be bound after a listener
* is registered, specifying the filter. Where the directory service will not
* support this, and generate events for objects bound after a given filter is
- * specified, then the <code>addNamingListener</code> methods will throw an
- * <code>InvalidSearchFilterException</code>.</p>
- *
- *
+ * specified, then the <code>addNamingListener</code> methods will throw an
+ * <code>InvalidSearchFilterException</code>.
+ * </p>
*/
public interface EventDirContext extends EventContext, DirContext {
- /*
- * -----------------------------------------
- * methods
- * -----------------------------------------
- */
-
/**
- * Registers naming listener for events concerning objects selected by the
- * given search at <code>name</code>. The <code>name</code> parameter is
- * relative to this context.
+ * Registers naming listener for events concerning objects selected by the
+ * given search at <code>name</code>. The <code>name</code> parameter
+ * is relative to this context.
*
- * @param name the concerning <code>Name</code>
- * @param filter a RFC2254 search filter
- * @param filterArgs filter arguments
- * @param searchControls Further specifies the selection of objects to
- * generate events for, and the information
- * contained in <code>NamingEvents</code> that may
- * be generated.
- * @param namingListener the <code>NamingListener</code> to be registered
- * @throws NamingException If any exception occured.
+ * @param name
+ * the concerning <code>Name</code>
+ * @param filter
+ * a RFC2254 search filter
+ * @param filterArgs
+ * filter arguments
+ * @param searchControls
+ * Further specifies the selection of objects to generate events
+ * for, and the information contained in
+ * <code>NamingEvents</code> that may be generated.
+ * @param namingListener
+ * the <code>NamingListener</code> to be registered
+ * @throws NamingException
+ * If any exception occured.
*/
- void addNamingListener(
- Name name,
- String filter,
- Object filterArgs[],
- SearchControls searchControls,
- NamingListener namingListener)
- throws NamingException;
+ void addNamingListener(Name name, String filter, Object filterArgs[],
+ SearchControls searchControls, NamingListener namingListener)
+ throws NamingException;
/**
- * Registers naming listener for events concerning objects selected by the
- * given search at <code>name</code>. The <code>name</code> parameter is
- * relative to this context.
+ * Registers naming listener for events concerning objects selected by the
+ * given search at <code>name</code>. The <code>name</code> parameter
+ * is relative to this context.
*
- * @param name the concerning <code>Name</code>
- * @param filter a RFC2254 search filter string with no arguments
- * @param searchControls further specifies the selection of objects to
- * generate events for, and the information
- * contained in <code>NamingEvents</code> that may
- * be generated
- * @param namingListener the <code>NamingListener</code> to be registered
- * @throws NamingException If any exception occured.
- * @see #addNamingListener(Name, String, Object[], SearchControls, NamingListener)
+ * @param name
+ * the concerning <code>Name</code>
+ * @param filter
+ * a RFC2254 search filter string with no arguments
+ * @param searchControls
+ * further specifies the selection of objects to generate events
+ * for, and the information contained in
+ * <code>NamingEvents</code> that may be generated
+ * @param namingListener
+ * the <code>NamingListener</code> to be registered
+ * @throws NamingException
+ * If any exception occured.
+ * @see #addNamingListener(Name, String, Object[], SearchControls,
+ * NamingListener)
*/
- void addNamingListener(
- Name name,
- String filter,
- SearchControls searchControls,
- NamingListener namingListener)
- throws NamingException;
+ void addNamingListener(Name name, String filter,
+ SearchControls searchControls, NamingListener namingListener)
+ throws NamingException;
/**
- * Registers naming listener for events concerning objects selected by the
- * given search at name string <code>name</code>. The <code>s</code>
+ * Registers naming listener for events concerning objects selected by the
+ * given search at name string <code>name</code>. The <code>s</code>
* parameter is relative to this context.
*
- * @param name the concerning <code>Name</code>
- * @param filter a RFC2254 search filter
- * @param filterArgs filter arguments
- * @param searchControls further specifies the selection of objects to
- * generate events for, and the information
- * contained in <code>NamingEvents</code> that may
- * be generated
- * @param namingListener the <code>NamingListener</code> to be registered
- * @throws NamingException If any exception occured.
- * @see #addNamingListener(Name, String, Object[], SearchControls, NamingListener)
+ * @param name
+ * the concerning <code>Name</code>
+ * @param filter
+ * a RFC2254 search filter
+ * @param filterArgs
+ * filter arguments
+ * @param searchControls
+ * further specifies the selection of objects to generate events
+ * for, and the information contained in
+ * <code>NamingEvents</code> that may be generated
+ * @param namingListener
+ * the <code>NamingListener</code> to be registered
+ * @throws NamingException
+ * If any exception occured.
+ * @see #addNamingListener(Name, String, Object[], SearchControls,
+ * NamingListener)
*/
- void addNamingListener(
- String name,
- String filter,
- Object filterArgs[],
- SearchControls searchControls,
- NamingListener namingListener)
- throws NamingException;
+ void addNamingListener(String name, String filter, Object filterArgs[],
+ SearchControls searchControls, NamingListener namingListener)
+ throws NamingException;
/**
- * Registers naming listener for events concerning objects selected by the
- * given search at name string <code>name</code>. The <code>s</code>
+ * Registers naming listener for events concerning objects selected by the
+ * given search at name string <code>name</code>. The <code>s</code>
* parameter is relative to this context.
*
- * @param name the concerning <code>Name</code>
- * @param filter a RFC2254 search filter string with no arguments
- * @param searchControls further specifies the selection of objects to
- * generate events for, and the information
- * contained in <code>NamingEvents</code> that may
- * be generated
- * @param namingListener the <code>NamingListener</code> to be registered
- * @throws NamingException If any exception occured.
- * @see #addNamingListener(String, String, Object[], SearchControls, NamingListener)
+ * @param name
+ * the concerning <code>Name</code>
+ * @param filter
+ * a RFC2254 search filter string with no arguments
+ * @param searchControls
+ * further specifies the selection of objects to generate events
+ * for, and the information contained in
+ * <code>NamingEvents</code> that may be generated
+ * @param namingListener
+ * the <code>NamingListener</code> to be registered
+ * @throws NamingException
+ * If any exception occured.
+ * @see #addNamingListener(String, String, Object[], SearchControls,
+ * NamingListener)
*/
- void addNamingListener(
- String name,
- String filter,
- SearchControls searchControls,
- NamingListener namingListener)
- throws NamingException;
-}
-
+ void addNamingListener(String name, String filter,
+ SearchControls searchControls, NamingListener namingListener)
+ throws NamingException;
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamespaceChangeListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamespaceChangeListener.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamespaceChangeListener.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamespaceChangeListener.java Fri Jun 22 13:48:49 2007
@@ -16,46 +16,42 @@
*/
package javax.naming.event;
+
/**
* The listener interface to get notification of namespace change events.
* <p>
- * These events include naming events with event type <code>OBJECT_ADDED</code>,
- * <code>OBJECT_RENAMED</code>, or <code>OBJECT_REMOVED</code>. A service
- * provider will call one of these interface methods to notify a listener of
- * an event, passing in a <code>NamingEvent</code> parameter.
- * This <code>NamingEvent</code> provides methods to get various bits
- * information about the event.</p>
- *
- *
+ * These events include naming events with event type <code>OBJECT_ADDED</code>,
+ * <code>OBJECT_RENAMED</code>, or <code>OBJECT_REMOVED</code>. A service
+ * provider will call one of these interface methods to notify a listener of an
+ * event, passing in a <code>NamingEvent</code> parameter. This
+ * <code>NamingEvent</code> provides methods to get various bits information
+ * about the event.
+ * </p>
*/
-public interface NamespaceChangeListener extends NamingListener{
-
- /*
- * -----------------------------------------
- * methods
- * -----------------------------------------
- */
-
- /**
- * Called by a service provider when there is a new binding.
- *
- * @param namingevent the event notification
- */
- void objectAdded(NamingEvent namingevent);
+public interface NamespaceChangeListener extends NamingListener {
- /**
- * Called by a service provider when a binding is removed.
- *
- * @param namingevent the event notification
- */
- void objectRemoved(NamingEvent namingevent);
-
- /**
- * Called by a service provider when a binding is renamed.
- *
- * @param namingevent the event notification
- */
- void objectRenamed(NamingEvent namingevent);
-}
+ /**
+ * Called by a service provider when there is a new binding.
+ *
+ * @param namingevent
+ * the event notification
+ */
+ void objectAdded(NamingEvent namingevent);
+ /**
+ * Called by a service provider when a binding is removed.
+ *
+ * @param namingevent
+ * the event notification
+ */
+ void objectRemoved(NamingEvent namingevent);
+ /**
+ * Called by a service provider when a binding is renamed.
+ *
+ * @param namingevent
+ * the event notification
+ */
+ void objectRenamed(NamingEvent namingevent);
+
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingEvent.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingEvent.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingEvent.java Fri Jun 22 13:48:49 2007
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-
package javax.naming.event;
import java.util.EventObject;
@@ -24,22 +23,22 @@
/**
* An event from a directory or naming service, for passing to a listener.
* <p>
- * The source of the event is always the <code>EventContext</code> that the
- * listener registered with. Names in the <code>NamingEvent</code> object
- * are all relative to this context.</p>
+ * The source of the event is always the <code>EventContext</code> that the
+ * listener registered with. Names in the <code>NamingEvent</code> object are
+ * all relative to this context.
+ * </p>
* <p>
* Note the discussion about threads and synchronization in the description for
- * this package.</p>
- *
- *
+ * this package.
+ * </p>
*/
public class NamingEvent extends EventObject {
/*
- * -----------------------------------------
- * Constants
- * -----------------------------------------
+ * This constant is used during deserialization to check the version which
+ * created the serialized object.
*/
+ private static final long serialVersionUID = 0x9d18b00289d22f45L;
/**
* A <code>NamingEvent</code> type constant, indicating that an object was
@@ -65,20 +64,8 @@
*/
public static final int OBJECT_RENAMED = 2;
- /*
- * This constant is used during deserialization to check the J2SE version which
- * created the serialized object.
- */
- private static final long serialVersionUID = 0x9d18b00289d22f45L; //J2SE 1.4.2
-
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
/**
- * Some information about the event, whose format is specified by the
+ * Some information about the event, whose format is specified by the
* service provider.
*
* @serial
@@ -110,69 +97,51 @@
// the context that generated this event
private transient EventContext eventContext;
- /*
- * -----------------------------------------
- * Constructors
- * -----------------------------------------
- */
-
/**
*
- * Constructs an <code>NamingEvent</code> with all parameters.
- *
- * @param eventContext the context that generated this event. It is the
- * originator of this event and cannot be null.
- * @param type the constant value that specifies the type of event
- * @param newBinding binding after the event. <code>newBinding</code> might
- * be null depending on the value of the <code>type</code>
- * parameter as follows:
- * <ul>
- * <li>
- * <code>OBJECT_ADDED</code> - <code>newBinding</code> cannot be null
- * </li>
- * <li>
- * <code>OBJECT_CHANGED</code> - <code>newBinding</code> cannot be null
- * </li>
- * <li>
- * <code>OBJECT_REMOVED</code> - <code>newBinding</code> can be null
- * </li>
- * <li>
- * <code>OBJECT_RENAMED</code> - <code>newBinding</code> can be null
- * </li>
- * </ul>
- * The names are relative to the <code>eventContext</code>
- * @param oldBinding the binding before the event. <code>oldBinding</code> might
- * be null depending on the value of the <code>type</code>
- * parameter as follows:
- * <ul>
- * <li>
- * <code>OBJECT_ADDED</code> - <code>oldBinding</code>
- * can be null
- * </li>
- * <li>
- * <code>OBJECT_CHANGED</code> - <code>oldBinding</code>
- * cannot be null
- * </li>
- * <li>
- * <code>OBJECT_REMOVED</code> - <code>oldBinding</code>
- * cannot be null
- * </li>
- * <li>
- * <code>OBJECT_RENAMED</code> - <code>oldBinding</code>
- * can be null
- * </li>
- * </ul>
- * The names are relative to the <code>eventContext</code>
- * @param changeInfo contain some information about the event and maybe
- * null, the format of which is specified by the
- * service provider.
- */
- public NamingEvent(
- EventContext eventContext,
- int type,
- Binding newBinding,
- Binding oldBinding,
- Object changeInfo) {
+ * Constructs an <code>NamingEvent</code> with all parameters.
+ *
+ * @param eventContext
+ * the context that generated this event. It is the originator of
+ * this event and cannot be null.
+ * @param type
+ * the constant value that specifies the type of event
+ * @param newBinding
+ * binding after the event. <code>newBinding</code> might be
+ * null depending on the value of the <code>type</code>
+ * parameter as follows:
+ * <ul>
+ * <li> <code>OBJECT_ADDED</code> - <code>newBinding</code>
+ * cannot be null </li>
+ * <li> <code>OBJECT_CHANGED</code> - <code>newBinding</code>
+ * cannot be null </li>
+ * <li> <code>OBJECT_REMOVED</code> - <code>newBinding</code>
+ * can be null </li>
+ * <li> <code>OBJECT_RENAMED</code> - <code>newBinding</code>
+ * can be null </li>
+ * </ul>
+ * The names are relative to the <code>eventContext</code>
+ * @param oldBinding
+ * the binding before the event. <code>oldBinding</code> might
+ * be null depending on the value of the <code>type</code>
+ * parameter as follows:
+ * <ul>
+ * <li> <code>OBJECT_ADDED</code> - <code>oldBinding</code>
+ * can be null </li>
+ * <li> <code>OBJECT_CHANGED</code> - <code>oldBinding</code>
+ * cannot be null </li>
+ * <li> <code>OBJECT_REMOVED</code> - <code>oldBinding</code>
+ * cannot be null </li>
+ * <li> <code>OBJECT_RENAMED</code> - <code>oldBinding</code>
+ * can be null </li>
+ * </ul>
+ * The names are relative to the <code>eventContext</code>
+ * @param changeInfo
+ * contain some information about the event and maybe null, the
+ * format of which is specified by the service provider.
+ */
+ public NamingEvent(EventContext eventContext, int type, Binding newBinding,
+ Binding oldBinding, Object changeInfo) {
super(eventContext);
this.type = type;
@@ -183,37 +152,33 @@
}
- /*
- * -----------------------------------------
- * Methods
- * -----------------------------------------
- */
-
/**
- * Calls a method to notify the listener of this event.
+ * Calls a method to notify the listener of this event.
* <p>
- * For <code>OBJECT_ADDED</code>, <code>OBJECT_REMOVED</code> or
- * <code>OBJECT_RENAMED</code> type events this method calls the
- * corresponding method in the <code>NamespaceChangedListener</code>
- * interface. For <code>OBJECT_CHANGED</code> type events this method calls
- * <code>objectChanged()</code> in the <code>ObjectChangeListener</code>
- * interface.</p>
+ * For <code>OBJECT_ADDED</code>, <code>OBJECT_REMOVED</code> or
+ * <code>OBJECT_RENAMED</code> type events this method calls the
+ * corresponding method in the <code>NamespaceChangedListener</code>
+ * interface. For <code>OBJECT_CHANGED</code> type events this method
+ * calls <code>objectChanged()</code> in the
+ * <code>ObjectChangeListener</code> interface.
+ * </p>
*
- * @param naminglistener the listener of this event
+ * @param naminglistener
+ * the listener of this event
*/
public void dispatch(NamingListener naminglistener) {
switch (type) {
- case OBJECT_ADDED :
- ((NamespaceChangeListener) naminglistener).objectAdded(this);
+ case OBJECT_ADDED:
+ ((NamespaceChangeListener) naminglistener).objectAdded(this);
break;
- case OBJECT_REMOVED :
- ((NamespaceChangeListener) naminglistener).objectRemoved(this);
+ case OBJECT_REMOVED:
+ ((NamespaceChangeListener) naminglistener).objectRemoved(this);
break;
- case OBJECT_RENAMED :
- ((NamespaceChangeListener) naminglistener).objectRenamed(this);
+ case OBJECT_RENAMED:
+ ((NamespaceChangeListener) naminglistener).objectRenamed(this);
break;
- case OBJECT_CHANGED :
- ((ObjectChangeListener) naminglistener).objectChanged(this);
+ case OBJECT_CHANGED:
+ ((ObjectChangeListener) naminglistener).objectChanged(this);
break;
}
}
@@ -221,8 +186,8 @@
/**
* Gets the change information.
*
- * @return the change information object provided by the
- * service provider, which may be null.
+ * @return the change information object provided by the service provider,
+ * which may be null.
*/
public Object getChangeInfo() {
return changeInfo;
@@ -231,7 +196,7 @@
/**
* Gets the <code>EventContext</code> that generated this event.
*
- * @return the <code>EventContext</code> that generated this event.
+ * @return the <code>EventContext</code> that generated this event.
*/
public EventContext getEventContext() {
return eventContext;
@@ -240,45 +205,47 @@
/**
* Gets the binding after this event.
* <p>
- * If it exists and is inside the scope that was specified when the listener
- * was registered using <code>EventContext.addNamingListener</code>.
- * Returns null otherwise. Therefore for an <code>OBJECT_RENAMED</code>
- * event, the return value will be non-null if the new name places the
- * binding within the scope for the listener.</p>
- *
- * @return the binding after this event
+ * If it exists and is inside the scope that was specified when the listener
+ * was registered using <code>EventContext.addNamingListener</code>.
+ * Returns null otherwise. Therefore for an <code>OBJECT_RENAMED</code>
+ * event, the return value will be non-null if the new name places the
+ * binding within the scope for the listener.
+ * </p>
+ *
+ * @return the binding after this event
*/
public Binding getNewBinding() {
return newBinding;
}
/**
- * Gets the binding before this event.
+ * Gets the binding before this event.
* <p>
- * If it existed and was inside the scope that was specified when the
- * listener was registered using <code>EventContext.addNamingListener</code>.
- * Returns null otherwise. Therefore for an <code>OBJECT_RENAMED</code>
- * event, the return value will be non-null if the old name placed the
- * binding within the scope for the listener.</p>
- *
- * @return the binding before this event
+ * If it existed and was inside the scope that was specified when the
+ * listener was registered using <code>EventContext.addNamingListener</code>.
+ * Returns null otherwise. Therefore for an <code>OBJECT_RENAMED</code>
+ * event, the return value will be non-null if the old name placed the
+ * binding within the scope for the listener.
+ * </p>
+ *
+ * @return the binding before this event
*/
public Binding getOldBinding() {
return oldBinding;
}
/**
- * Gets the type of the event.
+ * Gets the type of the event.
* <p>
- * The return value is constrained to a choice from:
- * <code>OBJECT_ADDED</code>, <code>OBJECT_REMOVED</code>,
- * <code>OBJECT_RENAMED</code>, <code>OBJECT_CHANGED</code>.</p>
+ * The return value is constrained to a choice from:
+ * <code>OBJECT_ADDED</code>, <code>OBJECT_REMOVED</code>,
+ * <code>OBJECT_RENAMED</code>, <code>OBJECT_CHANGED</code>.
+ * </p>
*
- * @return the type of the event
+ * @return the type of the event
*/
public int getType() {
return type;
}
-}
-
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingExceptionEvent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingExceptionEvent.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingExceptionEvent.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingExceptionEvent.java Fri Jun 22 13:48:49 2007
@@ -22,65 +22,41 @@
import javax.naming.NamingException;
/**
- * An event object contains a <code>NamingException</code>.
- *
- *
+ * An event object contains a <code>NamingException</code>.
*/
public class NamingExceptionEvent extends EventObject {
- /*
- * -----------------------------------------
- * Constants
- * -----------------------------------------
- */
private static final long serialVersionUID = 0xbc4f019fab3b5a30L;
-
- /*
- * -------------------------------------------------------------------
- * Instance variables
- * -------------------------------------------------------------------
- */
-
- /**
- * associated exception of this event
- *
- * @serial
- */
- private NamingException exception;
- /*
- * -----------------------------------------
- * Constructors
- * -----------------------------------------
+ /**
+ * Associated exception of this event
+ *
+ * @serial
*/
+ private NamingException exception;
/**
- * Constructs a <code>NamingExceptionEvent</code> instance with
- * a <code>EventContext</code> and a <code>NamingException</code>.
+ * Constructs a <code>NamingExceptionEvent</code> instance with a
+ * <code>EventContext</code> and a <code>NamingException</code>.
*
- * @param eventContext context that generated this event. It is the
- * originator of this event and cannot be null.
+ * @param eventContext
+ * context that generated this event. It is the originator of
+ * this event and cannot be null.
* @param namingException
- * the associated exception and cannot be null.
+ * the associated exception and cannot be null.
*/
- public NamingExceptionEvent(
- EventContext eventContext,
- NamingException namingException) {
+ public NamingExceptionEvent(EventContext eventContext,
+ NamingException namingException) {
super(eventContext);
this.exception = namingException;
}
- /*
- * -----------------------------------------
- * Methods
- * -----------------------------------------
- */
-
/**
- * Calls a method to notify the listener that a naming exception has been
+ * Calls a method to notify the listener that a naming exception has been
* thrown.
*
- * @param naminglistener the listener to be notified
+ * @param naminglistener
+ * the listener to be notified
*/
public void dispatch(NamingListener naminglistener) {
naminglistener.namingExceptionThrown(this);
@@ -89,7 +65,7 @@
/**
* Gets the source of the event.
*
- * @return the source of the event
+ * @return the source of the event
*/
public EventContext getEventContext() {
return (EventContext) getSource();
@@ -98,12 +74,10 @@
/**
* Gets the associated <code>NamingException</code>.
*
- * @return the associated <code>NamingException</code>
+ * @return the associated <code>NamingException</code>
*/
public NamingException getException() {
return exception;
}
}
-
-
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingListener.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingListener.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/NamingListener.java Fri Jun 22 13:48:49 2007
@@ -26,27 +26,20 @@
* The method is <code>namingExceptionThrown</code>, which is required for
* notification of problems when registering a listener, or problems when
* getting information to send an event to a listener. When a listener is
- * notified of a <code>NamingExceptionEvent</code> it is automatically
- * deregistered.</p>
- *
- *
+ * notified of a <code>NamingExceptionEvent</code> it is automatically
+ * deregistered.
+ * </p>
*/
-public interface NamingListener extends EventListener{
-
- /*
- * -----------------------------------------
- * methods
- * -----------------------------------------
- */
-
- /**
- * This method is called by a naming or directory service provider when a naming
- * exception occurs whilst the service provider is trying to register or prepare
- * an event notification for the listener.
- *
- * @param namingExceptionEvent the event notification
- */
- void namingExceptionThrown(NamingExceptionEvent namingExceptionEvent);
-}
+public interface NamingListener extends EventListener {
+ /**
+ * This method is called by a naming or directory service provider when a
+ * naming exception occurs whilst the service provider is trying to register
+ * or prepare an event notification for the listener.
+ *
+ * @param namingExceptionEvent
+ * the event notification
+ */
+ void namingExceptionThrown(NamingExceptionEvent namingExceptionEvent);
+}
Modified: harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/ObjectChangeListener.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/ObjectChangeListener.java?view=diff&rev=549955&r1=549954&r2=549955
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/ObjectChangeListener.java (original)
+++ harmony/enhanced/classlib/trunk/modules/jndi/src/main/java/javax/naming/event/ObjectChangeListener.java Fri Jun 22 13:48:49 2007
@@ -20,34 +20,27 @@
/**
* The listener interface to get notification of object change events.
* <p>
- * These object change events include naming events with type
- * <code>OBJECT_CHANGED</code>. These events could mean that a bound object has
- * had its attributes changed somehow, or has been replaced altogether. The
- * listener can work out what has changed by querying the
- * <code>NamingEvent</code> object that is passed to the
+ * These object change events include naming events with type
+ * <code>OBJECT_CHANGED</code>. These events could mean that a bound object
+ * has had its attributes changed somehow, or has been replaced altogether. The
+ * listener can work out what has changed by querying the
+ * <code>NamingEvent</code> object that is passed to the
* <code>objectChanged</code> notification method.
- *
- *
*/
-public interface ObjectChangeListener extends NamingListener{
-
- /*
- * -----------------------------------------
- * methods
- * -----------------------------------------
- */
-
- /**
- * This method is called by a service provider to notify a listener that a
- * bound object has changed in some way.
- * <p>
- * The changes can be deduced by querying <code>namingEvent</code>, especially
- * <code>NamingEvent.getNewBinding()</code> and
- * <code>NamingEvent.getOldBinding()</code>.</p>
- *
- * @param namingEvent the event notification
- */
- void objectChanged(NamingEvent namingEvent);
-}
+public interface ObjectChangeListener extends NamingListener {
+ /**
+ * This method is called by a service provider to notify a listener that a
+ * bound object has changed in some way.
+ * <p>
+ * The changes can be deduced by querying <code>namingEvent</code>,
+ * especially <code>NamingEvent.getNewBinding()</code> and
+ * <code>NamingEvent.getOldBinding()</code>.
+ * </p>
+ *
+ * @param namingEvent
+ * the event notification
+ */
+ void objectChanged(NamingEvent namingEvent);
+}