directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r912399 [1/4] - in /directory/shared/trunk: ./ asn1-codec/ asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/ ...
Date Sun, 21 Feb 2010 20:52:35 GMT
Author: felixk
Date: Sun Feb 21 20:52:31 2010
New Revision: 912399

URL: http://svn.apache.org/viewvc?rev=912399&view=rev
Log:
DIRSHARED-49 (i18n)

First part

Added:
    directory/shared/trunk/i18n/   (with props)
    directory/shared/trunk/i18n/pom.xml   (with props)
    directory/shared/trunk/i18n/src/
    directory/shared/trunk/i18n/src/main/
    directory/shared/trunk/i18n/src/main/java/
    directory/shared/trunk/i18n/src/main/java/org/
    directory/shared/trunk/i18n/src/main/java/org/apache/
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/
    directory/shared/trunk/i18n/src/main/java/org/apache/directory/shared/i18n/I18n.java   (with props)
    directory/shared/trunk/i18n/src/main/resources/
    directory/shared/trunk/i18n/src/main/resources/org/
    directory/shared/trunk/i18n/src/main/resources/org/apache/
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties   (with props)
    directory/shared/trunk/i18n/src/main/resources/org/apache/directory/shared/i18n/messages.properties   (with props)
Modified:
    directory/shared/trunk/asn1-codec/pom.xml
    directory/shared/trunk/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java
    directory/shared/trunk/asn1/pom.xml
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/Value.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/BinaryCodec.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/Hex.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/DecoderMonitorAdapter.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoder.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1InputStream.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1OutputStream.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERConstructedOctetString.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERTaggedObject.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/DERUniversalString.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/BitString.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/OID.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/BooleanDecoder.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/IntegerDecoder.java
    directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/LongDecoder.java
    directory/shared/trunk/cursor/pom.xml
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/CursorIterator.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ListCursor.java
    directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/SingletonCursor.java
    directory/shared/trunk/dsml-parser/pom.xml
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/ldap/pom.xml
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItem.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemChecker.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACIItemParser.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ACITuple.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResultCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapTransformer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitReferralsAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseNameAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SimpleAuthentication.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/AbstractControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/cancel/CancelGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/certGeneration/CertGenerationGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulDisconnect/GracefulDisconnectGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/gracefulShutdown/GracefulShutdownGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/storedProcedure/StoredProcedure.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/storedProcedure/StoredProcedureGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/intermediate/IntermediateResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AndFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/AttributeValueAssertionFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ConnectorFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/ExtensibleMatchFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/NotFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/OrFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/PresentFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchRequestCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultReferenceCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SubstringFilter.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/ChangeType.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/unbind/UnBindRequestCodec.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapDecoderTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapMessageTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
    directory/shared/trunk/pom.xml

Modified: directory/shared/trunk/asn1-codec/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1-codec/pom.xml?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1-codec/pom.xml (original)
+++ directory/shared/trunk/asn1-codec/pom.xml Sun Feb 21 20:52:31 2010
@@ -33,6 +33,13 @@
 
   <dependencies>
     
+  
+    <dependency>
+      <artifactId>shared-i18n</artifactId>
+      <groupId>${groupId}</groupId>
+      <version>${version}</version>
+    </dependency>
+
     <dependency>
       <artifactId>shared-asn1</artifactId>
       <groupId>${groupId}</groupId>

Modified: directory/shared/trunk/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java (original)
+++ directory/shared/trunk/asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/Asn1CodecEncoder.java Sun Feb 21 20:52:31 2010
@@ -26,6 +26,7 @@
 
 import org.apache.directory.shared.asn1.codec.stateful.EncoderCallback;
 import org.apache.directory.shared.asn1.codec.stateful.StatefulEncoder;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.mina.core.session.IoSession;
 import org.apache.mina.filter.codec.ProtocolEncoder;
@@ -117,9 +118,7 @@
             }
             else
             {
-                throw new IllegalArgumentException(
-                        "Encoded result is not a ByteBuffer: " +
-                        encoded.getClass() );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_01001, encoded.getClass() ) );
             }
         }
     }

Modified: directory/shared/trunk/asn1/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/pom.xml?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/pom.xml (original)
+++ directory/shared/trunk/asn1/pom.xml Sun Feb 21 20:52:31 2010
@@ -29,6 +29,14 @@
   
   <artifactId>shared-asn1</artifactId>
   <name>Apache Directory Shared ASN.1</name>
-  <packaging>jar</packaging>  
+  <packaging>jar</packaging>
+  
+  <dependencies>
+    <dependency>
+      <artifactId>shared-i18n</artifactId>
+      <groupId>${groupId}</groupId>
+      <version>${version}</version>
+    </dependency> 
+  </dependencies>
 </project>
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/AbstractAsn1Object.java Sun Feb 21 20:52:31 2010
@@ -24,6 +24,7 @@
 
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -133,7 +134,7 @@
 
         if ( currentLength > expectedLength )
         {
-            throw new DecoderException( "Current Length is above expected Length" );
+            throw new DecoderException( I18n.err( I18n.ERR_00041 ) );
         }
     }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Decoder.java Sun Feb 21 20:52:31 2010
@@ -29,6 +29,7 @@
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.i18n.I18n;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -232,8 +233,8 @@
 
                 if ( expectedLength > 4 )
                 {
-                    LOG.error( "Overflow : can't have more than 4 bytes long length" );
-                    throw new DecoderException( "Overflow : can't have more than 4 bytes long length" );
+                    LOG.error( I18n.err( I18n.ERR_00005 ) );
+                    throw new DecoderException( I18n.err( I18n.ERR_00005 ) );
                 }
 
                 tlv.setLength( 0 );
@@ -243,8 +244,8 @@
             }
             else
             {
-                LOG.error( "Length reserved extension used" );
-                throw new DecoderException( "Length reserved extension used" );
+                LOG.error( I18n.err( I18n.ERR_00006 ) );
+                throw new DecoderException( I18n.err( I18n.ERR_00006 ) );
             }
 
             return MORE;
@@ -362,8 +363,8 @@
         
         if ( tlv == null )
         {
-            LOG.error( "The current container TLV is null." );
-            throw new DecoderException( "Current TLV is null" );
+            LOG.error( I18n.err( I18n.ERR_00007 ) );
+            throw new DecoderException( I18n.err( I18n.ERR_00007 ) );
         }
         
         int length = tlv.getLength();
@@ -402,7 +403,7 @@
                 // The expected length is lower than the Value length of the
                 // current TLV. This is an error...
                 LOG.error( "tlv[{}, {}]", Integer.valueOf( expectedLength ), Integer.valueOf( currentLength ) );
-                throw new DecoderException( "The current Value length is above the expected length" );
+                throw new DecoderException( I18n.err( I18n.ERR_00008, Integer.valueOf( currentLength ), Integer.valueOf( expectedLength ) ) );
             }
 
             // deal with the particular case where expected length equal
@@ -636,8 +637,8 @@
                 }
                 else
                 {
-                    LOG.error( "The PDU is decoded, but we should have had more TLVs" );
-                    throw new DecoderException( "Truncated PDU. Some elements are lacking, accordingly to the grammar" );
+                    LOG.error( I18n.err( I18n.ERR_00009 ) );
+                    throw new DecoderException( I18n.err( I18n.ERR_00010 ) );
                 }
             }
 
@@ -921,7 +922,7 @@
 
         if ( ( this.indefiniteLengthAllowed ) && ( maxLengthLength > 126 ) )
         {
-            throw new DecoderException( "Length above 126 bytes are not allowed for a definite form Length" );
+            throw new DecoderException( I18n.err( I18n.ERR_00011 ) );
         }
 
         this.maxLengthLength = maxLengthLength;

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java Sun Feb 21 20:52:31 2010
@@ -23,6 +23,7 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.i18n.I18n;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -132,15 +133,14 @@
         if ( transition == null )
         {
 
-            String errorMessage = "Bad transition from state "
-                + currentGrammar.getStatesEnum().getState( currentState )
-                + ", tag " + Asn1StringUtils.dumpByte( tagByte );
+            String errorMessage = I18n.err( I18n.ERR_00001, currentGrammar.getStatesEnum().getState( currentState ), 
+            		Asn1StringUtils.dumpByte( tagByte ) );
 
             log.error( errorMessage );
 
             // If we have no more grammar on the stack, then this is an
             // error
-            throw new DecoderException( "Bad transition !" );
+            throw new DecoderException( I18n.err( I18n.ERR_00002 ) );
         }
 
         if ( IS_DEBUG )

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/Value.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/Value.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/Value.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/ber/tlv/Value.java Sun Feb 21 20:52:31 2010
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.asn1.primitives.BitString;
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -631,7 +632,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -649,7 +650,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -667,7 +668,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -684,7 +685,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -703,7 +704,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -722,7 +723,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -741,7 +742,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -756,7 +757,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -775,7 +776,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -786,7 +787,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -805,7 +806,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -816,7 +817,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -836,7 +837,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -847,7 +848,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -866,7 +867,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -877,7 +878,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;
@@ -896,7 +897,7 @@
     {
         if ( buffer == null )
         {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00003 ) );
         }
 
         try
@@ -905,7 +906,7 @@
         }
         catch ( BufferOverflowException boe )
         {
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            throw new EncoderException( I18n.err( I18n.ERR_00004 ) );
         }
 
         return;

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/BinaryCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/BinaryCodec.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/BinaryCodec.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/BinaryCodec.java Sun Feb 21 20:52:31 2010
@@ -25,6 +25,7 @@
 import org.apache.directory.shared.asn1.codec.BinaryEncoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -106,7 +107,7 @@
     {
         if ( !( raw instanceof byte[] ) )
         {
-            throw new EncoderException( "argument not a byte array" );
+            throw new EncoderException( I18n.err( I18n.ERR_00012 ) );
         }
         return toAsciiChars( ( byte[] ) raw );
     }
@@ -141,7 +142,7 @@
         {
             return fromAscii( ( ( String ) ascii ).toCharArray() );
         }
-        throw new DecoderException( "argument not a byte array" );
+        throw new DecoderException( I18n.err( I18n.ERR_00012 ) );
     }
 
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/Hex.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/Hex.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/Hex.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/binary/Hex.java Sun Feb 21 20:52:31 2010
@@ -25,6 +25,7 @@
 import org.apache.directory.shared.asn1.codec.BinaryEncoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.EncoderException;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -65,7 +66,7 @@
 
         if ( ( len & 0x01 ) != 0 )
         {
-            throw new DecoderException( "Odd number of characters." );
+            throw new DecoderException( I18n.err( I18n.ERR_00013 ) );
         }
 
         byte[] out = new byte[len >> 1];
@@ -100,7 +101,7 @@
         int digit = Character.digit( ch, 16 );
         if ( digit == -1 )
         {
-            throw new DecoderException( "Illegal hexadecimal charcter " + ch + " at index " + index );
+            throw new DecoderException( I18n.err( I18n.ERR_00014, ch, index ) );
         }
         return digit;
     }

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/DecoderMonitorAdapter.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/DecoderMonitorAdapter.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/DecoderMonitorAdapter.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/DecoderMonitorAdapter.java Sun Feb 21 20:52:31 2010
@@ -38,7 +38,7 @@
      */
     public void error( StatefulDecoder decoder, Exception exception )
     {
-        System.err.println( "ERROR: " + exception.getMessage() );
+        System.err.println( "ERROR: " + exception.getLocalizedMessage() );
     }
 
 
@@ -50,7 +50,7 @@
      */
     public void fatalError( StatefulDecoder decoder, Exception exception )
     {
-        System.err.println( "FATAL: " + exception.getMessage() );
+        System.err.println( "FATAL: " + exception.getLocalizedMessage() );
     }
 
 
@@ -62,7 +62,7 @@
      */
     public void warning( StatefulDecoder decoder, Exception exception )
     {
-        System.err.println( "WARN: " + exception.getMessage() );
+        System.err.println( "WARN: " + exception.getLocalizedMessage() );
     }
 
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/codec/stateful/examples/HexDecoder.java Sun Feb 21 20:52:31 2010
@@ -24,6 +24,7 @@
 
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.codec.stateful.AbstractStatefulDecoder;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -142,7 +143,7 @@
             case 102:
                 return 15;
             default:
-                throw new DecoderException( "non-hex character '" + ( char ) ch + "' encountered" );
+                throw new DecoderException( I18n.err( I18n.ERR_00015, ch ) );
         }
     }
 }

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1InputStream.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1InputStream.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1InputStream.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1InputStream.java Sun Feb 21 20:52:31 2010
@@ -32,6 +32,8 @@
 import java.nio.ByteBuffer;
 import java.util.Vector;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * General purpose ASN.1 decoder.
@@ -44,7 +46,7 @@
     {
         public void encode( ASN1OutputStream out ) throws IOException
         {
-            throw new IOException( "End of stream." );
+            throw new IOException( I18n.err( I18n.ERR_00016 ) );
         }
 
 
@@ -110,7 +112,7 @@
         int length = read();
         if ( length < 0 )
         {
-            throw new IOException( "EOF found when length expected." );
+            throw new IOException( I18n.err( I18n.ERR_00017 ) );
         }
 
         // Indefinite-length encoding.
@@ -125,7 +127,7 @@
 
             if ( size > 4 )
             {
-                throw new IOException( "DER length more than 4 bytes." );
+                throw new IOException( I18n.err( I18n.ERR_00018 ) );
             }
 
             length = 0;
@@ -135,7 +137,7 @@
 
                 if ( next < 0 )
                 {
-                    throw new IOException( "EOF found reading length." );
+                    throw new IOException( I18n.err( I18n.ERR_00019 ) );
                 }
 
                 length = ( length << 8 ) + next;
@@ -143,7 +145,7 @@
 
             if ( length < 0 )
             {
-                throw new IOException( "Corrupted steam - negative length found." );
+                throw new IOException( I18n.err( I18n.ERR_00020 ) );
             }
         }
 
@@ -171,7 +173,7 @@
 
         if ( left != 0 )
         {
-            throw new EOFException( "EOF encountered in middle of object." );
+            throw new EOFException( I18n.err( I18n.ERR_00021 ) );
         }
     }
 
@@ -395,7 +397,7 @@
         {
             if ( EOF_FOUND )
             {
-                throw new EOFException( "Attempt to read past end of file." );
+                throw new EOFException( I18n.err( I18n.ERR_00022 ) );
             }
 
             EOF_FOUND = true;
@@ -506,7 +508,7 @@
                         return new BERTaggedObject( false, tagNo, berSequence );
                     }
 
-                    throw new IOException( "Unknown BER object encountered." );
+                    throw new IOException( I18n.err( I18n.ERR_00023 ) );
             }
         }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1OutputStream.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1OutputStream.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1OutputStream.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/ASN1OutputStream.java Sun Feb 21 20:52:31 2010
@@ -28,6 +28,8 @@
 import java.io.OutputStream;
 import java.nio.ByteBuffer;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 public class ASN1OutputStream extends FilterOutputStream
 {
@@ -107,7 +109,7 @@
         }
         else
         {
-            throw new IOException( "Object not DEREncodable." );
+            throw new IOException( I18n.err( I18n.ERR_00024 ) );
         }
     }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERConstructedOctetString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERConstructedOctetString.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERConstructedOctetString.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERConstructedOctetString.java Sun Feb 21 20:52:31 2010
@@ -28,6 +28,8 @@
 import java.util.Enumeration;
 import java.util.Vector;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 public class BERConstructedOctetString extends DEROctetString
 {
@@ -69,12 +71,11 @@
             }
             catch ( ClassCastException e )
             {
-                throw new IllegalArgumentException( octs.elementAt( i ).getClass().getName()
-                    + " found in input should only contain DEROctetString." );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_00025, octs.elementAt( i ).getClass().getName() ) );
             }
             catch ( IOException e )
             {
-                throw new IllegalArgumentException( "Exception converting octets " + e.toString() );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_00026, e.toString() ) );
             }
         }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERTaggedObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERTaggedObject.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERTaggedObject.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/BERTaggedObject.java Sun Feb 21 20:52:31 2010
@@ -26,6 +26,8 @@
 import java.io.IOException;
 import java.util.Enumeration;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * BER TaggedObject
@@ -99,7 +101,7 @@
                 }
                 else
                 {
-                    throw new RuntimeException( "Not implemented: " + obj.getClass().getName() );
+                    throw new RuntimeException( I18n.err( I18n.ERR_00027, obj.getClass().getName() ) );
                 }
             }
             else

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/DERUniversalString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/DERUniversalString.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/DERUniversalString.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/der/DERUniversalString.java Sun Feb 21 20:52:31 2010
@@ -26,6 +26,8 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * DER UniversalString object.
@@ -58,7 +60,7 @@
         }
         catch ( IOException e )
         {
-            throw new RuntimeException( "Internal error encoding BitString." );
+            throw new RuntimeException( I18n.err( I18n.ERR_00028 ) );
         }
 
         byte[] string = baos.toByteArray();

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/BitString.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/BitString.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/BitString.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/BitString.java Sun Feb 21 20:52:31 2010
@@ -22,6 +22,8 @@
 
 import java.io.Serializable;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * Implement the Bit String primitive type. A BitString is internally stored as
@@ -82,7 +84,7 @@
         if ( length <= 0 )
         {
             // This is not allowed
-            throw new IndexOutOfBoundsException( "Null or negative length are not allowed" );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00029 ) );
         }
         
         nbBits = length;
@@ -121,7 +123,7 @@
         if ( length <= 0 )
         {
             // This is not allowed
-            throw new IndexOutOfBoundsException( "Null or negative length are not allowed" );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00029 ) );
         }
         
         nbBits = length;
@@ -258,7 +260,7 @@
     {
         if ( ( pos < 0 ) || ( pos > nbBits ) )
         {
-            throw new IndexOutOfBoundsException( "Bad bit number : out of bound" );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00030 ) );
         }
         
         int posInt = nbBytes - 1 - ( ( pos + nbUnusedBits ) >> 3 );
@@ -279,7 +281,7 @@
     {
         if ( ( pos < 0 ) || ( pos > nbBits ) )
         {
-            throw new IndexOutOfBoundsException( "Bad bit number : out of bound" );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00030 ) );
         }
         
         int posInt = nbBytes - 1 - ( ( pos + nbUnusedBits ) >> 3 );
@@ -313,8 +315,7 @@
 
         if ( pos > nbBits )
         {
-            throw new IndexOutOfBoundsException( "Cannot get a bit at position " + pos + " when the BitString contains only "
-                + nbBits + " ints" );
+            throw new IndexOutOfBoundsException( I18n.err( I18n.ERR_00031, pos, nbBits ) );
         }
 
         int posInt = nbBytes - 1 - ( ( pos + nbUnusedBits ) >> 3 );

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/OID.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/OID.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/OID.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/primitives/OID.java Sun Feb 21 20:52:31 2010
@@ -25,6 +25,7 @@
 
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -130,12 +131,12 @@
 
         if ( oid == null )
         {
-            throw new DecoderException( "Null OID" );
+            throw new DecoderException( I18n.err( I18n.ERR_00032 ) );
         }
 
         if ( oid.length < 1 )
         {
-            throw new DecoderException( "Invalid OID : " + Asn1StringUtils.dumpBytes( oid ) );
+            throw new DecoderException( I18n.err( I18n.ERR_00033, Asn1StringUtils.dumpBytes( oid ) ) );
         }
 
         // First, we have to calculate the number of int to allocate
@@ -230,7 +231,7 @@
 
         if ( ( oid == null ) || ( oid.length() == 0 ) )
         {
-            throw new DecoderException( "Null OID" );
+            throw new DecoderException( I18n.err( I18n.ERR_00032 ) );
         }
 
         int nbValues = 1;
@@ -248,7 +249,7 @@
                 {
 
                     // Two dots, that's an error !
-                    throw new DecoderException( "Invalid OID : " + oid );
+                    throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
                 }
 
                 nbValues++;
@@ -263,7 +264,7 @@
         // We must have at least 2 ints
         if ( nbValues < 2 )
         {
-            throw new DecoderException( "Invalid OID : " + oid );
+            throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
         }
 
         oidValues = new long[nbValues];
@@ -289,13 +290,13 @@
                 break;
 
             default: // error, this value is not allowed
-                throw new DecoderException( "Invalid OID : " + oid );
+                throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
         }
 
         // We must have a dot
         if ( chars[pos++] != '.' )
         {
-            throw new DecoderException( "Invalid OID : " + oid );
+            throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
         }
 
         dotSeen = true;
@@ -312,12 +313,12 @@
                 {
 
                     // Two dots, that's an error !
-                    throw new DecoderException( "Invalid OID : " + oid );
+                    throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
                 }
 
                 if ( ituOrIso && value > 39 )
                 {
-                    throw new DecoderException( "Invalid OID : " + oid );
+                    throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
                 }
                 else
                 {
@@ -339,7 +340,7 @@
             {
 
                 // We don't have a number, this is an error
-                throw new DecoderException( "Invalid OID : " + oid );
+                throw new DecoderException( I18n.err( I18n.ERR_00033, oid ) );
             }
         }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/BooleanDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/BooleanDecoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/BooleanDecoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/BooleanDecoder.java Sun Feb 21 20:52:31 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.shared.asn1.ber.tlv.Value;
+import org.apache.directory.shared.i18n.I18n;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,12 +56,12 @@
 
         if ( ( bytes == null ) || ( bytes.length == 0 ) )
         {
-            throw new BooleanDecoderException( "The value is 0 byte long. This is not allowed for a boolean" );
+            throw new BooleanDecoderException( I18n.err( I18n.ERR_00034 ) );
         }
 
         if ( bytes.length != 1 )
         {
-            throw new BooleanDecoderException( "The value is not 1 byte long. This is not allowed for a boolean" );
+            throw new BooleanDecoderException( I18n.err( I18n.ERR_00035 ) );
         }
 
         if ( ( bytes[0] != 0 ) && ( bytes[0] != ( byte ) 0xFF ) )

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/IntegerDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/IntegerDecoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/IntegerDecoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/IntegerDecoder.java Sun Feb 21 20:52:31 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.shared.asn1.ber.tlv.Value;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -61,13 +62,12 @@
 
         if ( ( bytes == null ) || ( bytes.length == 0 ) )
         {
-            throw new IntegerDecoderException( "The value is 0 byte long. This is not allowed for an integer" );
+            throw new IntegerDecoderException( I18n.err( I18n.ERR_00036 ) );
         }
 
         if ( bytes.length > 4 )
         {
-            throw new IntegerDecoderException(
-                "The value is more than 4 bytes long. This is not allowed for an integer" );
+            throw new IntegerDecoderException( I18n.err( I18n.ERR_00037 ) );
         }
 
         for ( int i = 0; ( i < bytes.length ) && ( i < 5 ); i++ )
@@ -86,7 +86,7 @@
         }
         else
         {
-            throw new IntegerDecoderException( "The value is not in the range [" + min + ", " + max + "]" );
+            throw new IntegerDecoderException( I18n.err( I18n.ERR_00038, min, max ) );
         }
     }
 

Modified: directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/LongDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/LongDecoder.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/LongDecoder.java (original)
+++ directory/shared/trunk/asn1/src/main/java/org/apache/directory/shared/asn1/util/LongDecoder.java Sun Feb 21 20:52:31 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.shared.asn1.ber.tlv.Value;
+import org.apache.directory.shared.i18n.I18n;
 
 
 /**
@@ -67,13 +68,12 @@
 
         if ( ( bytes == null ) || ( bytes.length == 0 ) )
         {
-            throw new LongDecoderException( "The value is 0 byte long. This is not allowed for a long" );
+            throw new LongDecoderException( I18n.err( I18n.ERR_00039 ) );
         }
 
         if ( bytes.length > 8 )
         {
-            throw new LongDecoderException(
-                "The value is more than 4 bytes long. This is not allowed for a long" );
+            throw new LongDecoderException( I18n.err( I18n.ERR_00039 ) );
         }
 
         for ( int i = 0; ( i < bytes.length ) && ( i < 9 ); i++ )
@@ -92,7 +92,7 @@
         }
         else
         {
-            throw new LongDecoderException( "The value is not in the range [" + min + ", " + max + "]" );
+            throw new LongDecoderException( I18n.err( I18n.ERR_00038, min, max ) );
         }
     }
 

Modified: directory/shared/trunk/cursor/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/pom.xml?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/pom.xml (original)
+++ directory/shared/trunk/cursor/pom.xml Sun Feb 21 20:52:31 2010
@@ -32,5 +32,13 @@
   </description>
   
   <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <artifactId>shared-i18n</artifactId>
+      <groupId>${groupId}</groupId>
+      <version>${version}</version>
+    </dependency> 
+  </dependencies>
 </project>
 

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java (original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/AbstractCursor.java Sun Feb 21 20:52:31 2010
@@ -21,6 +21,8 @@
 
 import java.util.Iterator;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * Simple class that contains often used Cursor code.
@@ -40,7 +42,7 @@
     {
         if ( monitor == null )
         {
-            throw new NullPointerException( "monitor" );
+            throw new NullPointerException( I18n.err( I18n.ERR_02001 ) );
         }
         
         this.monitor = monitor;

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/CursorIterator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/CursorIterator.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/CursorIterator.java (original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/CursorIterator.java Sun Feb 21 20:52:31 2010
@@ -22,6 +22,8 @@
 
 import java.util.Iterator;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * An Iterator over a Cursor so Cursors can be Iterable for using in foreach
@@ -74,7 +76,7 @@
         }
         catch ( Exception e )
         {
-            throw new RuntimeException( "Failure on underlying Cursor.", e );
+            throw new RuntimeException( I18n.err( I18n.ERR_02002 ), e );
         }
     }
 
@@ -84,6 +86,6 @@
      */
     public void remove()
     {
-        throw new UnsupportedOperationException( "Underlying Cursor does not support removal." );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_02003 ) );
     }
 }

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java (original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/EmptyCursor.java Sun Feb 21 20:52:31 2010
@@ -18,6 +18,8 @@
  */
 package org.apache.directory.shared.ldap.cursor;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * An empty Cursor implementation.
@@ -117,7 +119,7 @@
     public E get() throws Exception
     {
         checkNotClosed( "get()" );
-        throw new InvalidCursorPositionException( "This cursor is empty and cannot return elements!" );
+        throw new InvalidCursorPositionException( I18n.err( I18n.ERR_02004 ) );
     }
 
 

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ListCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ListCursor.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ListCursor.java (original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/ListCursor.java Sun Feb 21 20:52:31 2010
@@ -24,6 +24,8 @@
 import java.util.List;
 import java.util.Comparator;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A simple implementation of a Cursor on a {@link List}.  Optionally, the
@@ -67,20 +69,19 @@
     {
         if ( ( start < 0  )|| ( start > list.size() ) )
         {
-            throw new IllegalArgumentException( "start index '" + start + "' out of range" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_02005, start ) );
         }
 
         if ( ( end < 0 ) || ( end > list.size() ) )
         {
-            throw new IllegalArgumentException( "end index '" + end + "' out of range" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_02006, end ) );
         }
 
         // check list is not empty list since the empty list is the only situation
         // where we allow for start to equal the end: in other cases it makes no sense
         if ( ( list.size() > 0 ) && ( start >= end ) )
         {
-            throw new IllegalArgumentException( "start index '" + start + "' greater than or equal to end index '"
-                    + end + "' just does not make sense" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_02007, start, end ) );
         }
 
         this.comparator = comparator;
@@ -263,7 +264,7 @@
         }
 
         // TODO might want to add some code here to utilize the comparator
-        throw new UnsupportedOperationException( "don't know if list is sorted and checking that is not worth it" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_02008 ) );
     }
 
 
@@ -297,7 +298,7 @@
         }
 
         // TODO might want to add some code here to utilize the comparator
-        throw new UnsupportedOperationException( "don't know if list is sorted and checking that is not worth it" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_02008 ) );
     }
 
 
@@ -477,7 +478,7 @@
         
         if ( index < start || index >= end )
         {
-            throw new IOException( "Cursor not positioned at an element" );
+            throw new IOException( I18n.err( I18n.ERR_02009 ) );
         }
 
         return list.get( index );

Modified: directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/SingletonCursor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/SingletonCursor.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/SingletonCursor.java (original)
+++ directory/shared/trunk/cursor/src/main/java/org/apache/directory/shared/ldap/cursor/SingletonCursor.java Sun Feb 21 20:52:31 2010
@@ -21,6 +21,8 @@
 
 import java.util.Comparator;
 
+import org.apache.directory.shared.i18n.I18n;
+
 
 /**
  * A Cursor over a single element.
@@ -85,8 +87,7 @@
 
         if ( comparator == null )
         {
-            throw new UnsupportedOperationException(
-                    "Without a comparator I cannot advance to just before the specified element." );
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02010 ) );
         }
 
         int comparison = comparator.compare( singleton, element );
@@ -111,8 +112,7 @@
 
         if ( comparator == null )
         {
-            throw new UnsupportedOperationException(
-                    "Without a comparator I cannot advance to just after the specified element." );
+            throw new UnsupportedOperationException( I18n.err( I18n.ERR_02011 ) );
         }
 
         int comparison = comparator.compare( singleton, element );
@@ -288,11 +288,11 @@
 
         if ( beforeFirst )
         {
-            throw new InvalidCursorPositionException( "Cannot access element if positioned before first." );
+            throw new InvalidCursorPositionException( I18n.err( I18n.ERR_02012 ) );
         }
         else
         {
-            throw new InvalidCursorPositionException( "Cannot access element if positioned after last." );
+            throw new InvalidCursorPositionException( I18n.err( I18n.ERR_02013 ) );
         }
     }
 

Modified: directory/shared/trunk/dsml-parser/pom.xml
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/pom.xml?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/pom.xml (original)
+++ directory/shared/trunk/dsml-parser/pom.xml Sun Feb 21 20:52:31 2010
@@ -47,6 +47,12 @@
     </dependency> 
     
     <dependency>
+      <artifactId>shared-i18n</artifactId>
+      <groupId>${groupId}</groupId>
+      <version>${version}</version>
+    </dependency> 
+    
+    <dependency>
       <groupId>dom4j</groupId>
       <artifactId>dom4j</artifactId>
       <version>${dom4j.version}</version>

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractGrammar.java Sun Feb 21 20:52:31 2010
@@ -24,6 +24,7 @@
 import java.io.IOException;
 import java.util.HashMap;
 
+import org.apache.directory.shared.i18n.I18n;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -175,8 +176,7 @@
         }
         else
         {
-            throw new XmlPullParserException( "The tag " + new Tag( tagName, tagType )
-                + " can't be found at this position", xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03036, new Tag( tagName, tagType ) ), xpp, null );
         }
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java Sun Feb 21 20:52:31 2010
@@ -30,6 +30,7 @@
 
 import org.apache.directory.shared.dsmlv2.request.BatchRequest;
 import org.apache.directory.shared.dsmlv2.request.Dsmlv2Grammar;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
@@ -166,7 +167,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                     null );
             }
         }
@@ -203,8 +204,7 @@
         }
         else
         {
-            throw new XmlPullParserException( "The tag " + new Tag( tagName, tagType )
-                + " can't be found at this position", xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03036, new Tag( tagName, tagType ) ), xpp, null );
         }
     }
 
@@ -248,7 +248,7 @@
                 }
                 catch ( IOException e )
                 {
-                    throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                         null );
                 }
                 eventType = xpp.getEventType();
@@ -277,7 +277,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                     null );
             }
         }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2ResponseParser.java Sun Feb 21 20:52:31 2010
@@ -30,6 +30,7 @@
 
 import org.apache.directory.shared.dsmlv2.reponse.BatchResponse;
 import org.apache.directory.shared.dsmlv2.reponse.Dsmlv2ResponseGrammar;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
@@ -166,7 +167,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                     null );
             }
         }
@@ -203,8 +204,7 @@
         }
         else
         {
-            throw new XmlPullParserException( "The tag " + new Tag( tagName, tagType )
-                + " can't be found at this position", xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03036, new Tag( tagName, tagType ) ), xpp, null );
         }
     }
 
@@ -248,7 +248,7 @@
                 }
                 catch ( IOException e )
                 {
-                    throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                         null );
                 }
                 eventType = xpp.getEventType();
@@ -277,7 +277,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An IOException ocurred during parsing : " + e.getMessage(), xpp,
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03037, e.getLocalizedMessage() ), xpp,
                     null );
             }
         }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java Sun Feb 21 20:52:31 2010
@@ -33,6 +33,7 @@
 import org.apache.directory.shared.dsmlv2.request.BatchRequest;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.util.Base64;
@@ -177,14 +178,14 @@
 
             if ( requestID == 0 )
             {
-                throw new XmlPullParserException( "The attribute requestID can't be equal to 0", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03038 ), xpp, null );
             }
 
             return requestID;
         }
         catch ( NumberFormatException e )
         {
-            throw new XmlPullParserException( "the given requestID is not an integer", xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03039 ), xpp, null );
         }
     }
 
@@ -259,7 +260,7 @@
 
         if ( batchRequest == null )
         {
-            throw new XmlPullParserException( "unable to find the batch request", container.getParser(), null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03040 ), container.getParser(), null );
         }
 
         return ( ( batchRequest.getProcessing() == Processing.PARALLEL ) && ( batchRequest.getResponseOrder() == ResponseOrder.UNORDERED ) );

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java Sun Feb 21 20:52:31 2010
@@ -56,6 +56,7 @@
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.OnError;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
@@ -213,7 +214,7 @@
         {
             // Unable to connect to server
             // We create a new ErrorResponse and return the XML response.
-            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.COULD_NOT_CONNECT, e.getMessage() );
+            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.COULD_NOT_CONNECT, e.getLocalizedMessage() );
             batchResponse.addResponse( errorResponse );
             return batchResponse.toDsml();
         }
@@ -228,8 +229,8 @@
         catch ( XmlPullParserException e )
         {
             // We create a new ErrorResponse and return the XML response.
-            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
-                + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
+            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err(I18n.ERR_03001, e.getLocalizedMessage(),
+                e.getLineNumber(), e.getColumnNumber() ) );
             batchResponse.addResponse( errorResponse );
             return batchResponse.toDsml();
         }
@@ -248,8 +249,8 @@
         catch ( XmlPullParserException e )
         {
             // We create a new ErrorResponse and return the XML response.
-            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
-                + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
+            ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err(I18n.ERR_03001, e.getLocalizedMessage(),
+                e.getLineNumber(), e.getColumnNumber() ) );
             batchResponse.addResponse( errorResponse );
             return batchResponse.toDsml();
         }
@@ -262,8 +263,7 @@
                 && ( request.getMessageId() == 0 ) )
             {
                 // Then we have to send an errorResponse
-                ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST,
-                    "A requestID must be specified to each request when Processing is Parallel and ReponseOrder is Unordered." );
+                ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err( I18n.ERR_03002 ) );
                 batchResponse.addResponse( errorResponse );
                 return batchResponse.toDsml();
             }
@@ -276,7 +276,7 @@
             {
                 // We create a new ErrorResponse and return the XML response.
                 ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.GATEWAY_INTERNAL_ERROR,
-                    "Internal Error: " + e.getMessage() );
+                    I18n.err( I18n.ERR_03003, e.getMessage() ) );
                 batchResponse.addResponse( errorResponse );
                 return batchResponse.toDsml();
             }
@@ -295,8 +295,8 @@
             catch ( XmlPullParserException e )
             {
                 // We create a new ErrorResponse and return the XML response.
-                ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, e.getMessage()
-                    + " - Line " + e.getLineNumber() + " - Column " + e.getColumnNumber() );
+                ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n.err( I18n.ERR_03001,
+                		e.getLocalizedMessage(), e.getLineNumber(), e.getColumnNumber() ) );
                 batchResponse.addResponse( errorResponse );
                 return batchResponse.toDsml();
             }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=912399&r1=912398&r2=912399&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java Sun Feb 21 20:52:31 2010
@@ -40,6 +40,7 @@
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.dsmlv2.Tag;
 import org.apache.directory.shared.dsmlv2.reponse.ErrorResponse.ErrorResponseType;
+import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
@@ -1119,12 +1120,12 @@
                 }
                 else
                 {
-                    throw new XmlPullParserException( "Unknown type", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03004 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "type attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03005 ), xpp, null );
             }
         }
     };
@@ -1181,7 +1182,7 @@
         {
             if ( !OID.isOID( attributeValue ) )
             {
-                throw new XmlPullParserException( "Incorrect value for 'type' attribute. This is not an OID.", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03006 ), xpp, null );
             }
             
             control = new ControlImpl( attributeValue );
@@ -1189,7 +1190,7 @@
         }
         else
         {
-            throw new XmlPullParserException( "type attribute is required", xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03005 ), xpp, null );
         }
         // CRITICALITY
         attributeValue = xpp.getAttributeValue( "", "criticality" );
@@ -1206,7 +1207,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "Incorrect value for 'criticality' attribute", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03007 ), xpp, null );
             }
         }
     }
@@ -1292,7 +1293,7 @@
         }
         catch ( IOException e )
         {
-            throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+            throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
         }
     }
 
@@ -1380,12 +1381,12 @@
                 }
                 catch ( NumberFormatException e )
                 {
-                    throw new XmlPullParserException( "the given resultCode is not an integer", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03009 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( "code attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03010 ), xpp, null );
             }
             // descr
             attributeValue = xpp.getAttributeValue( "", "descr" );
@@ -1393,8 +1394,7 @@
             {
                 if ( DSMLV2_DESCR_TAGS.contains( attributeValue ) == false )
                 {
-                    throw new XmlPullParserException( "descr ('" + attributeValue
-                        + "') doesn't match with the possible values", xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03011, attributeValue ), xpp, null );
                 }
 
             }
@@ -1435,7 +1435,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1487,7 +1487,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1652,7 +1652,7 @@
             }
             else
             {
-                throw new XmlPullParserException( "name attribute is required", xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -1687,7 +1687,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1714,7 +1714,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
             catch ( LdapURLEncodingException e )
             {
@@ -1760,7 +1760,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
             catch ( DecoderException e )
             {
@@ -1797,7 +1797,7 @@
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( "An unexpected error ocurred : " + e.getMessage(), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };



Mime
View raw message