directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r638218 [1/4] - in /directory/sandbox/akarasulu/bigbang/shared: ./ asn1-codec/ asn1-codec/src/main/resources/META-INF/ asn1-codec/src/site/ asn1/ asn1/src/main/resources/META-INF/ asn1/src/site/ convert/ convert/src/main/java/org/apache/dir...
Date Tue, 18 Mar 2008 05:07:29 GMT
Author: akarasulu
Date: Mon Mar 17 22:07:20 2008
New Revision: 638218

URL: http://svn.apache.org/viewvc?rev=638218&view=rev
Log:
[MERGE] pulling in changes from the bigbang branch to minimize conflicts

Added:
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/asn1-codec/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/asn1-codec/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/src/site/
      - copied from r638217, directory/shared/branches/bigbang/asn1-codec/src/site/
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/src/site/site.xml
      - copied unchanged from r638217, directory/shared/branches/bigbang/asn1-codec/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/asn1/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/asn1/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/asn1/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/asn1/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/convert/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/convert/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/convert/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/convert/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/convert/src/site/
      - copied from r638217, directory/shared/branches/bigbang/convert/src/site/
    directory/sandbox/akarasulu/bigbang/shared/convert/src/site/site.xml
      - copied unchanged from r638217, directory/shared/branches/bigbang/convert/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-constants/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-constants/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/src/site/
      - copied from r638217, directory/shared/branches/bigbang/ldap-constants/src/site/
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/src/site/site.xml
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-constants/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-jndi/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-jndi/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/src/site/
      - copied from r638217, directory/shared/branches/bigbang/ldap-jndi/src/site/
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/src/site/site.xml
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap-jndi/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/antlr/openldap.g
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/antlr/openldap.g
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/AtavSerializer.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDNSerializer.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDNSerializer.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnSerializer.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/
      - copied from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/AttributeTypeLiteral.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/AttributeTypeLiteral.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ObjectClassLiteral.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ObjectClassLiteral.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ParserMonitor.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ParserMonitor.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ParserMonitorAdapter.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/ParserMonitorAdapter.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/resources/META-INF/LICENSE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/resources/META-INF/LICENSE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/resources/META-INF/NOTICE.txt
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/main/resources/META-INF/NOTICE.txt
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/site/
      - copied from r638217, directory/shared/branches/bigbang/ldap/src/site/
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/site/site.xml
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/
      - copied from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/
      - copied from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValueTest.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValueTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/ClientStringValueTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttributeTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/
      - copied from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/ConsoleParserMonitor.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
      - copied unchanged from r638217, directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
Removed:
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractBinaryValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStreamedValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/AbstractStringValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/AbstractClientAttribute.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/Entry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ServerSearchResult.java
Modified:
    directory/sandbox/akarasulu/bigbang/shared/   (props changed)
    directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE
    directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/asn1/src/site/site.xml
    directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
    directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/GrantAndDenial.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserClass.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Modification.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ModificationOperation.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientStringValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/DefaultClientAttribute.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifUtils.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValue.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/LdapDN.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/Rdn.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/name/RdnParser.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ComparableComparator.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/RegexNormalizer.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeUtils.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/PropertiesUtils.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/util/StringTools.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/aci/ACIItemParserTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifAttributesReaderTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifUtilsTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/AttributeTypeAndValueTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
    directory/sandbox/akarasulu/bigbang/shared/ldap/src/test/java/org/apache/directory/shared/ldap/name/RdnTest.java
    directory/sandbox/akarasulu/bigbang/shared/pom.xml

Propchange: directory/sandbox/akarasulu/bigbang/shared/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Mar 17 22:07:20 2008
@@ -6,4 +6,4 @@
 *.ipr
 *.iws
 nbproject
-
+.project

Modified: directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE (original)
+++ directory/sandbox/akarasulu/bigbang/shared/LAST_BIG_BANG_MERGE Mon Mar 17 22:07:20 2008
@@ -9,3 +9,11 @@
 svn merge -r 604348:613574 https://svn.apache.org/repos/asf/directory/shared/branches/bigbang .
 Committed revision 613579
 
+
+Tue Mar 18 01:04:57 EDT 2008
+----------------------------
+svn merge -r 613574:638217 https://svn.apache.org/repos/asf/directory/shared/branches/bigbang .
+$Rev$
+$Date$
+
+

Modified: directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/asn1-codec/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-asn1-codec</artifactId>
   <name>Apache Directory MINA ASN.1 Codec Shared</name>

Modified: directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/asn1/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,18 +21,20 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-asn1</artifactId>
   <name>Apache Directory ASN.1 Shared</name>
   <packaging>jar</packaging>  
   
+  <!--
   <distributionManagement>
     <site>
       <id>apacheds.websites</id>
       <url>scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/asn1/</url>
     </site>
   </distributionManagement>
+  -->
 
 </project>
 

Modified: directory/sandbox/akarasulu/bigbang/shared/asn1/src/site/site.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/asn1/src/site/site.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/asn1/src/site/site.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/asn1/src/site/site.xml Mon Mar 17 22:07:20 2008
@@ -40,6 +40,13 @@
       <item name="ApacheCon Europe 2005" href="http://www.apachecon.com/"
             img="http://apache.org/images/ac2005eu_135x50.gif" />
     </menu>
+
+    <menu name="Parent">
+      <item name="Apache Directory Shared" href="../index.html" />
+    </menu>
+  
+    <menu ref="reports" />
+
  </body>
 
 </project>

Modified: directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/convert/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-converter</artifactId>
   <name>Apache Directory Protocol Ldap Converters</name>
@@ -32,12 +32,14 @@
     <url>http://issues.apache.org/jira/browse/DIRSERVER</url>
   </issueManagement>
 
+  <!--
   <distributionManagement>
     <site>
       <id>apache.websites</id>
       <url>scp://minotaur.apache.org/www/directory.apache.org/subprojects/ldap/common</url>
     </site>
   </distributionManagement>
+  -->
 
   <description>
     Common LDAP converters : LDIF, DSML, CSV, etc

Modified: directory/sandbox/akarasulu/bigbang/shared/convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/convert/src/main/java/org/apache/directory/shared/converter/schema/SchemaToLdif.java Mon Mar 17 22:07:20 2008
@@ -100,7 +100,6 @@
             }
             catch ( Exception e )
             {
-                e.printStackTrace();
                 throw new ParserException( "Failed while generating sources for " + schema.getName() );
             }
         }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap-constants/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap-constants</artifactId>
   <name>Apache Directory Protocol Ldap Shared Constants</name>
@@ -32,12 +32,14 @@
     <url>http://issues.apache.org/jira/browse/DIRSERVER</url>
   </issueManagement>
 
+  <!--
   <distributionManagement>
     <site>
       <id>apache.websites</id>
       <url>scp://minotaur.apache.org/www/directory.apache.org/subprojects/ldap/common</url>
     </site>
   </distributionManagement>
+  -->
 
   <description>
     Common LDAP constants used by clients and servers.

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap-jndi/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap-jndi</artifactId>
   <name>Apache Directory JNDI Shared</name>
@@ -32,12 +32,14 @@
     both in the server and in studio.
   </description>
   
+  <!--
   <distributionManagement>
     <site>
-      <id>apacheds.websites</id>
-      <url>scp://minotaur.apache.org/www/directory.apache.org/newsite/subprojects/jndi-shared/</url>
+      <id>apache.websites</id>
+      <url>scp://minotaur.apache.org/www/directory.apache.org/subprojects/ldap/common</url>
     </site>
   </distributionManagement>
+  -->
 
 </project>
 

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/pom.xml Mon Mar 17 22:07:20 2008
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.directory.shared</groupId>
     <artifactId>shared-parent</artifactId>
-    <version>0.9.8-SNAPSHOT</version>
+    <version>0.9.9-SNAPSHOT</version>
   </parent>
   <artifactId>shared-ldap</artifactId>
   <name>Apache Directory Protocol Ldap Shared</name>
@@ -32,12 +32,14 @@
     <url>http://issues.apache.org/jira/browse/DIRSERVER</url>
   </issueManagement>
 
+  <!--
   <distributionManagement>
     <site>
       <id>apache.websites</id>
       <url>scp://minotaur.apache.org/www/directory.apache.org/subprojects/ldap/common</url>
     </site>
   </distributionManagement>
+  -->
 
   <description>
     Common LDAP packages used by clients and servers.
@@ -113,7 +115,7 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-antlr-plugin</artifactId>
         <configuration>
-          <grammars>ACIItem.g ACIItemChecker.g schema-extension.g schema-qdstring.g schema-value.g schema.g subtree-specification.g SubtreeSpecificationChecker.g TriggerSpecification.g</grammars>
+          <grammars>ACIItem.g ACIItemChecker.g openldap.g schema-extension.g schema-qdstring.g schema-value.g schema.g subtree-specification.g SubtreeSpecificationChecker.g TriggerSpecification.g</grammars>
         </configuration>
         <executions>
            <execution>

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/GrantAndDenial.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/GrantAndDenial.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/GrantAndDenial.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/GrantAndDenial.java Mon Mar 17 22:07:20 2008
@@ -170,18 +170,6 @@
 
     public String toString()
     {
-        return "[" + code + "] " + name;
-    }
-    
-    
-    /**
-     * Converts this item into its string representation as stored
-     * in directory.
-     *
-     * @param buffer the string buffer
-     */
-    public void printToBuffer( StringBuilder buffer )
-    {
-        buffer.append( getName() );
+        return name;
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java Mon Mar 17 22:07:20 2008
@@ -69,18 +69,8 @@
 
     public String toString()
     {
-        return "itemPermission: precedence=" + getPrecedence() + ", " + "userClasses=" + userClasses + ", "
-            + "grantsAndDenials=" + getGrantsAndDenials();
-    }
-    
-    /**
-     * Converts this item into its string representation as stored
-     * in directory.
-     *
-     * @param buffer the string buffer
-     */
-    public void printToBuffer( StringBuilder buffer )
-    {
+        StringBuilder buffer = new StringBuilder();
+        
         buffer.append( "{ " );
 
         if ( getPrecedence() >= 0 && getPrecedence() <= 255 )
@@ -105,7 +95,7 @@
                 buffer.append( ", " );
             }
 
-            userClass.printToBuffer( buffer );
+            buffer.append( userClass.toString() );
         }
         
         buffer.append( " }, grantsAndDenials { " );
@@ -123,9 +113,11 @@
                 buffer.append( ", " );
             }
 
-            grantAndDenial.printToBuffer( buffer );
+            buffer.append( grantAndDenial.toString() );
         }
         
         buffer.append( " } }" );
+        
+        return buffer.toString();
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java Mon Mar 17 22:07:20 2008
@@ -249,29 +249,6 @@
         }
         
         
-        public void printToBuffer( StringBuilder buffer )
-        {
-            buffer.append( "{ " );
-            boolean isFirst = true;
-            
-            for ( String attributeType:attributeTypes )
-            {
-                if ( isFirst ) 
-                {
-                    isFirst = false;
-                }
-                else
-                {
-                    buffer.append( ", " );
-                }
-
-                buffer.append( attributeType );
-            }
-            
-            buffer.append( " }" );
-        }
-
-        
         /**
          * @see Object#toString()
          */
@@ -325,7 +302,7 @@
 
         public String toString()
         {
-            return "attributeType: " + attributeTypes;
+            return "attributeType " + super.toString();
         }
     }
 
@@ -351,7 +328,7 @@
 
         public String toString()
         {
-            return "allAttributeValues: " + attributeTypes;
+            return "allAttributeValues " + super.toString();
         }
     }
 
@@ -381,7 +358,7 @@
 
         public String toString()
         {
-            return "selfValue: " + attributeTypes;
+            return "selfValue " + super.toString();
         }
     }
 
@@ -461,7 +438,7 @@
             
             buf.append( " }" );
 
-            return "attributeValue: " + attributes;
+            return buf.toString();
         }
     }
 
@@ -604,7 +581,8 @@
         public String toString()
         {
         	StringBuilder buf = new StringBuilder();
-            buf.append( "rangeOfValues: " );
+            
+            buf.append( "rangeOfValues " );
             buf.append( filter.toString() );
             
             return buf.toString();
@@ -668,7 +646,7 @@
 
         public String toString()
         {
-            return "maxImmSub: " + value;
+            return "maxImmSub " + value;
         }
     }
 
@@ -801,7 +779,7 @@
 
         public String toString()
         {
-            return "attributeType=" + attributeType + ", maxCount=" + maxCount;
+            return "{ type " + attributeType + ", maxCount " + maxCount + " }";
         }
     }
 
@@ -854,7 +832,7 @@
 
         public String toString()
         {
-            return "{attributeType=" + attributeType + ", valuesIn=" + valuesIn + "}";
+            return "{ type " + attributeType + ", valuesIn " + valuesIn + " }";
         }
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserClass.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserClass.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserClass.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/aci/UserClass.java Mon Mar 17 22:07:20 2008
@@ -60,15 +60,6 @@
     {
     }
     
-    
-    /**
-     * Converts this item into its string representation as stored
-     * in directory.
-     *
-     * @param buffer the string buffer
-     */
-    public abstract void printToBuffer( StringBuilder buffer );
-    
 
     /**
      * Every directory user (with possible requirements for
@@ -88,12 +79,6 @@
         {
             return "allUsers";
         }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
-            buffer.append( "allUsers" );
-        }
     }
 
     /**
@@ -115,12 +100,6 @@
         {
             return "thisEntry";
         }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
-            buffer.append( "thisEntry" );
-        }
     }
 
     /**
@@ -175,12 +154,8 @@
 
         public String toString()
         {
-            return names.toString();
-        }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
+            StringBuilder buffer = new StringBuilder();
+            
             boolean isFirst = true;
             buffer.append( "{ " );
             
@@ -201,6 +176,8 @@
             }
             
             buffer.append( " }" );
+            
+            return buffer.toString();
         }
     }
 
@@ -226,14 +203,7 @@
 
         public String toString()
         {
-            return "name: " + super.toString();
-        }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
-            buffer.append( "name " );
-            super.printToBuffer( buffer );
+            return "name " + super.toString();
         }
     }
 
@@ -262,14 +232,7 @@
 
         public String toString()
         {
-            return "userGroup: " + super.toString();
-        }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
-            buffer.append( "userGroup " );
-            super.printToBuffer( buffer );
+            return "userGroup " + super.toString();
         }
     }
 
@@ -324,12 +287,8 @@
 
         public String toString()
         {
-            return "subtree: " + subtreeSpecifications;
-        }
-        
-        
-        public void printToBuffer( StringBuilder buffer )
-        {
+            StringBuilder buffer = new StringBuilder();
+            
             boolean isFirst = true;
             buffer.append( "subtree { " );
             
@@ -348,6 +307,8 @@
             }
             
             buffer.append( " }" );
+            
+            return buffer.toString();
         }
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java Mon Mar 17 22:07:20 2008
@@ -345,7 +345,7 @@
                 LdapURL referral = referralIterator.next();
 
                 // Ecode the current referral
-                Value.encode( buffer, referral.getBytes() );
+                Value.encode( buffer, referral.getBytesReference() );
             }
         }
 

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulDisconnect.java Mon Mar 17 22:07:20 2008
@@ -187,7 +187,7 @@
             while ( replicatedContextIterator.hasNext() )
             {
                 LdapURL url = replicatedContextIterator.next();
-                Value.encode( bb, url.getBytes() );
+                Value.encode( bb, url.getBytesReference() );
             }
         }
 

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java Mon Mar 17 22:07:20 2008
@@ -1410,11 +1410,28 @@
     }
     
     /**
-     * @return the bytes representing this LdapURL
+     * @return a reference on the interned bytes representing this LdapURL
      */
-    public byte[] getBytes()
+    public byte[] getBytesReference()
     {
         return bytes;
+    }
+    
+    /**
+     * @return a copy of the bytes representing this LdapURL
+     */
+    public byte[] getBytesCopy()
+    {
+        if ( bytes != null )
+        {
+            byte[] copy = new byte[bytes.length];
+            System.arraycopy( bytes, 0, copy, 0, bytes.length );
+            return copy;
+        }
+        else
+        {
+            return null;
+        }
     }
     
     /**

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Entry.java Mon Mar 17 22:07:20 2008
@@ -20,6 +20,7 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import javax.naming.NamingException;
 
@@ -39,7 +40,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Entry<T extends EntryAttribute<?>> extends Cloneable, Iterable<T>
+public interface Entry<T extends EntryAttribute> extends Cloneable, Iterable<T>
 {
     /**
      * Removes all the attributes.
@@ -74,6 +75,39 @@
 
 
     /**
+     * Add some String values to the current Entry.
+     *
+     * @param upId The user provided ID of the attribute we want to add 
+     * some values to
+     * @param values The list of String values to add
+     * @throws NamingException
+     */
+    void add( String upId, String... values ) throws NamingException;
+
+    
+    /**
+     * Add some binary values to the current Entry.
+     *
+     * @param upId The user provided ID of the attribute we want to add 
+     * some values to
+     * @param values The list of binary values to add
+     * @throws NamingException
+     */
+    void add( String upId, byte[]... values ) throws NamingException;
+
+    
+    /**
+     * Add some Values to the current Entry.
+     *
+     * @param upId The user provided ID of the attribute we want to add 
+     * some values to
+     * @param values The list of Values to add
+     * @throws NamingException
+     */
+    void add( String upId, Value<?>... values ) throws NamingException;
+    
+    
+    /**
      * Places non-null attributes in the attribute collection. If there is
      * already an attribute with the same OID as any of the new attributes, 
      * the old ones are removed from the collection and are returned by this 
@@ -101,12 +135,12 @@
     /**
      * Checks if an entry contains an attribute with a given value.
      *
-     * @param attribute The Attribute we are looking for
+     * @param attributeType The Attribute type we are looking for
      * @param value The searched value
      * @return <code>true</code> if the value is found within the attribute
      * @throws NamingException If the attribute does not exist
      */
-    boolean contains( T attribute, Value<?> value ) throws NamingException;
+    boolean contains( AttributeType attributeType, Value<?> value ) throws NamingException;
     
     
     /**

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/EntryAttribute.java Mon Mar 17 22:07:20 2008
@@ -18,13 +18,11 @@
  */
 package org.apache.directory.shared.ldap.entry;
 
-import java.io.Serializable;
 import java.util.Iterator;
+import java.util.List;
 
-import javax.naming.NamingException;
 import javax.naming.directory.InvalidAttributeValueException;
 
-
 /**
  * A generic interface mocking the Attribute JNDI interface. This interface
  * will be the base interface for the ServerAttribute and ClientAttribute.
@@ -32,7 +30,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface EntryAttribute<T extends Value<?>> extends Iterable<T>, Serializable, Cloneable
+public interface EntryAttribute extends Iterable<Value<?>>, Cloneable
 {
     /**
      * Adds some values to this attribute. If the new values are already present in
@@ -43,29 +41,63 @@
      * <p>
      * This method returns the number of values that were added.
      * </p>
+     * <p>
+     * If the value's type is different from the attribute's type,
+     * a conversion is done. For instance, if we try to set some String
+     * into a Binary attribute, we just store the UTF-8 byte array 
+     * encoding for this String.
+     * </p>
+     * <p>
+     * If we try to store some byte[] in a HR attribute, we try to 
+     * convert those byte[] assuming they represent an UTF-8 encoded
+     * String. Of course, if it's not the case, the stored value will
+     * be incorrect.
+     * </p>
+     * <p>
+     * It's the responsibility of the caller to check if the stored
+     * values are consistent with the attribute's type.
+     * </p>
+     * <p>
+     * The caller can set the HR flag in order to enforce a type for 
+     * the current attribute, otherwise this type will be set while
+     * adding the first value, using the value's type to set the flag.
+     * </p>
      *
      * @param vals some new values to be added which may be null
      * @return the number of added values, or 0 if none has been added
      */
-    int add( String... vals ) throws InvalidAttributeValueException, NamingException;
+    int add( String... vals );
 
 
     /**
-     * Puts some values to this attribute.
+     * Adds some values to this attribute. If the new values are already present in
+     * the attribute values, the method has no effect.
      * <p>
-     * The new values are replace the previous values.
+     * The new values are added at the end of list of values.
      * </p>
      * <p>
-     * This method returns the number of values that were put.
+     * This method returns the number of values that were added.
      * </p>
+     * If the value's type is different from the attribute's type,
+     * a conversion is done. For instance, if we try to set some String
+     * into a Binary attribute, we just store the UTF-8 byte array 
+     * encoding for this String.
+     * If we try to store some byte[] in a HR attribute, we try to 
+     * convert those byte[] assuming they represent an UTF-8 encoded
+     * String. Of course, if it's not the case, the stored value will
+     * be incorrect.
+     * <br>
+     * It's the responsibility of the caller to check if the stored
+     * values are consistent with the attribute's type.
+     * <br>
+     * The caller can set the HR flag in order to enforce a type for 
+     * the current attribute, otherwise this type will be set while
+     * adding the first value, using the value's type to set the flag.
      *
-     * @param vals some values to be put which may be null
+     * @param vals some new values to be added which may be null
      * @return the number of added values, or 0 if none has been added
-     * @throws InvalidAttributeValueException If we try to add some values
-     * which conflicts with the AttributeType for this attribute
-     * @throws NamingException If the attributeType does not have a syntax
      */
-    int put( String... vals ) throws InvalidAttributeValueException, NamingException;
+    int add( byte[]... vals );
 
 
     /**
@@ -77,100 +109,151 @@
      * <p>
      * This method returns the number of values that were added.
      * </p>
-     *
+     * <p>
+     * If the value's type is different from the attribute's type,
+     * a conversion is done. For instance, if we try to set some 
+     * StringValue into a Binary attribute, we just store the UTF-8 
+     * byte array encoding for this StringValue.
+     * </p>
+     * <p>
+     * If we try to store some BinaryValue in a HR attribute, we try to 
+     * convert those BinaryValue assuming they represent an UTF-8 encoded
+     * String. Of course, if it's not the case, the stored value will
+     * be incorrect.
+     * </p>
+     * <p>
+     * It's the responsibility of the caller to check if the stored
+     * values are consistent with the attribute's type.
+     * </p>
+     * <p>
+     * The caller can set the HR flag in order to enforce a type for 
+     * the current attribute, otherwise this type will be set while
+     * adding the first value, using the value's type to set the flag.
+     * </p>
+     * <p>
+     * <b>Note : </b>If the entry contains no value, and the unique added value
+     * is a null length value, then this value will be considered as
+     * a binary value.
+     * </p>
      * @param vals some new values to be added which may be null
      * @return the number of added values, or 0 if none has been added
      */
-    int add( byte[]... vals ) throws InvalidAttributeValueException, NamingException;
+    int add( Value<?>... val );
+    
+    
+    /**
+     * Remove all the values from this attribute.
+     */
+    void clear();
+    
+    
+    /**
+     * @return A clone of the current object
+     */
+    EntryAttribute clone();
 
 
     /**
-     * Puts some values to this attribute.
      * <p>
-     * The new values are replace the previous values.
+     * Indicates whether the specified values are some of the attribute's values.
      * </p>
      * <p>
-     * This method returns the number of values that were put.
+     * If the Attribute is not HR, the values will be converted to byte[]
      * </p>
      *
-     * @param vals some values to be put which may be null
-     * @return the number of added values, or 0 if none has been added
-     */
-    int put( byte[]... vals ) throws InvalidAttributeValueException, NamingException;
-
-
-    /**
-     * Removes all values of this attribute.
+     * @param vals the values
+     * @return true if this attribute contains all the values, otherwise false
      */
-    void clear();
+    boolean contains( String... vals );
 
 
     /**
+     * <p>
      * Indicates whether the specified values are some of the attribute's values.
+     * </p>
+     * <p>
+     * If the Attribute is HR, the values will be converted to String
+     * </p>
      *
      * @param vals the values
      * @return true if this attribute contains all the values, otherwise false
      */
-    boolean contains( String... vals );
+    boolean contains( byte[]... vals );
 
 
     /**
+     * <p>
      * Indicates whether the specified values are some of the attribute's values.
+     * </p>
+     * <p>
+     * If the Attribute is HR, the binary values will be converted to String before
+     * being checked.
+     * </p>
      *
      * @param vals the values
      * @return true if this attribute contains all the values, otherwise false
      */
-    boolean contains( byte[]... vals );
+    boolean contains( Value<?>... vals );
 
 
-   /**
-      * Retrieves the number of values in this attribute.
-      *
-      * @return the number of values in this attribute, including any values
-      * wrapping a null value if there is one
-      */
-    int size();
+    /**
+     * <p>
+     * Get the first value of this attribute. If there is none, 
+     * null is returned.
+     * </p>
+     * <p>
+     * Note : even if we are storing values into a Set, one can assume
+     * the values are ordered following the insertion order.
+     * </p>
+     * <p> 
+     * This method is meant to be used if the attribute hold only one value.
+     * </p>
+     * 
+     *  @return The first value for this attribute.
+     */
+    Value<?> get();
 
 
     /**
-     * Removes all the  values that are equal to the given values.
+     * Returns an iterator over all the attribute's values.
      * <p>
-     * Returns true if a value is removed. If there is no value equal to <code>
-     * val</code> this method simply returns false.
+     * The effect on the returned enumeration of adding or removing values of
+     * the attribute is not specified.
+     * </p>
+     * <p>
+     * This method will throw any <code>NamingException</code> that occurs.
      * </p>
      *
-     * @param val the values to be removed
-     * @return true if all the values are removed, otherwise false
+     * @return an enumeration of all values of the attribute
      */
-    boolean remove( byte[]... val );
+    Iterator<Value<?>> getAll();
 
 
     /**
-     * Removes all the  values that are equal to the given values.
      * <p>
-     * Returns true if a value is removed. If there is no value equal to <code>
-     * val</code> this method simply returns false.
+     * Get the byte[] value, if and only if the value is known to be Binary,
+     * otherwise a InvalidAttributeValueException will be thrown
+     * </p>
+     * <p>
+     * Note that this method returns the first value only.
      * </p>
      *
-     * @param vals the values to be removed
-     * @return true if all the values are removed, otherwise false
+     * @return The value as a byte[]
+     * @throws InvalidAttributeValueException If the value is a String
      */
-    boolean remove( String... vals );
+    byte[] getBytes() throws InvalidAttributeValueException;
     
     
     /**
-     * Gets the first value of this attribute. <code>null</code> is a valid value.
-     *
-     * <p>
-     * If the attribute has no values this method throws
-     * <code>NoSuchElementException</code>.
-     * </p>
+     * Get's the attribute identifier for this entry.  This is the value
+     * that will be used as the identifier for the attribute within the
+     * entry.  
      *
-     * @return a value of this attribute
+     * @return the identifier for this attribute
      */
-    T get();
-
+    String getId();
 
+    
     /**
      * Get's the user provided identifier for this entry.  This is the value
      * that will be used as the identifier for the attribute within the
@@ -183,80 +266,188 @@
      * @return the user provided identifier for this attribute
      */
     String getUpId();
+    
+    
+    /**
+     * <p>
+     * Tells if the attribute is Human Readable. 
+     * </p>
+     * <p>This flag is set by the caller, or implicitly when adding String 
+     * values into an attribute which is not yet declared as Binary.
+     * </p> 
+     * @return
+     */
+    boolean isHR();
 
     
     /**
-     * Returns an iterator over all the attribute's values.
      * <p>
-     * The effect on the returned enumeration of adding or removing values of
-     * the attribute is not specified.
+     * Get the String value, if and only if the value is known to be a String,
+     * otherwise a InvalidAttributeValueException will be thrown
      * </p>
      * <p>
-     * This method will throw any <code>NamingException</code> that occurs.
+     * Note that this method returns the first value only.
      * </p>
      *
-     * @return an enumeration of all values of the attribute
+     * @return The value as a String
+     * @throws InvalidAttributeValueException If the value is a byte[]
+     */
+    String getString() throws InvalidAttributeValueException;
+
+    
+    /**
+     * Puts some values to this attribute.
+     * <p>
+     * The new values will replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
+     * </p>
+     *
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
      */
-    Iterator<T> getAll();
+    int put( String... vals );
 
 
     /**
-     * Removes all the  values that are equal to the given values.
+     * Puts some values to this attribute.
      * <p>
-     * Returns true if a value is removed. If there is no value equal to <code>
-     * val</code> this method simply returns false.
+     * The new values will replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
      * </p>
      *
-     * @param vals the values to be removed
-     * @return true if all the values are removed, otherwise false
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
      */
-    boolean remove( T... vals );
+    int put( byte[]... vals );
 
     
     /**
-     * Indicates whether the specified values are some of the attribute's values.
+     * Puts some values to this attribute.
+     * <p>
+     * The new values are replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
+     * </p>
      *
-     * @param vals the values
-     * @return true if this attribute contains all the values, otherwise false
+     * @param val some values to be put which may be null
+     * @return the number of added values, or 0 if none has been added
      */
-    boolean contains( T... vals );
+    int put( Value<?>... vals );
+
 
-    
     /**
-     * Adds some values to this attribute. If the new values are already present in
-     * the attribute values, the method has no effect.
      * <p>
-     * The new values are added at the end of list of values.
+     * Puts a list of values into this attribute.
      * </p>
      * <p>
-     * This method returns the number of values that were added.
+     * The new values will replace the previous values.
+     * </p>
+     * <p>
+     * This method returns the number of values that were put.
      * </p>
      *
-     * @param val some new values to be added which may be null
+     * @param vals the values to be put
      * @return the number of added values, or 0 if none has been added
      */
-    int add( T... val ) throws InvalidAttributeValueException, NamingException;
+    int put( List<Value<?>> vals );
+
+
+    /**
+     * <p>
+     * Removes all the  values that are equal to the given values.
+     * </p>
+     * <p>
+     * Returns true if all the values are removed.
+     * </p>
+     * <p>
+     * If the attribute type is not HR, then the values will be first converted
+     * to byte[]
+     * </p>
+     *
+     * @param vals the values to be removed
+     * @return true if all the values are removed, otherwise false
+     */
+    boolean remove( String... vals );
     
     
     /**
-     * Puts some values to this attribute.
      * <p>
-     * The new values are replace the previous values.
+     * Removes all the  values that are equal to the given values.
      * </p>
      * <p>
-     * This method returns the number of values that were put.
+     * Returns true if all the values are removed. 
+     * </p>
+     * <p>
+     * If the attribute type is HR, then the values will be first converted
+     * to String
      * </p>
      *
-     * @param vals some values to be put which may be null
-     * @return the number of added values, or 0 if none has been added
+     * @param vals the values to be removed
+     * @return true if all the values are removed, otherwise false
      */
-    int put( T... vals ) throws InvalidAttributeValueException, NamingException;
+    boolean remove( byte[]... val );
 
 
     /**
-     * Returns a cloned version of the current attribute.
+     * <p>
+     * Removes all the  values that are equal to the given values.
+     * </p>
+     * <p>
+     * Returns true if all the values are removed.
+     * </p>
+     * <p>
+     * If the attribute type is HR and some value which are not String, we
+     * will convert the values first (same thing for a non-HR attribute).
+     * </p>
      *
-     * @return A copy of the current attribute
+     * @param vals the values to be removed
+     * @return true if all the values are removed, otherwise false
      */
-    EntryAttribute<T> clone();
+    boolean remove( Value<?>... vals );
+
+    
+    /**
+     * <p>
+     * Set the attribute to Human Readable or to Binary. 
+     * </p>
+     * @param isHR <code>true</code> for a Human Readable attribute, 
+     * <code>false</code> for a Binary attribute.
+     */
+    void setHR( boolean isHR );
+
+    
+    /**
+     * Set the normalized ID. The ID will be lowercased, and spaces
+     * will be trimmed. 
+     *
+     * @param id The attribute ID
+     * @throws IllegalArgumentException If the ID is empty or null or
+     * resolve to an empty value after being trimmed
+     */
+    public void setId( String id );
+
+    
+    /**
+     * Set the user provided ID. It will also set the ID, normalizing
+     * the upId (removing spaces before and after, and lowercasing it)
+     *
+     * @param upId The attribute ID
+     * @throws IllegalArgumentException If the ID is empty or null or
+     * resolve to an empty value after being trimmed
+     */
+    public void setUpId( String upId );
+
+    
+    /**
+      * Retrieves the number of values in this attribute.
+      *
+      * @return the number of values in this attribute, including any values
+      * wrapping a null value if there is one
+      */
+    int size();
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Modification.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Modification.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Modification.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Modification.java Mon Mar 17 22:07:20 2008
@@ -26,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Modification<T extends EntryAttribute<?>>
+public interface Modification extends Cloneable
 {
     /**
      *  @return the operation
@@ -53,7 +53,7 @@
     /**
      * @return the attribute containing the modifications
      */
-    T getAttribute();
+    EntryAttribute getAttribute();
 
 
     /**
@@ -61,5 +61,14 @@
      *
      * @param attribute The modified attribute
      */
-    void setAttribute( T attribute );
+    void setAttribute( EntryAttribute attribute );
+    
+    
+    /**
+     * The clone operation
+     * TODO clone.
+     *
+     * @return
+     */
+    Modification clone();
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ModificationOperation.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ModificationOperation.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ModificationOperation.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/ModificationOperation.java Mon Mar 17 22:07:20 2008
@@ -30,8 +30,8 @@
 public enum ModificationOperation
 {
     ADD_ATTRIBUTE( 1 ),
-    REPLACE_ATTRIBUTE( 3 ),
-    REMOVE_ATTRIBUTE( 2 );
+    REPLACE_ATTRIBUTE( 2 ),
+    REMOVE_ATTRIBUTE( 3 );
 
     /** Internal value */
     private int value;
@@ -53,5 +53,24 @@
     public int getValue()
     {
         return value;
+    }
+    
+    
+    public String toString()
+    {
+        switch ( this )
+        {
+            case ADD_ATTRIBUTE :
+                return "add";
+                
+            case REPLACE_ATTRIBUTE :
+                return "replace";
+                
+            case REMOVE_ATTRIBUTE :
+                return "remove";
+                
+            default :
+                return "";
+        }
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/Value.java Mon Mar 17 22:07:20 2008
@@ -21,6 +21,11 @@
 
 import java.io.Serializable;
 
+import javax.naming.NamingException;
+
+import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
+
 
 /**
  * A interface for wrapping attribute values stored into an EntryAttribute. These
@@ -29,14 +34,11 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface Value<T> extends Cloneable, Serializable
+public interface Value<T> extends Cloneable, Serializable, Comparable<Value<T>>
 {
-    /**
-     * Sets the wrapped value.
-     *
-     * @param wrapped the value to set. Should be either a String, URI, or a byte[]
-     */
-    void set( T wrapped );
+    
+    Value<T> clone();
+    
     
     /**
      * Check if the contained value is null or not
@@ -47,9 +49,126 @@
     
     
     /**
+     * Sets the wrapped value.
+     *
+     * @param wrapped the value to set. Should be either a String, URI, or a byte[]
+     */
+    void set( T wrapped );
+    
+
+    /**
      * Get the stored value.
      *
      * @return The stored value
      */
     T get();
+    
+    
+    /**
+     * Get a reference on the stored value.
+     *
+     * @return A reference on the stored value.
+     */
+    T getReference();
+    
+    
+    /**
+     * Get a copy of the stored value.
+     *
+     * @return A copy of the stored value.
+     */
+    T getCopy();
+    
+    
+    /**
+     * Reset the value
+     */
+    void clear();
+    
+    
+    /**
+     * Tells if the value has already be normalized or not.
+     *
+     * @return <code>true</code> if the value has already been normalized.
+     */
+    boolean isNormalized();
+    
+    
+    /**
+     * Tells if the value is valid. The value must have already been
+     * validated at least once through a call to isValid( SyntaxChecker ).  
+     * 
+     * @return <code>true</code> if the value is valid
+     */
+    boolean isValid();
+
+    
+    /**
+     * Tells if the value is valid wrt a Syntax checker
+     * 
+     * @param SyntaxChecker the Syntax checker to use to validate the value
+     * @return <code>true</code> if the value is valid
+     * @exception NamingException if the value cannot be validated
+     */
+    boolean isValid( SyntaxChecker checker ) throws NamingException;
+
+    
+    /**
+     * Set the normalized flag.
+     * 
+     * @param the value : true or false
+     */
+    void setNormalized( boolean normalized );
+
+    
+    /**
+     * Gets the normalized (canonical) representation for the wrapped string.
+     * If the wrapped String is null, null is returned, otherwise the normalized
+     * form is returned.  If the normalizedValue is null, then this method
+     * will attempt to generate it from the wrapped value: repeated calls to
+     * this method do not unnecessarily normalize the wrapped value.  Only changes
+     * to the wrapped value result in attempts to normalize the wrapped value.
+     *
+     * @return gets the normalized value
+     */
+    T getNormalizedValue();
+    
+    
+    /**
+     * Gets a reference to the the normalized (canonical) representation 
+     * for the wrapped value.
+     *
+     * @return gets a reference to the normalized value
+     */
+    T getNormalizedValueReference();
+
+    
+    /**
+     * Gets a copy of the the normalized (canonical) representation 
+     * for the wrapped value.
+     *
+     * @return gets a copy of the normalized value
+     */
+    T getNormalizedValueCopy();
+
+    
+    /**
+     * Normalize the value. In order to use this method, the Value
+     * must be schema aware.
+     * 
+     * @exception NamingException If the value cannot be normalized
+     */
+    void normalize() throws NamingException;
+
+    
+    /**
+     * Normalize the value. For a client String value, applies the given normalizer.
+     * 
+     * It supposes that the client has access to the schema in order to select the
+     * appropriate normalizer.
+     * 
+     * @param Normalizer The normalizer to apply to the value
+     * @exception NamingException If the value cannot be normalized
+     */
+    void normalize( Normalizer normalizer ) throws NamingException;
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientAttribute.java Mon Mar 17 22:07:20 2008
@@ -20,6 +20,7 @@
 
 
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
+import org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker;
 
 import javax.naming.NamingException;
 
@@ -31,27 +32,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface ClientAttribute extends EntryAttribute<ClientValue<?>>
+public interface ClientAttribute extends EntryAttribute
 {
     /**
-     * Get's the user provided identifier for this entry.  This is the value
-     * that will be used as the identifier for the attribute within the
-     * entry.  If this is a commonName attribute for example and the user
-     * provides "COMMONname" instead when adding the entry then this is
-     * the format the user will have that entry returned by the directory
-     * server.  To do so we store this value as it was given and track it
-     * in the attribute using this property.
-     *
-     * @return the user provided identifier for this attribute
-     */
-    String getUpId();
-
-    
-    /**
      * Checks to see if this attribute is valid along with the values it contains.
      *
+     * @param checker The syntax checker
      * @return true if the attribute and it's values are valid, false otherwise
      * @throws NamingException if there is a failure to check syntaxes of values
      */
-    boolean isValid() throws NamingException;
+    boolean isValid( SyntaxChecker checker) throws NamingException;
 }

Modified: directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java?rev=638218&r1=638217&r2=638218&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java (original)
+++ directory/sandbox/akarasulu/bigbang/shared/ldap/src/main/java/org/apache/directory/shared/ldap/entry/client/ClientBinaryValue.java Mon Mar 17 22:07:20 2008
@@ -20,7 +20,11 @@
 
 
 import org.apache.directory.shared.ldap.NotImplementedException;
-import org.apache.directory.shared.ldap.entry.AbstractBinaryValue;
+import org.apache.directory.shared.ldap.entry.AbstractValue;
+import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.schema.ByteArrayComparator;
+import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,7 +41,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ClientBinaryValue extends AbstractBinaryValue implements ClientValue<byte[]>
+public class ClientBinaryValue extends AbstractValue<byte[]>
 {
     /** Used for serialization */
     public static final long serialVersionUID = 2L;
@@ -45,12 +49,6 @@
     /** logger for reporting errors that might not be handled properly upstream */
     private static final Logger LOG = LoggerFactory.getLogger( ClientBinaryValue.class );
 
-    /** the canonical representation of the wrapped binary value */
-    private transient byte[] normalizedValue;
-
-    /** cached results of the isValid() method call */
-    private transient Boolean valid;
-
 
     /**
      * Creates a ServerBinaryValue without an initial wrapped value.
@@ -59,6 +57,10 @@
      */
     public ClientBinaryValue()
     {
+        wrapped = null;
+        normalized = false;
+        valid = null;
+        normalizedValue = null;
     }
 
 
@@ -70,16 +72,40 @@
      */
     public ClientBinaryValue( byte[] wrapped )
     {
-        super.set( wrapped );
+        if ( wrapped != null )
+        {
+            this.wrapped = new byte[ wrapped.length ];
+            System.arraycopy( wrapped, 0, this.wrapped, 0, wrapped.length );
+        }
+        else
+        {
+            this.wrapped = null;
+        }
+        
+        normalized = false;
+        valid = null;
+        normalizedValue = null;
     }
 
 
     // -----------------------------------------------------------------------
     // Value<String> Methods
     // -----------------------------------------------------------------------
+    /**
+     * Reset the value
+     */
+    public void clear()
+    {
+        wrapped = null;
+        normalized = false;
+        normalizedValue = null;
+        valid = null;
+    }
 
 
-    /**
+
+
+    /*
      * Sets the wrapped binary value.  Has the side effect of setting the
      * normalizedValue and the valid flags to null if the wrapped value is
      * different than what is already set.  These cached values must be
@@ -102,42 +128,24 @@
         }
 
         normalizedValue = null;
+        normalized = false;
         valid = null;
-        super.set( wrapped );
-    }
-
-
-    // -----------------------------------------------------------------------
-    // ServerValue<String> Methods
-    // -----------------------------------------------------------------------
-
-
-    /**
-     * Gets the normalized (cannonical) representation for the wrapped string.
-     * If the wrapped String is null, null is returned, otherwise the normalized
-     * form is returned.  If no the normalizedValue is null, then this method
-     * will attempt to generate it from the wrapped value: repeated calls to
-     * this method do not unnecessarily normalize the wrapped value.  Only changes
-     * to the wrapped value result in attempts to normalize the wrapped value.
-     *
-     * @return a reference to the normalized version of the wrapped value
-     * @throws NamingException with failures to normalize
-     */
-    public byte[] getNormalizedReference() throws NamingException
-    {
-        if ( isNull() )
+        
+        if ( wrapped == null )
         {
-            return null;
+            this.wrapped = null;
         }
-
-        if ( normalizedValue == null )
+        else
         {
+            this.wrapped = new byte[ wrapped.length ];
+            System.arraycopy( wrapped, 0, this.wrapped, 0, wrapped.length );
         }
-
-        return normalizedValue;
     }
 
 
+    // -----------------------------------------------------------------------
+    // ServerValue<String> Methods
+    // -----------------------------------------------------------------------
     /**
      * Gets a direct reference to the normalized representation for the
      * wrapped value of this ServerValue wrapper. Implementations will most
@@ -147,11 +155,11 @@
      * @return the normalized version of the wrapped value
      * @throws NamingException if schema entity resolution fails or normalization fails
      */
-    public byte[] getNormalizedCopy() throws NamingException
+    public byte[] getNormalizedValueCopy()
     {
         if ( normalizedValue == null )
         {
-            getNormalizedReference();
+            return null;
         }
 
         byte[] copy = new byte[ normalizedValue.length ];
@@ -161,32 +169,38 @@
 
 
     /**
-     * Uses the syntaxChecker associated with the attributeType to check if the
-     * value is valid.  Repeated calls to this method do not attempt to re-check
-     * the syntax of the wrapped value every time if the wrapped value does not
-     * change. Syntax checks only result on the first check, and when the wrapped
-     * value changes.
-     *
-     * @see ServerValue#isValid()
+     * Normalize the value. For a client String value, applies the given normalizer.
+     * 
+     * It supposes that the client has access to the schema in order to select the
+     * appropriate normalizer.
+     * 
+     * @param Normalizer The normalizer to apply to the value
+     * @exception NamingException If the value cannot be normalized
      */
-    public final boolean isValid() throws NamingException
+    public final void normalize( Normalizer normalizer ) throws NamingException
     {
-        if ( valid != null )
+        if ( normalizer != null )
         {
-            return valid;
+            if ( wrapped == null )
+            {
+                normalized = true;
+            }
+            else
+            {
+                normalizedValue = (byte[])normalizer.normalize( wrapped );
+                normalized = true;
+            }
         }
-
-        return valid;
     }
 
-
+    
     /**
      *
      * @see ServerValue#compareTo(ServerValue)
      * @throws IllegalStateException on failures to extract the comparator, or the
      * normalizers needed to perform the required comparisons based on the schema
      */
-    public int compareTo( ClientValue<byte[]> value )
+    public int compareTo( Value<byte[]> value )
     {
         if ( isNull() )
         {
@@ -210,10 +224,14 @@
         if ( value instanceof ClientBinaryValue )
         {
             ClientBinaryValue binaryValue = ( ClientBinaryValue ) value;
-        }
 
-        throw new NotImplementedException( "I don't really know how to compare anything other " +
-                "than ServerBinaryValues at this point in time." );
+            return ByteArrayComparator.INSTANCE.compare( getNormalizedValue(), binaryValue.getNormalizedValue() );
+        }
+        
+        String message = "I don't really know how to compare anything other " +
+            "than ServerBinaryValues at this point in time."; 
+        LOG.error( message );
+        throw new NotImplementedException( message );
     }
 
 
@@ -236,16 +254,7 @@
             return 0;
         }
 
-        try
-        {
-            return Arrays.hashCode( getNormalizedReference() );
-        }
-        catch ( NamingException e )
-        {
-            String msg = "Failed to normalize \"" + toString() + "\" while trying to get hashCode()";
-            LOG.error( msg, e );
-            throw new IllegalStateException( msg, e );
-        }
+        return Arrays.hashCode( getNormalizedValueReference() );
     }
 
 
@@ -263,7 +272,7 @@
         {
             return true;
         }
-
+        
         if ( ! ( obj instanceof ClientBinaryValue ) )
         {
             return false;
@@ -271,31 +280,13 @@
 
         ClientBinaryValue other = ( ClientBinaryValue ) obj;
         
-        if ( isNull() && other.isNull() )
-        {
-            return true;
-        }
-
-        if ( isNull() != other.isNull() )
+        if ( isNull() )
         {
-            return false;
+            return other.isNull();
         }
 
         // now unlike regular values we have to compare the normalized values
-        try
-        {
-            return Arrays.equals( getNormalizedReference(), other.getNormalizedReference() );
-        }
-        catch ( NamingException e )
-        {
-            // 1st this is a warning because we're recovering from it and secondly
-            // we build big string since waste is not an issue when exception handling
-            LOG.warn( "Failed to get normalized value while trying to compare StringValues: "
-                    + toString() + " and " + other.toString() , e );
-
-            // recover by comparing non-normalized values
-            return Arrays.equals( getReference(), other.getReference() );
-        }
+        return Arrays.equals( getNormalizedValueReference(), other.getNormalizedValueReference() );
     }
 
 
@@ -315,6 +306,58 @@
             System.arraycopy( normalizedValue, 0, clone.normalizedValue, 0, normalizedValue.length );
         }
         
+        if ( wrapped != null )
+        {
+            clone.wrapped = new byte[ wrapped.length ];
+            System.arraycopy( wrapped, 0, clone.wrapped, 0, wrapped.length );
+        }
+        
         return clone;
+    }
+
+
+    /**
+     * Gets a copy of the binary value.
+     *
+     * @return a copy of the binary value
+     */
+    public byte[] getCopy()
+    {
+        if ( wrapped == null )
+        {
+            return null;
+        }
+
+        
+        final byte[] copy = new byte[ wrapped.length ];
+        System.arraycopy( wrapped, 0, copy, 0, wrapped.length );
+        return copy;
+    }
+
+
+    /**
+     * Dumps binary in hex with label.
+     *
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        if ( wrapped == null )
+        {
+            return "null";
+        }
+        else if ( wrapped.length > 16 )
+        {
+            // Just dump the first 16 bytes...
+            byte[] copy = new byte[16];
+            
+            System.arraycopy( wrapped, 0, copy, 0, 16 );
+            
+            return "'" + StringTools.dumpBytes( copy ) + "...'";
+        }
+        else
+        {
+            return "'" + StringTools.dumpBytes( wrapped ) + "'";
+        }
     }
 }



Mime
View raw message