directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1291561 - in /directory: apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/ apacheds/trunk/interceptors/sche...
Date Tue, 21 Feb 2012 02:33:01 GMT
Author: elecharny
Date: Tue Feb 21 02:33:01 2012
New Revision: 1291561

URL: http://svn.apache.org/viewvc?rev=1291561&view=rev
Log:
Renamed the Ava.getUpName/getUpValue/getUpType() methods to getName/GetValue/getType()

Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
    directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertor.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Tue Feb 21 02:33:01 2012
@@ -1043,7 +1043,7 @@ public abstract class ServerContext impl
         {
             for ( Ava atav : rdn )
             {
-                serverEntry.put( atav.getUpType(), atav.getUpValue() );
+                serverEntry.put( atav.getType(), atav.getValue() );
             }
         }
     }

Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Tue Feb 21 02:33:01 2012
@@ -419,8 +419,8 @@ public class NormalizationInterceptor ex
         for ( Ava ava : rdn )
         {
             Value<?> value = ava.getNormValue();
-            Value<?> upValue = ava.getUpValue();
-            String upId = ava.getUpType();
+            Value<?> upValue = ava.getValue();
+            String upId = ava.getType();
 
             // Check that the entry contains this Ava
             if ( !entry.contains( upId, value ) )

Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Tue Feb 21 02:33:01 2012
@@ -1418,29 +1418,29 @@ public class SchemaInterceptor extends B
             // are still present in the entry.
             for ( Ava atav : oldRdn )
             {
-                AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getUpType()
);
-                entry.remove( type, atav.getUpValue() );
+                AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getType()
);
+                entry.remove( type, atav.getValue() );
             }
 
             // Check that no operational attributes are removed
             for ( Ava atav : oldRdn )
             {
-                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry(
atav.getUpType() );
+                AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry(
atav.getType() );
 
                 if ( !attributeType.isUserModifiable() )
                 {
-                    throw new LdapNoPermissionException( "Cannot modify the attribute '"
+ atav.getUpType() + "'" );
+                    throw new LdapNoPermissionException( "Cannot modify the attribute '"
+ atav.getType() + "'" );
                 }
             }
         }
 
         for ( Ava atav : newRdn )
         {
-            AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getUpType()
);
+            AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getType()
);
 
             if ( !entry.contains( type, atav.getNormValue() ) )
             {
-                entry.add( new DefaultAttribute( type, atav.getUpValue() ) );
+                entry.add( new DefaultAttribute( type, atav.getValue() ) );
             }
         }
 
@@ -1795,7 +1795,7 @@ public class SchemaInterceptor extends B
 
             if ( ( attribute == null ) || ( !attribute.contains( atav.getNormValue() ) )
)
             {
-                String message = I18n.err( I18n.ERR_62, dn, atav.getUpType() );
+                String message = I18n.err( I18n.ERR_62, dn, atav.getType() );
                 LOG.error( message );
                 throw new LdapSchemaViolationException( ResultCodeEnum.NOT_ALLOWED_ON_RDN,
message );
             }

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Tue Feb 21 02:33:01 2012
@@ -1678,7 +1678,7 @@ public abstract class AbstractBTreeParti
 
             AttributeType newRdnAttrType = schemaManager.lookupAttributeTypeRegistry( newNormType
);
 
-            entry.add( newRdnAttrType, newAtav.getUpValue() );
+            entry.add( newRdnAttrType, newAtav.getValue() );
 
             if ( hasUserIndexOn( newRdnAttrType ) )
             {

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
Tue Feb 21 02:33:01 2012
@@ -62,7 +62,7 @@ public class AvaTest
     {
         Ava atav = new Ava( schemaManager );
         assertEquals( "", atav.toString() );
-        assertEquals( "", atav.getUpName() );
+        assertEquals( "", atav.getName() );
     }
 
 
@@ -112,22 +112,22 @@ public class AvaTest
         Ava ava = new Ava( schemaManager, "CN", " " );
         assertEquals( "CN=\\ ", ava.toString() );
         assertEquals( "2.5.4.3=\\ ", ava.getNormName() );
-        assertEquals( "CN=\\ ", ava.getUpName() );
+        assertEquals( "CN=\\ ", ava.getName() );
 
         ava = new Ava( schemaManager, "  CN  ", " " );
         assertEquals( "  CN  =\\ ", ava.toString() );
         assertEquals( "2.5.4.3=\\ ", ava.getNormName() );
-        assertEquals( "  CN  =\\ ", ava.getUpName() );
+        assertEquals( "  CN  =\\ ", ava.getName() );
 
         ava = new Ava( schemaManager, "cn", " " );
         assertEquals( "cn=\\ ", ava.toString() );
         assertEquals( "2.5.4.3=\\ ", ava.getNormName() );
-        assertEquals( "cn=\\ ", ava.getUpName() );
+        assertEquals( "cn=\\ ", ava.getName() );
 
         ava = new Ava( schemaManager, "  cn  ", " " );
         assertEquals( "  cn  =\\ ", ava.toString() );
         assertEquals( "2.5.4.3=\\ ", ava.getNormName() );
-        assertEquals( "  cn  =\\ ", ava.getUpName() );
+        assertEquals( "  cn  =\\ ", ava.getName() );
     }
 
 
@@ -158,7 +158,7 @@ public class AvaTest
         Ava atav = new Ava( schemaManager, "cn", "b" );
         assertEquals( "cn=b", atav.toString() );
         assertEquals( "2.5.4.3=b", atav.getNormName() );
-        assertEquals( "cn=b", atav.getUpName() );
+        assertEquals( "cn=b", atav.getName() );
     }
 
 
@@ -171,7 +171,7 @@ public class AvaTest
         Ava atav = new Ava( schemaManager, " CommonName ", " This is    a TEST " );
         assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.toString() );
         assertEquals( "2.5.4.3=this is a test", atav.getNormName() );
-        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getUpName() );
+        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getName() );
     }
 
 
@@ -227,19 +227,19 @@ public class AvaTest
             errors += "\nAva.getNormValue fails '" + ava.getNormValue().getString() + "'";
         }
         
-        if ( !"OU=Exemple \\+ Rdn\\C3\\A4\\ ".equals( ava.getUpName() ) )
+        if ( !"OU=Exemple \\+ Rdn\\C3\\A4\\ ".equals( ava.getName() ) )
         {
-            errors += "\nAva.getUpName fails '" + ava.getUpName() + "'";
+            errors += "\nAva.getUpName fails '" + ava.getName() + "'";
         }
         
-        if ( !"OU".equals( ava.getUpType() ) )
+        if ( !"OU".equals( ava.getType() ) )
         {
-            errors += "\nAva.getUpType fails '" + ava.getUpType() + "'";
+            errors += "\nAva.getUpType fails '" + ava.getType() + "'";
         }
         
-        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getUpValue().getString() ) )
+        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getString() ) )
         {
-            errors += "\nAva.getUpValue fails '" + ava.getUpValue() .getString() + "'";
+            errors += "\nAva.getUpValue fails '" + ava.getValue() .getString() + "'";
         }
         
         if ( !"ou=Exemple \\+ Rdn\\C3\\A4\\ ".equals( ava.normalize() ) )
@@ -282,19 +282,19 @@ public class AvaTest
             errors += "\nAva.getNormValue fails '" + ava.getNormValue().getString() + "'";
         }
         
-        if ( !"OU=Exemple \\+ Rdn\\C3\\A4\\ ".equals( ava.getUpName() ) )
+        if ( !"OU=Exemple \\+ Rdn\\C3\\A4\\ ".equals( ava.getName() ) )
         {
-            errors += "\nAva.getUpName fails '" + ava.getUpName() + "'";
+            errors += "\nAva.getUpName fails '" + ava.getName() + "'";
         }
         
-        if ( !"OU".equals( ava.getUpType() ) )
+        if ( !"OU".equals( ava.getType() ) )
         {
-            errors += "\nAva.getUpType fails '" + ava.getUpType() + "'";
+            errors += "\nAva.getUpType fails '" + ava.getType() + "'";
         }
         
-        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getUpValue().getString() ) )
+        if ( !"Exemple + Rdn\u00E4 ".equals( ava.getValue().getString() ) )
         {
-            errors += "\nAva.getUpValue fails '" + ava.getUpValue().getString() + "'";
+            errors += "\nAva.getUpValue fails '" + ava.getValue().getString() + "'";
         }
         
         if ( !"2.5.4.11=exemple \\+ rdn\\C3\\A4".equals( ava.normalize() ) )

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
(original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/model/name/DnTest.java
Tue Feb 21 02:33:01 2012
@@ -2494,39 +2494,39 @@ public class DnTest
         Dn dn1 = new Dn( " cn = Amos\\,Tori , ou=system " );
         assertEquals( " cn = Amos\\,Tori ", dn1.getRdn().getName() );
         Ava atav1 = dn1.getRdn().getAva();
-        assertEquals( "cn", atav1.getUpType() );
-        assertEquals( " Amos\\,Tori ", atav1.getUpValue().getString() );
+        assertEquals( "cn", atav1.getType() );
+        assertEquals( " Amos\\,Tori ", atav1.getValue().getString() );
 
         // antlr parser: hexstring with trailing spaces
         Dn dn3 = new Dn( " cn = #414243 , ou=system " );
         assertEquals( " cn = #414243 ", dn3.getRdn().getName() );
         Ava atav3 = dn3.getRdn().getAva();
-        assertEquals( "cn", atav3.getUpType() );
-        assertEquals( "ABC", atav3.getUpValue().getString() );
+        assertEquals( "cn", atav3.getType() );
+        assertEquals( "ABC", atav3.getValue().getString() );
         assertTrue( Arrays.equals( Strings.getBytesUtf8( "ABC" ), atav3.getNormValue().getBytes()
) );
 
         // antlr parser:
         Dn dn4 = new Dn( " cn = \\41\\42\\43 , ou=system " );
         assertEquals( " cn = \\41\\42\\43 ", dn4.getRdn().getName() );
         Ava atav4 = dn4.getRdn().getAva();
-        assertEquals( "cn", atav4.getUpType() );
-        assertEquals( " \\41\\42\\43 ", atav4.getUpValue().getString() );
+        assertEquals( "cn", atav4.getType() );
+        assertEquals( " \\41\\42\\43 ", atav4.getValue().getString() );
         assertEquals( "ABC", atav4.getNormValue().getString() );
 
         // antlr parser: quotestring with trailing spaces
         Dn dn5 = new Dn( " cn = \"ABC\" , ou=system " );
         assertEquals( " cn = \"ABC\" ", dn5.getRdn().getName() );
         Ava atav5 = dn5.getRdn().getAva();
-        assertEquals( "cn", atav5.getUpType() );
-        assertEquals( " \"ABC\" ", atav5.getUpValue().getString() );
+        assertEquals( "cn", atav5.getType() );
+        assertEquals( " \"ABC\" ", atav5.getValue().getString() );
         assertEquals( "ABC", atav5.getNormValue().getString() );
 
         // fast parser: string value with trailing spaces
         Dn dn2 = new Dn( " cn = Amos Tori , ou=system " );
         assertEquals( " cn = Amos Tori ", dn2.getRdn().getName() );
         Ava atav2 = dn2.getRdn().getAva();
-        assertEquals( "cn", atav2.getUpType() );
-        assertEquals( "Amos Tori", atav2.getUpValue().getString() );
+        assertEquals( "cn", atav2.getType() );
+        assertEquals( "Amos Tori", atav2.getValue().getString() );
     }
 
 
@@ -2580,7 +2580,7 @@ public class DnTest
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1,ou=Hosts,dc=mygfs,dc=com", dn1.getNormName()
);
         assertEquals( "cn=loopback+ipHostNumber=127.0.0.1", dn1.getRdn().getName() );
         assertEquals( "cn=loopback+iphostnumber=127.0.0.1", dn1.getRdn().getNormName() );
-        assertEquals( "127.0.0.1", dn1.getRdn().getAva( "ipHostNumber" ).getUpValue().getValue()
);
+        assertEquals( "127.0.0.1", dn1.getRdn().getAva( "ipHostNumber" ).getValue().getValue()
);
 
         // numeric OID with suffix
         Dn dn2 = new Dn( "cn=loopback+ipHostNumber=X127.0.0.1,ou=Hosts,dc=mygfs,dc=com" );
@@ -2628,10 +2628,10 @@ public class DnTest
         assertEquals( "2.5.4.11", atav.getNormType() );
         assertEquals( "example", atav.getNormValue().getValue() );
 
-        assertEquals( "ou", atav.getUpType() );
-        assertEquals( "Example", atav.getUpValue().getValue() );
+        assertEquals( "ou", atav.getType() );
+        assertEquals( "Example", atav.getValue().getValue() );
 
-        assertEquals( "  ou  =  Example ", atav.getUpName() );
+        assertEquals( "  ou  =  Example ", atav.getName() );
     }
 
 
@@ -2659,10 +2659,10 @@ public class DnTest
         assertEquals( "2.5.4.11", atav.getNormType() );
         assertEquals( "example", atav.getNormValue().getValue() );
 
-        assertEquals( "ou", atav.getUpType() );
-        assertEquals( "  Example ", atav.getUpValue().getValue() );
+        assertEquals( "ou", atav.getType() );
+        assertEquals( "  Example ", atav.getValue().getValue() );
 
-        assertEquals( "  ou  =  Example ", atav.getUpName() );
+        assertEquals( "  ou  =  Example ", atav.getName() );
 
         assertEquals( 2, rdn.size() );
 
@@ -2679,9 +2679,9 @@ public class DnTest
             assertEquals( "2.5.4.3", ava.getNormType() );
             assertEquals( "test", ava.getNormValue().getValue() );
 
-            assertEquals( "cn", ava.getUpType() );
-            assertEquals( " TEST ", ava.getUpValue().getValue() );
-            assertEquals( " cn = TEST ", ava.getUpName() );
+            assertEquals( "cn", ava.getType() );
+            assertEquals( " TEST ", ava.getValue().getValue() );
+            assertEquals( " cn = TEST ", ava.getName() );
         }
     }
 
@@ -2709,10 +2709,10 @@ public class DnTest
         assertEquals( "2.5.4.11", atav.getNormType() );
         assertEquals( "ex+mple", atav.getNormValue().getValue() );
 
-        assertEquals( "ou", atav.getUpType() );
-        assertEquals( "  Ex\\+mple ", atav.getUpValue().getValue() );
+        assertEquals( "ou", atav.getType() );
+        assertEquals( "  Ex\\+mple ", atav.getValue().getValue() );
 
-        assertEquals( "  ou  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "  ou  =  Ex\\+mple ", atav.getName() );
     }
 
 
@@ -2740,13 +2740,13 @@ public class DnTest
         // The first ATAV
         Ava atav = rdn.getAva();
 
-        assertEquals( "  OU  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "  OU  =  Ex\\+mple ", atav.getName() );
         assertEquals( "ou=Ex\\+mple", atav.getNormName() );
 
         assertEquals( "ou", atav.getNormType() );
-        assertEquals( "OU", atav.getUpType() );
+        assertEquals( "OU", atav.getType() );
 
-        assertEquals( "  Ex\\+mple ", atav.getUpValue().getValue() );
+        assertEquals( "  Ex\\+mple ", atav.getValue().getValue() );
         assertEquals( "Ex+mple", atav.getNormValue().getValue() );
 
         assertEquals( 2, rdn.size() );
@@ -2760,13 +2760,13 @@ public class DnTest
                 continue;
             }
 
-            assertEquals( " cn = T\\+ST\\  ", ava.getUpName() );
+            assertEquals( " cn = T\\+ST\\  ", ava.getName() );
             assertEquals( "cn=T\\+ST\\ ", ava.getNormName() );
 
-            assertEquals( "cn", ava.getUpType() );
+            assertEquals( "cn", ava.getType() );
             assertEquals( "cn", ava.getNormType() );
 
-            assertEquals( " T\\+ST\\  ", ava.getUpValue().getValue() );
+            assertEquals( " T\\+ST\\  ", ava.getValue().getValue() );
             assertEquals( "T+ST ", ava.getNormValue().getValue() );
         }
 
@@ -2791,13 +2791,13 @@ public class DnTest
         // The first ATAV
         atav = rdn.getAva();
 
-        assertEquals( "  OU  =  Ex\\+mple ", atav.getUpName() );
+        assertEquals( "  OU  =  Ex\\+mple ", atav.getName() );
         assertEquals( "2.5.4.11=ex\\+mple", atav.getNormName() );
 
         assertEquals( "2.5.4.11", atav.getNormType() );
-        assertEquals( "OU", atav.getUpType() );
+        assertEquals( "OU", atav.getType() );
 
-        assertEquals( "  Ex\\+mple ", atav.getUpValue().getValue() );
+        assertEquals( "  Ex\\+mple ", atav.getValue().getValue() );
         assertEquals( "ex+mple", atav.getNormValue().getValue() );
 
         assertEquals( 2, rdn.size() );
@@ -2811,13 +2811,13 @@ public class DnTest
                 continue;
             }
 
-            assertEquals( " cn = T\\+ST\\  ", ava.getUpName() );
+            assertEquals( " cn = T\\+ST\\  ", ava.getName() );
             assertEquals( "2.5.4.3=t\\+st", ava.getNormName() );
 
-            assertEquals( "cn", ava.getUpType() );
+            assertEquals( "cn", ava.getType() );
             assertEquals( "2.5.4.3", ava.getNormType() );
 
-            assertEquals( " T\\+ST\\  ", ava.getUpValue().getValue() );
+            assertEquals( " T\\+ST\\  ", ava.getValue().getValue() );
             assertEquals( "t+st", ava.getNormValue().getValue() );
         }
     }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertor.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertor.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/ldif/LdifRevertor.java
Tue Feb 21 02:33:01 2012
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.ldap.model.ldif;
 
@@ -41,7 +41,7 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * A helper class which provides methods to reverse a LDIF modification operation. 
+ * A helper class which provides methods to reverse a LDIF modification operation.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -127,7 +127,7 @@ public final class LdifRevertor
         throws LdapException
     {
         // First, protect the original entry by cloning it : we will modify it
-        Entry clonedEntry = ( Entry ) modifiedEntry.clone();
+        Entry clonedEntry = modifiedEntry.clone();
 
         LdifEntry entry = new LdifEntry();
         entry.setChangeType( ChangeType.Modify );
@@ -188,13 +188,13 @@ public final class LdifRevertor
                     previous = clonedEntry.get( mod.getId() );
 
                     /*
-                     * The server accepts without complaint replace 
-                     * modifications to non-existing attributes in the 
+                     * The server accepts without complaint replace
+                     * modifications to non-existing attributes in the
                      * entry.  When this occurs nothing really happens
                      * but this method freaks out.  To prevent that we
                      * make such no-op modifications produce the same
                      * modification for the reverse direction which should
-                     * do nothing as well.  
+                     * do nothing as well.
                      */
                     if ( ( mod.get() == null ) && ( previous == null ) )
                     {
@@ -364,7 +364,7 @@ public final class LdifRevertor
             {
                 // Create the modification, which is an Remove
                 Modification modification = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE,
-                    new DefaultAttribute( ava.getUpType(), ava.getUpValue().getString() )
);
+                    new DefaultAttribute( ava.getType(), ava.getValue().getString() ) );
 
                 restored.addModification( modification );
             }
@@ -412,13 +412,13 @@ public final class LdifRevertor
 
     /**
      * Revert a Dn to it's previous version by removing the first Rdn and adding the given
Rdn.
-     * It's a rename operation. The biggest issue is that we have many corner cases, depending

+     * It's a rename operation. The biggest issue is that we have many corner cases, depending
      * on the RDNs we are manipulating, and on the content of the initial entry.
      * 
      * @param entry The initial Entry
      * @param newRdn The new Rdn
      * @param deleteOldRdn A flag which tells to delete the old Rdn AVAs
-     * @return A list of LDIF reverted entries 
+     * @return A list of LDIF reverted entries
      * @throws LdapInvalidDnException If the name reverting failed
      */
     public static List<LdifEntry> reverseRename( Entry entry, Rdn newRdn, boolean deleteOldRdn
)
@@ -430,14 +430,14 @@ public final class LdifRevertor
 
     /**
      * Revert a Dn to it's previous version by removing the first Rdn and adding the given
Rdn.
-     * It's a rename operation. The biggest issue is that we have many corner cases, depending

+     * It's a rename operation. The biggest issue is that we have many corner cases, depending
      * on the RDNs we are manipulating, and on the content of the initial entry.
      * 
      * @param entry The initial Entry
      * @param newSuperior The new superior Dn (can be null if it's just a rename)
      * @param newRdn The new Rdn
      * @param deleteOldRdn A flag which tells to delete the old Rdn AVAs
-     * @return A list of LDIF reverted entries 
+     * @return A list of LDIF reverted entries
      * @throws LdapInvalidDnException If the name reverting failed
      */
     public static List<LdifEntry> reverseMoveAndRename( Entry entry, Dn newSuperior,
Rdn newRdn, boolean deleteOldRdn )
@@ -573,7 +573,7 @@ public final class LdifRevertor
 
                 Set<Ava> oldAtavs = new HashSet<Ava>();
 
-                // We first build a set with all the oldRDN ATAVs 
+                // We first build a set with all the oldRDN ATAVs
                 for ( Ava atav : oldRdn )
                 {
                     oldAtavs.add( atav );

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Ava.java
Tue Feb 21 02:33:01 2012
@@ -529,7 +529,7 @@ public class Ava implements Externalizab
      *
      * @return The user provided type
      */
-    public String getUpType()
+    public String getType()
     {
         return upType;
     }
@@ -551,7 +551,7 @@ public class Ava implements Externalizab
      *
      * @return The value
      */
-    public Value<?> getUpValue()
+    public Value<?> getValue()
     {
         return upValue.clone();
     }
@@ -573,7 +573,7 @@ public class Ava implements Externalizab
      *
      * @return The user provided form of this ava
      */
-    public String getUpName()
+    public String getName()
     {
         return upName;
     }

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Dn.java
Tue Feb 21 02:33:01 2012
@@ -1071,7 +1071,7 @@ public class Dn implements Iterable<Rdn>
             if ( !oidsMap.containsKey( type ) )
             {
                 // No AttributeType : this is an error
-                String msg = I18n.err( I18n.ERR_04268_OID_NOT_FOUND, atav.getUpType() );
+                String msg = I18n.err( I18n.ERR_04268_OID_NOT_FOUND, atav.getType() );
                 LOG.error( msg );
                 throw new LdapInvalidDnException( ResultCodeEnum.INVALID_DN_SYNTAX, msg );
             }
@@ -1083,11 +1083,11 @@ public class Dn implements Iterable<Rdn>
                 try
                 {
                     Ava newAva = new Ava(
-                        atav.getUpType(),
+                        atav.getType(),
                         oidNormalizer.getAttributeTypeOid(),
-                        atav.getUpValue(),
+                        atav.getValue(),
                         oidNormalizer.getNormalizer().normalize( atav.getNormValue() ),
-                        atav.getUpName() );
+                        atav.getName() );
                     newAva.apply( schemaManager );
 
                     return newAva;

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
(original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/name/Rdn.java
Tue Feb 21 02:33:01 2012
@@ -882,10 +882,10 @@ public class Rdn implements Cloneable, E
                 return null;
 
             case 1:
-                return ava.getUpType();
+                return ava.getType();
 
             default:
-                return avas.get( 0 ).getUpType();
+                return avas.get( 0 ).getType();
         }
     }
 
@@ -924,10 +924,10 @@ public class Rdn implements Cloneable, E
                 return null;
 
             case 1:
-                return ava.getUpValue();
+                return ava.getValue();
 
             default:
-                return avas.get( 0 ).getUpValue();
+                return avas.get( 0 ).getValue();
         }
     }
 

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/AvaTest.java
Tue Feb 21 02:33:01 2012
@@ -56,7 +56,7 @@ public class AvaTest
     {
         Ava atav = new Ava();
         assertEquals( "", atav.toString() );
-        assertEquals( "", atav.getUpName() );
+        assertEquals( "", atav.getName() );
     }
 
 
@@ -106,12 +106,12 @@ public class AvaTest
         Ava atav = new Ava( schemaManager, "A", ( String ) null );
         assertEquals( "A=", atav.toString() );
         assertEquals( "a=", atav.getNormName() );
-        assertEquals( "A=", atav.getUpName() );
+        assertEquals( "A=", atav.getName() );
 
         atav = new Ava( schemaManager, "  A  ", ( String ) null );
         assertEquals( "a=", atav.getNormName() );
         assertEquals( "  A  =", atav.toString() );
-        assertEquals( "  A  =", atav.getUpName() );
+        assertEquals( "  A  =", atav.getName() );
 
         try
         {
@@ -151,7 +151,7 @@ public class AvaTest
     {
         Ava atav = new Ava( schemaManager, "a", "b" );
         assertEquals( "a=b", atav.toString() );
-        assertEquals( "a=b", atav.getUpName() );
+        assertEquals( "a=b", atav.getName() );
     }
 
 
@@ -254,6 +254,6 @@ public class AvaTest
         Ava atav = new Ava( schemaManager, " CommonName ", " This is    a TEST " );
         assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.toString() );
         assertEquals( "commonname=\\ This is    a TEST\\ ", atav.getNormName() );
-        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getUpName() );
+        assertEquals( " CommonName =\\ This is    a TEST\\ ", atav.getName() );
     }
 }

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java?rev=1291561&r1=1291560&r2=1291561&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/FastDnParserTest.java
Tue Feb 21 02:33:01 2012
@@ -167,12 +167,12 @@ public class FastDnParserTest
         assertEquals( "a = b", dn.getRdn().getName() );
         assertEquals( "a=b", dn.getRdn().getNormName() );
 
-        assertEquals( "a = b", dn.getRdn().getAva().getUpName() );
+        assertEquals( "a = b", dn.getRdn().getAva().getName() );
         assertEquals( "a=b", dn.getRdn().getAva().getNormName() );
 
-        assertEquals( "a", dn.getRdn().getAva().getUpType() );
+        assertEquals( "a", dn.getRdn().getAva().getType() );
         assertEquals( "a", dn.getRdn().getAva().getNormType() );
-        assertEquals( "b", dn.getRdn().getAva().getUpValue().getValue() );
+        assertEquals( "b", dn.getRdn().getAva().getValue().getValue() );
         assertEquals( "b", dn.getRdn().getAva().getNormValue().getValue() );
     }
 



Mime
View raw message