You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/09/02 07:18:05 UTC
svn commit: r1758887 -
/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/
Author: elecharny
Date: Fri Sep 2 07:18:05 2016
New Revision: 1758887
URL: http://svn.apache.org/viewvc?rev=1758887&view=rev
Log:
Updated Javadocs
Modified:
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/BinaryValue.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/AttributeUtils.java Fri Sep 2 07:18:05 2016
@@ -119,6 +119,7 @@ public final class AttributeUtils
* (Ldap attributeTypes are *always* case insensitive)
*
* @param attributes The Attributes to check
+ * @return The converted Attributes
*/
public static Attributes toCaseInsensitive( Attributes attributes )
{
@@ -300,7 +301,10 @@ public final class AttributeUtils
*
* @param str The parsed attribute,
* @param pos The position of the attribute in the current string
+ * @param withOption A flag telling of the attribute has an option
+ * @param relaxed A flag used to tell the parser to be in relaxed mode
* @return The parsed attribute if valid
+ * @throws ParseException If we faced an error while parsing the value
*/
public static String parseAttribute( byte[] str, Position pos, boolean withOption, boolean relaxed )
throws ParseException
@@ -553,6 +557,7 @@ public final class AttributeUtils
*
* @param jndiAttribute the JNDI Attribute instance to convert
* @return An instance of a LDAP API Attribute object
+ * @throws LdapInvalidAttributeValueException If we can't convert some value
*/
public static Attribute toApiAttribute( javax.naming.directory.Attribute jndiAttribute )
throws LdapInvalidAttributeValueException
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/BinaryValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/BinaryValue.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/BinaryValue.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/BinaryValue.java Fri Sep 2 07:18:05 2016
@@ -134,8 +134,10 @@ public class BinaryValue extends Abstrac
/**
+ * Compare the current value with a provided one
*
- * @see ServerValue#compareTo(Value)
+ * @param value The value we want to compare to
+ * @return -1 if the current is below the provided one, 1 if it's above, 0 if they are equal
*/
public int compareTo( Value<byte[]> value )
{
@@ -481,7 +483,6 @@ public class BinaryValue extends Abstrac
/**
* Deserialize a BinaryValue. It will return a new BinaryValue instance.
*
- * @param attributeType The AttributeType associated with the Value. Can be null
* @param in The input stream
* @return A new StringValue instance
* @throws IOException If the stream can't be read
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java Fri Sep 2 07:18:05 2016
@@ -343,6 +343,7 @@ public class DefaultAttribute implements
* </p>
* @param attributeType the attribute type according to the schema
* @param vals an initial set of values for this attribute
+ * @throws LdapInvalidAttributeValueException If one the values are invalid
*/
public DefaultAttribute( AttributeType attributeType, Value<?>... vals ) throws LdapInvalidAttributeValueException
{
@@ -437,6 +438,7 @@ public class DefaultAttribute implements
*
* @param attributeType The attribute's type
* @param attribute The attribute to be copied
+ * @throws LdapException If we weren't able to create an instance
*/
public DefaultAttribute( AttributeType attributeType, Attribute attribute ) throws LdapException
{
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultEntry.java Fri Sep 2 07:18:05 2016
@@ -49,8 +49,8 @@ import org.slf4j.LoggerFactory;
/**
* A default implementation of a ServerEntry which should suite most
- * use cases.<br/>
- * <br/>
+ * use cases.<br>
+ * <br>
* This class is final, it should not be extended.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -208,7 +208,8 @@ public final class DefaultEntry implemen
* Dn and a list of IDs.
*
* @param dn The Dn for this serverEntry. Can be null.
- * @param upIds The list of attributes to create.
+ * @param elements The list of attributes to create.
+ * @throws LdapException If we weren't able to create a new Entry instance
*/
public DefaultEntry( String dn, Object... elements ) throws LdapException
{
@@ -221,7 +222,8 @@ public final class DefaultEntry implemen
* Dn and a list of IDs.
*
* @param dn The Dn for this serverEntry. Can be null.
- * @param upIds The list of attributes to create.
+ * @param elements The list of attributes to create.
+ * @throws LdapException If we weren't able to create a new Entry instance
*/
public DefaultEntry( Dn dn, Object... elements ) throws LdapException
{
@@ -233,8 +235,10 @@ public final class DefaultEntry implemen
* Creates a new instance of DefaultEntry, with a
* Dn and a list of IDs.
*
+ * @param schemaManager The reference to the schemaManager
* @param dn The Dn for this serverEntry. Can be null.
- * @param upIds The list of attributes to create.
+ * @param elements The list of attributes to create.
+ * @throws LdapException If we weren't able to create a new Entry instance
*/
public DefaultEntry( SchemaManager schemaManager, String dn, Object... elements ) throws LdapException
{
@@ -246,8 +250,10 @@ public final class DefaultEntry implemen
* Creates a new instance of DefaultEntry, with a
* Dn and a list of IDs.
*
+ * @param schemaManager The reference to the schemaManager
* @param dn The Dn for this serverEntry. Can be null.
- * @param upIds The list of attributes to create.
+ * @param elements The list of attributes to create.
+ * @throws LdapException If we weren't able to create a new Entry instance
*/
public DefaultEntry( SchemaManager schemaManager, Dn dn, Object... elements ) throws LdapException
{
@@ -276,6 +282,7 @@ public final class DefaultEntry implemen
*
* @param schemaManager The reference to the schemaManager
* @param entry the entry to copy
+ * @throws LdapException If we weren't able to create a new Entry instance
*/
public DefaultEntry( SchemaManager schemaManager, Entry entry ) throws LdapException
{
@@ -543,6 +550,11 @@ public final class DefaultEntry implemen
* default to the AttributeType name.
*
* Updates the AttributeMap.
+ * @param upId The user provided ID
+ * @param attributeType The AttributeType to use
+ * @param values The values to inject
+ * @throws LdapInvalidAttributeValueException If the creation failed because the AttributeType
+ * is not existing, or the values are invalid
*/
protected void createAttribute( String upId, AttributeType attributeType, byte[]... values )
throws LdapInvalidAttributeValueException
@@ -558,6 +570,11 @@ public final class DefaultEntry implemen
* default to the AttributeType name.
*
* Updates the AttributeMap.
+ * @param upId The user provided ID
+ * @param attributeType The AttributeType to use
+ * @param values The values to inject
+ * @throws LdapInvalidAttributeValueException If the creation failed because the AttributeType
+ * is not existing, or the values are invalid
*/
protected void createAttribute( String upId, AttributeType attributeType, String... values )
throws LdapInvalidAttributeValueException
@@ -573,6 +590,11 @@ public final class DefaultEntry implemen
* default to the AttributeType name.
*
* Updates the AttributeMap.
+ * @param upId The user provided ID
+ * @param attributeType The AttributeType to use
+ * @param values The values to inject
+ * @throws LdapInvalidAttributeValueException If the creation failed because the AttributeType
+ * is not existing, or the values are invalid
*/
protected void createAttribute( String upId, AttributeType attributeType, Value<?>... values )
throws LdapInvalidAttributeValueException
@@ -585,6 +607,10 @@ public final class DefaultEntry implemen
/**
* Returns the attributeType from an Attribute ID.
+ *
+ * @param upId The user provided ID
+ * @return The entry's AttributeType for this ID
+ * @throws LdapException If the ID is not found in the entry
*/
protected AttributeType getAttributeType( String upId ) throws LdapException
{
@@ -1521,43 +1547,6 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
- **
- public List<Attribute> set( AttributeType... attributeTypes )
- {
- List<Attribute> removed = new ArrayList<Attribute>();
-
- // Now, loop on all the attributeType to add
- for ( AttributeType attributeType : attributeTypes )
- {
- if ( attributeType == null )
- {
- String message = I18n.err( I18n.ERR_04467 );
- LOG.error( message );
- continue;
- }
-
- Attribute attribute = attributes.put( attributeType.getOid(),
- new DefaultAttribute( attributeType ) );
-
- if ( attribute != null )
- {
- removed.add( attribute );
- }
- }
-
- if ( removed.size() == 0 )
- {
- return null;
- }
- else
- {
- return removed;
- }
- }
-
-
- /**
- * {@inheritDoc}
*/
public List<Attribute> put( Attribute... attributes ) throws LdapException
{
@@ -1960,7 +1949,6 @@ public final class DefaultEntry implemen
* </p>
*
* @param attributes the AttributeTypes to be removed
- * @return the removed attributes, if any, as a list; otherwise <code>null</code>
*/
public void removeAttributes( AttributeType... attributes )
{
@@ -2338,7 +2326,7 @@ public final class DefaultEntry implemen
/**
* This is the place where we serialize entries, and all theirs
* elements.
- * <br/>
+ * <br>
* The structure used to store the entry is the following :
* <ul>
* <li>
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultModification.java Fri Sep 2 07:18:05 2016
@@ -136,6 +136,7 @@ public class DefaultModification impleme
* @param operation The modification operation
* @param attributeType The associated attributeType
* @param values the associated values
+ * @throws LdapInvalidAttributeValueException If one of the value is not valid
*/
public DefaultModification( ModificationOperation operation, AttributeType attributeType, String... values )
throws LdapInvalidAttributeValueException
@@ -151,6 +152,7 @@ public class DefaultModification impleme
* @param operation The modification operation
* @param attributeType The associated attributeType
* @param values the associated values
+ * @throws LdapInvalidAttributeValueException If one of the value is not valid
*/
public DefaultModification( ModificationOperation operation, AttributeType attributeType, byte[]... values )
throws LdapInvalidAttributeValueException
@@ -166,6 +168,7 @@ public class DefaultModification impleme
* @param operation The modification operation
* @param attributeType The associated attributeType
* @param values the associated values
+ * @throws LdapInvalidAttributeValueException If one of the value is not valid
*/
public DefaultModification( ModificationOperation operation, AttributeType attributeType, Value<?>... values )
throws LdapInvalidAttributeValueException
@@ -180,6 +183,7 @@ public class DefaultModification impleme
*
* @param operation The modification operation
* @param attributeType The associated attributeType
+ * @throws LdapInvalidAttributeValueException If one of the value is not valid
*/
public DefaultModification( ModificationOperation operation, AttributeType attributeType )
throws LdapInvalidAttributeValueException
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Entry.java Fri Sep 2 07:18:05 2016
@@ -31,17 +31,16 @@ import org.apache.directory.api.ldap.mod
/**
- * <p>
* This interface represent a LDAP entry. An LDAP entry contains :
- * <li> A distinguished name (Dn)</li>
- * <li> A list of attributes</li>
- * </p>
+ * <ul>
+ * <li> A distinguished name (Dn)</li>
+ * <li> A list of attributes</li>
+ * </ul>
* <p>
* The available methods on this object are described in this interface.
- * </p>
- * <p>
+ * <br>
* This interface is used by the serverEntry and clientEntry interfaces.
- *</p>
+ *
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public interface Entry extends Cloneable, Iterable<Attribute>, Externalizable
@@ -54,12 +53,16 @@ public interface Entry extends Cloneable
/**
* Clone the current entry
+ *
+ * @return the cloned entry
*/
Entry clone();
/**
* Shallow Clone the current entry. We don't deep clone the attributes
+ *
+ * @return A shallow clone of this entry
*/
Entry shallowClone();
@@ -431,6 +434,7 @@ public interface Entry extends Cloneable
* <code>null</code> value: the value may be <code>null</code>.
*
* @param upId The User Provided ID to be stored into the AttributeEntry
+ * @param attributeType the type of the new attribute to be put
* @param values the binary values of the new attribute to be put
* @return the old attribute with the same identifier, if exists; otherwise
* <code>null</code>
@@ -559,6 +563,7 @@ public interface Entry extends Cloneable
* @param values the values to be removed
* @return <code>true</code> if at least a value is removed, <code>false</code>
* if not all the values have been removed or if the attribute does not exist.
+ * @throws LdapException If the removal failed
*/
boolean remove( AttributeType attributeType, byte[]... values ) throws LdapException;
@@ -583,6 +588,7 @@ public interface Entry extends Cloneable
* @param values the values to be removed
* @return <code>true</code> if at least a value is removed, <code>false</code>
* if not all the values have been removed or if the attribute does not exist.
+ * @throws LdapException If the removal failed
*/
boolean remove( AttributeType attributeType, String... values ) throws LdapException;
@@ -607,6 +613,7 @@ public interface Entry extends Cloneable
* @param values the values to be removed
* @return <code>true</code> if at least a value is removed, <code>false</code>
* if not all the values have been removed or if the attribute does not exist.
+ * @throws LdapException If the removal failed
*/
boolean remove( AttributeType attributeType, Value<?>... values ) throws LdapException;
@@ -618,6 +625,7 @@ public interface Entry extends Cloneable
*
* @param attributes the attributes to be removed
* @return the removed attribute, if exists; otherwise <code>null</code>
+ * @throws LdapException If the removal failed
*/
List<Attribute> remove( Attribute... attributes ) throws LdapException;
@@ -635,7 +643,6 @@ public interface Entry extends Cloneable
* </p>
*
* @param attributes the AttributeTypes to be removed
- * @return the removed attributes, if any, as a list; otherwise <code>null</code>
*/
void removeAttributes( AttributeType... attributes );
@@ -660,6 +667,7 @@ public interface Entry extends Cloneable
* @param values the attribute's values to be removed
* @return <code>true</code> if at least a value is removed, <code>false</code>
* if not all the values have been removed or if the attribute does not exist.
+ * @throws LdapException If the removal failed
*/
boolean remove( String upId, byte[]... values ) throws LdapException;
@@ -683,7 +691,8 @@ public interface Entry extends Cloneable
* @param upId The attribute ID
* @param values the attribute's values to be removed
* @return <code>true</code> if at least a value is removed, <code>false</code>
- * if no values have been removed or if the attribute does not exist.
+ * if no values have been removed or if the attribute does not exist.
+ * @throws LdapException If the removal failed
*/
boolean remove( String upId, String... values ) throws LdapException;
@@ -726,7 +735,6 @@ public interface Entry extends Cloneable
* </p>
*
* @param attributes an aliased name of the attribute to be removed
- * @return the removed attributes, if any, as a list; otherwise <code>null</code>
*/
void removeAttributes( String... attributes );
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/ImmutableEntry.java Fri Sep 2 07:18:05 2016
@@ -57,6 +57,8 @@ public class ImmutableEntry implements E
* Creates a new instance of DefaultEntry.
* <p>
* This entry <b>must</b> be initialized before being used !
+ * </p>
+ * @param entry the Entry to store
*/
public ImmutableEntry( Entry entry )
{
@@ -448,7 +450,6 @@ public class ImmutableEntry implements E
* </p>
*
* @param attributes the AttributeTypes to be removed
- * @return the removed attributes, if any, as a list; otherwise <code>null</code>
*/
public void removeAttributes( AttributeType... attributes )
{
@@ -619,7 +620,7 @@ public class ImmutableEntry implements E
/**
* This is the place where we serialize entries, and all theirs
* elements.
- * <br/>
+ * <br>
* The structure used to store the entry is the following :
* <ul>
* <li>
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Modification.java Fri Sep 2 07:18:05 2016
@@ -81,7 +81,8 @@ public interface Modification extends Cl
/**
* Apply the AttributeType to the Modification
*
- * @param AttributeType the injected AttributeType
+ * @param attributeType the injected AttributeType
+ * @throws LdapInvalidAttributeValueException If one of the value is not valid
*/
void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException;
}
\ No newline at end of file
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/StringValue.java Fri Sep 2 07:18:05 2016
@@ -98,7 +98,7 @@ public class StringValue extends Abstrac
* Creates a StringValue with an initial user provided String value and a normalized value.
*
* @param value the user provided value to wrap which can be null
- * @param normValue the normalized value to wrap which can be null
+ * @param normalizedValue the normalized value to wrap which can be null
*/
public StringValue( String value, String normalizedValue )
{
@@ -128,6 +128,7 @@ public class StringValue extends Abstrac
*
* @param attributeType the schema type associated with this StringValue
* @param value the value to wrap
+ * @param normValue The normalized form to store
* @throws LdapInvalidAttributeValueException If the added value is invalid accordingly
* to the schema
*/
@@ -165,7 +166,9 @@ public class StringValue extends Abstrac
// Comparable<String> Methods
// -----------------------------------------------------------------------
/**
- * @see ServerValue#compareTo(Value)
+ * Compare the current value with a given value
+ * @param value The Value to compare to
+ * @return -1 if the current value is below the given value, 1 if it's abobe, 0 if it's equal
* @throws IllegalStateException on failures to extract the comparator, or the
* normalizers needed to perform the required comparisons based on the schema
*/
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java?rev=1758887&r1=1758886&r2=1758887&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/Value.java Fri Sep 2 07:18:05 2016
@@ -172,6 +172,7 @@ public interface Value<T> extends Clonea
* Apply the AttributeType to this value. Note that this can't be done twice.
*
* @param attributeType The AttributeType to apply
+ * @throws LdapInvalidAttributeValueException If we have some invalide value
*/
void apply( AttributeType attributeType ) throws LdapInvalidAttributeValueException;
}