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 2011/04/04 00:12:12 UTC
svn commit: r1088428 - in /directory:
apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/
apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/
shared/trunk/ldap/client/api/src/main/java/org/apache/di...
Author: elecharny
Date: Sun Apr 3 22:12:12 2011
New Revision: 1088428
URL: http://svn.apache.org/viewvc?rev=1088428&view=rev
Log:
Removed the contains( String ) method. It's a duplicate of the containAttributes( String...) method.
Modified:
directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java
directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java
directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/entry/ClonedServerEntry.java Sun Apr 3 22:12:12 2011
@@ -28,9 +28,9 @@ import java.util.List;
import java.util.Set;
import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.Value;
import org.apache.directory.shared.ldap.model.exception.LdapException;
import org.apache.directory.shared.ldap.model.name.Dn;
@@ -503,10 +503,4 @@ public class ClonedServerEntry implement
{
return clonedEntry.toString();
}
-
-
- public boolean contains( String upId ) throws LdapException
- {
- return clonedEntry.contains( upId );
- }
}
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/admin/AdministrativePointServiceIT.java Sun Apr 3 22:12:12 2011
@@ -397,7 +397,7 @@ public class AdministrativePointServiceI
assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
Entry entry = getAdminRole( "ou=caArea, ou=system" );
- assertFalse( entry.contains( "administrativeRole" ) );
+ assertFalse( entry.containsAttribute( "administrativeRole" ) );
}
@@ -428,7 +428,7 @@ public class AdministrativePointServiceI
assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
Entry entry = getAdminRole( "ou=caArea, ou=system" );
- assertFalse( entry.contains( "administrativeRole" ) );
+ assertFalse( entry.containsAttribute( "administrativeRole" ) );
}
@@ -458,7 +458,7 @@ public class AdministrativePointServiceI
assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
Entry entry = getAdminRole( "ou=caArea, ou=system" );
- assertTrue( entry.contains( "administrativeRole" ) );
+ assertTrue( entry.containsAttribute( "administrativeRole" ) );
assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea" ) );
assertFalse( entry.contains( "administrativeRole", "accessControlSpecificArea" ) );
}
@@ -521,7 +521,7 @@ public class AdministrativePointServiceI
assertEquals( ResultCodeEnum.SUCCESS, response.getLdapResult().getResultCode() );
Entry entry = getAdminRole( "ou=caArea, ou=system" );
- assertTrue( entry.contains( "administrativeRole" ) );
+ assertTrue( entry.containsAttribute( "administrativeRole" ) );
assertTrue( entry.contains( "administrativeRole", "collectiveAttributeSpecificArea" ) );
assertTrue( entry.contains( "administrativeRole", "accessControlSpecificArea" ) );
assertTrue( entry.contains( "administrativeRole", "triggerExecutionSpecificArea" ) );
Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java (original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java Sun Apr 3 22:12:12 2011
@@ -67,9 +67,9 @@ import org.apache.directory.shared.ldap.
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.SearchCursor;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.Entry;
-import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.Modification;
import org.apache.directory.shared.ldap.model.entry.ModificationOperation;
import org.apache.directory.shared.ldap.model.entry.Value;
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/DefaultEntry.java Sun Apr 3 22:12:12 2011
@@ -1124,34 +1124,6 @@ public final class DefaultEntry implemen
/**
* {@inheritDoc}
*/
- public boolean contains( String upId ) throws LdapException
- {
- if ( Strings.isEmpty(upId) )
- {
- return false;
- }
-
- String id = getId( upId );
-
- if ( schemaManager != null )
- {
- try
- {
- return containsAttribute( schemaManager.lookupAttributeTypeRegistry( id ) );
- }
- catch ( LdapException le )
- {
- return false;
- }
- }
-
- return attributes.containsKey( id );
- }
-
-
- /**
- * {@inheritDoc}
- */
public boolean containsAttribute( String... attributes )
{
if ( schemaManager == null )
@@ -1708,7 +1680,7 @@ public final class DefaultEntry implemen
{
String id = attribute.getId();
- if ( contains( id ) )
+ if ( containsAttribute( id ) )
{
// Store the attribute and remove it from the list
previous.add( get( id ) );
@@ -1924,7 +1896,7 @@ public final class DefaultEntry implemen
{
for ( Attribute attribute : attributes )
{
- if ( contains( attribute.getId() ) )
+ if ( containsAttribute( attribute.getId() ) )
{
this.attributes.remove( attribute.getId() );
removedAttributes.add( attribute );
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/Entry.java Sun Apr 3 22:12:12 2011
@@ -789,16 +789,6 @@ public interface Entry extends Cloneable
// Container (contains/get/put/remove) Methods
// -----------------------------------------------------------------------
/**
- * Checks that the current entry contain an a attribute type given its ID.
- *
- * @param upId the attribute we are looking for
- * @return true if this entry contains the attribute type
- * @throws LdapException if the attribute does not exists
- */
- boolean contains( String upId ) throws LdapException;
-
-
- /**
* Checks if an entry contains an attribute with some given binary values.
*
* @param attributeType The Attribute we are looking for.
Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java?rev=1088428&r1=1088427&r2=1088428&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/entry/ImmutableEntry.java Sun Apr 3 22:12:12 2011
@@ -28,8 +28,8 @@ import java.util.Set;
import org.apache.directory.shared.ldap.model.exception.LdapException;
import org.apache.directory.shared.ldap.model.name.Dn;
-import org.apache.directory.shared.util.exception.NotImplementedException;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.apache.directory.shared.util.exception.NotImplementedException;
/**
@@ -188,15 +188,6 @@ public class ImmutableEntry implements E
/**
* {@inheritDoc}
*/
- public boolean contains( String upId ) throws LdapException
- {
- return entry.contains( upId );
- }
-
-
- /**
- * {@inheritDoc}
- */
public boolean containsAttribute( String... attributes )
{
return entry.containsAttribute( attributes );