directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r901657 [1/4] - in /directory/apacheds/trunk: ./ avl-partition/ avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ core-annotations/ core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-api/...
Date Thu, 21 Jan 2010 11:27:21 GMT
Author: felixk
Date: Thu Jan 21 11:27:15 2010
New Revision: 901657

URL: http://svn.apache.org/viewvc?rev=901657&view=rev
Log:
Add I18n module for error and message translations.
I've found a lot of errors I adapted for i18n, but surely not all...
'Normal' message i18n is prepared, but none is adapted yet.
Please see the i18n module and the testcases to see, how it can be done. Both property files for translation (errors.properties, messages.propertes) is part of the i18n module. It make things easier to maintain and translate if they are in on location and not spread all over the ApacheDS project.
Errors are now defined via key (meaning a constant in the I18n class). There are already some 'free' key left for use when finding unresolved error translations ;-)

Resolving DIRSERVER-886 and DIRSERVER-506

Added:
    directory/apacheds/trunk/i18n/   (with props)
    directory/apacheds/trunk/i18n/pom.xml   (with props)
    directory/apacheds/trunk/i18n/src/
    directory/apacheds/trunk/i18n/src/main/
    directory/apacheds/trunk/i18n/src/main/java/
    directory/apacheds/trunk/i18n/src/main/java/org/
    directory/apacheds/trunk/i18n/src/main/java/org/apache/
    directory/apacheds/trunk/i18n/src/main/java/org/apache/directory/
    directory/apacheds/trunk/i18n/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/i18n/src/main/java/org/apache/directory/server/i18n/
    directory/apacheds/trunk/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/
    directory/apacheds/trunk/i18n/src/main/resources/org/
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors_de.properties   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors_fr.properties   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/messages.properties   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/messages_de.properties   (with props)
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/messages_fr.properties   (with props)
    directory/apacheds/trunk/i18n/src/site/
    directory/apacheds/trunk/i18n/src/site/site.xml   (with props)
    directory/apacheds/trunk/i18n/src/test/
    directory/apacheds/trunk/i18n/src/test/java/
    directory/apacheds/trunk/i18n/src/test/java/org/
    directory/apacheds/trunk/i18n/src/test/java/org/apache/
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/GermanLanguageTest.java   (with props)
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/InlineMessageTest.java   (with props)
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/MissingErrorCodeTest.java   (with props)
    directory/apacheds/trunk/i18n/src/test/java/org/apache/directory/server/i18n/UnknownLanguageTest.java   (with props)
    directory/apacheds/trunk/i18n/src/test/resources/
    directory/apacheds/trunk/i18n/src/test/resources/org/
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/i18n/
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/i18n/errors.properties   (with props)
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/i18n/errors_de.properties   (with props)
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/i18n/messages.properties   (with props)
    directory/apacheds/trunk/i18n/src/test/resources/org/apache/directory/server/i18n/messages_de.properties   (with props)
Modified:
    directory/apacheds/trunk/avl-partition/pom.xml
    directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
    directory/apacheds/trunk/core-annotations/pom.xml
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/trunk/core-api/pom.xml
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
    directory/apacheds/trunk/core-entry/pom.xml
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java
    directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java
    directory/apacheds/trunk/core-integ/pom.xml
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/trunk/core-jndi/pom.xml
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JndiUtils.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
    directory/apacheds/trunk/core/pom.xml
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/http-integration/pom.xml
    directory/apacheds/trunk/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
    directory/apacheds/trunk/interceptor-kerberos/pom.xml
    directory/apacheds/trunk/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
    directory/apacheds/trunk/jdbm-store/pom.xml
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStore.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java
    directory/apacheds/trunk/jdbm-store/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ServerEntrySerializer.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/RecordManagerFactory.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/btree/BPage.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/helper/WrappedRuntimeException.java
    directory/apacheds/trunk/jdbm/src/main/java/jdbm/recman/CacheRecordManager.java
    directory/apacheds/trunk/kerberos-shared/pom.xml
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/Ticket.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/AuthorizationData.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptedData.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/EncryptionKey.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddress.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/HostAddresses.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PaData.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/PrincipalName.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/TransitedEncoding.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
    directory/apacheds/trunk/ldif-partition/pom.xml
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/pom.xml
    directory/apacheds/trunk/protocol-changepw/pom.xml
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/protocol/ChangePasswordProtocolHandler.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java
    directory/apacheds/trunk/protocol-dns/pom.xml
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/DnsMessageEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/protocol/DnsProtocolHandler.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/DomainNameService.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/service/MonitorContext.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/store/jndi/MultiBaseSearch.java
    directory/apacheds/trunk/protocol-kerberos/pom.xml
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosProtocolHandler.java
    directory/apacheds/trunk/protocol-ldap/pom.xml
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ReferralAwareRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SearchResultDoneResponseHandler.java
    directory/apacheds/trunk/protocol-shared/pom.xml
    directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifFileLoader.java
    directory/apacheds/trunk/server-jndi/pom.xml
    directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/IndexCommand.java
    directory/apacheds/trunk/test-framework/pom.xml
    directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/apacheds/trunk/xdbm-tools/pom.xml
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java

Modified: directory/apacheds/trunk/avl-partition/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/pom.xml (original)
+++ directory/apacheds/trunk/avl-partition/pom.xml Thu Jan 21 11:27:15 2010
@@ -37,6 +37,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-avl</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java (original)
+++ directory/apacheds/trunk/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlStore.java Thu Jan 21 11:27:15 2010
@@ -38,6 +38,7 @@
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.entry.ServerStringValue;
 import org.apache.directory.server.core.partition.impl.btree.LongComparator;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
@@ -87,25 +88,25 @@
 
     /** the normalized distinguished name index */
     private AvlIndex<String, E> ndnIdx;
-    
+
     /** the user provided distinguished name index */
     private AvlIndex<String, E> updnIdx;
-    
+
     /** the attribute existence index */
     private AvlIndex<String, E> existenceIdx;
-    
+
     /** a system index on aliasedObjectName attribute */
     private AvlIndex<String, E> aliasIdx;
-    
+
     /** a system index on the entries of descendants of root DN*/
     private AvlIndex<Long, E> subLevelIdx;
-    
+
     /** the parent child relationship index */
     private AvlIndex<Long, E> oneLevelIdx;
-    
+
     /** the one level scope alias index */
     private AvlIndex<Long, E> oneAliasIdx;
-    
+
     /** the subtree scope alias index */
     private AvlIndex<Long, E> subAliasIdx;
 
@@ -126,7 +127,7 @@
 
     /** true if initialized */
     private boolean initialized;
-    
+
     /** A pointer on the schemaManager */
     private SchemaManager schemaManager;
 
@@ -224,9 +225,9 @@
             String msg = "Entry " + normName.getName() + " contains no entryCsn attribute: " + entry;
             throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
         }
-        
+
         entryCsnIdx.add( entryCsn.getString(), id );
-        
+
         // Update the EntryUuid index
         EntryAttribute entryUuid = entry.get( SchemaConstants.ENTRY_UUID_AT );
 
@@ -235,7 +236,7 @@
             String msg = "Entry " + normName.getName() + " contains no entryUuid attribute: " + entry;
             throw new LdapSchemaViolationException( msg, ResultCodeEnum.OBJECT_CLASS_VIOLATION );
         }
-        
+
         entryUuidIdx.add( entryUuid.getString(), id );
 
         Long tempId = parentId;
@@ -520,11 +521,11 @@
      */
     public LdapDN getSuffix()
     {
-        if( suffixDn == null )
+        if ( suffixDn == null )
         {
             return null;
         }
-        
+
         try
         {
             return new LdapDN( suffixDn.getNormName() );
@@ -544,11 +545,11 @@
      */
     public LdapDN getUpSuffix()
     {
-        if( suffixDn == null )
+        if ( suffixDn == null )
         {
             return null;
         }
-        
+
         try
         {
             return new LdapDN( suffixDn.getName() );
@@ -565,11 +566,11 @@
 
     public String getSuffixDn()
     {
-        if( suffixDn == null )
+        if ( suffixDn == null )
         {
             return null;
         }
-        
+
         return suffixDn.getName();
     }
 
@@ -585,8 +586,8 @@
         }
         catch ( NamingException e )
         {
-            LOG.error( "Failed to identify OID for: " + id, e );
-            throw new IndexNotFoundException( "Failed to identify OID for: " + id, id, e );
+            LOG.error( I18n.err( I18n.ERR_1, id ), e.getLocalizedMessage() );
+            throw new IndexNotFoundException( I18n.err( I18n.ERR_1, id ), id, e );
         }
 
         if ( systemIndices.containsKey( id ) )
@@ -594,8 +595,7 @@
             return systemIndices.get( id );
         }
 
-        throw new IndexNotFoundException( "A system index on attribute " + id + " ("
-            + name + ") does not exist!" );
+        throw new IndexNotFoundException( I18n.err( I18n.ERR_2, id, name ) );
 
     }
 
@@ -620,8 +620,8 @@
         }
         catch ( NamingException e )
         {
-            LOG.error( "Failed to identify OID for: " + id, e );
-            throw new IndexNotFoundException( "Failed to identify OID for: " + id, id, e );
+            LOG.error( I18n.err( I18n.ERR_1, id ), e.getLocalizedMessage() );
+            throw new IndexNotFoundException( I18n.err( I18n.ERR_1, id ), id, e );
         }
 
         if ( userIndices.containsKey( id ) )
@@ -629,8 +629,7 @@
             return userIndices.get( id );
         }
 
-        throw new IndexNotFoundException( "A user index on attribute " + id + " ("
-            + name + ") does not exist!" );
+        throw new IndexNotFoundException( I18n.err( I18n.ERR_3, id, name ) );
     }
 
 
@@ -694,7 +693,8 @@
 
         if ( ndnIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_N_DN_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_N_DN_AT_OID );
             ndnIdx = new AvlIndex<String, E>();
             ndnIdx.setAttributeId( ApacheSchemaConstants.APACHE_N_DN_AT_OID );
             ndnIdx.initialize( attributeType );
@@ -703,7 +703,8 @@
 
         if ( updnIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_UP_DN_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_UP_DN_AT_OID );
             updnIdx = new AvlIndex<String, E>();
             updnIdx.setAttributeId( ApacheSchemaConstants.APACHE_UP_DN_AT_OID );
             updnIdx.initialize( attributeType );
@@ -712,7 +713,8 @@
 
         if ( existenceIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID );
             existenceIdx = new AvlIndex<String, E>();
             existenceIdx.setAttributeId( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID );
             existenceIdx.initialize( attributeType );
@@ -721,7 +723,8 @@
 
         if ( oneLevelIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID );
             oneLevelIdx = new AvlIndex<Long, E>();
             oneLevelIdx.setAttributeId( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID );
             oneLevelIdx.initialize( attributeType );
@@ -730,7 +733,8 @@
 
         if ( oneAliasIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID );
             oneAliasIdx = new AvlIndex<Long, E>();
             oneAliasIdx.setAttributeId( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID );
             oneAliasIdx.initialize( attributeType );
@@ -739,7 +743,8 @@
 
         if ( subAliasIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
             subAliasIdx = new AvlIndex<Long, E>();
             subAliasIdx.setAttributeId( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
             subAliasIdx.initialize( attributeType );
@@ -748,7 +753,8 @@
 
         if ( aliasIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
             aliasIdx = new AvlIndex<String, E>();
             aliasIdx.setAttributeId( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
             aliasIdx.initialize( attributeType );
@@ -757,7 +763,8 @@
 
         if ( subLevelIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
             subLevelIdx = new AvlIndex<Long, E>();
             subLevelIdx.setAttributeId( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
             subLevelIdx.initialize( attributeType );
@@ -766,7 +773,7 @@
 
         if ( entryCsnIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_CSN_AT_OID ); 
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_CSN_AT_OID );
             entryCsnIdx = new AvlIndex<String, E>();
             entryCsnIdx.setAttributeId( SchemaConstants.ENTRY_CSN_AT_OID );
             entryCsnIdx.initialize( attributeType );
@@ -784,7 +791,8 @@
 
         if ( objectClassIdx == null )
         {
-            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT_OID );
+            AttributeType attributeType = schemaManager
+                .lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT_OID );
             objectClassIdx = new AvlIndex<String, E>();
             objectClassIdx.setAttributeId( SchemaConstants.OBJECT_CLASS_AT_OID );
             objectClassIdx.initialize( attributeType );
@@ -815,8 +823,7 @@
                 }
                 else
                 {
-                    LOG.error( "Cannot build an index for attribute '{}', no EQUALITY MatchingRule defined",
-                        attributeType.getName() );
+                    LOG.error( I18n.err( I18n.ERR_4, attributeType.getName() )   );
                 }
             }
 
@@ -1115,11 +1122,11 @@
         {
             // if the id exists in the index drop all existing attribute 
             // value index entries and add new ones
-            if( objectClassIdx.reverse( id ) )
+            if ( objectClassIdx.reverse( id ) )
             {
                 objectClassIdx.drop( id );
             }
-            
+
             for ( Value<?> value : mods )
             {
                 objectClassIdx.add( value.getString(), id );
@@ -1485,7 +1492,7 @@
         {
             this.aliasIdx = ( AvlIndex<String, E> ) convert( index );
         }
-        
+
         // FIXME is this attribute ID or its OID
         systemIndices.put( index.getAttributeId(), aliasIdx );
     }
@@ -1515,7 +1522,7 @@
         {
             this.ndnIdx = ( AvlIndex<String, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), ndnIdx );
     }
 
@@ -1534,7 +1541,7 @@
         {
             this.oneAliasIdx = ( AvlIndex<Long, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), oneAliasIdx );
     }
 
@@ -1553,7 +1560,7 @@
         {
             this.oneLevelIdx = ( AvlIndex<Long, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), oneLevelIdx );
     }
 
@@ -1600,7 +1607,7 @@
         {
             this.subAliasIdx = ( AvlIndex<Long, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), subAliasIdx );
     }
 
@@ -1619,7 +1626,7 @@
         {
             this.subLevelIdx = ( AvlIndex<Long, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), subLevelIdx );
     }
 
@@ -1655,7 +1662,7 @@
         {
             this.updnIdx = ( AvlIndex<String, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), updnIdx );
     }
 
@@ -2083,8 +2090,8 @@
     public void setEntryCsnIndex( Index<String, E> index ) throws Exception
     {
         protect( "entryCsnIndex" );
-        
-        if( index instanceof AvlIndex )
+
+        if ( index instanceof AvlIndex )
         {
             this.entryCsnIdx = ( AvlIndex<String, E> ) index;
         }
@@ -2092,7 +2099,7 @@
         {
             this.entryCsnIdx = ( AvlIndex<String, E> ) convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), entryCsnIdx );
     }
 
@@ -2131,7 +2138,7 @@
     public void setObjectClassIndex( Index<String, E> index ) throws NamingException
     {
         protect( "objectClassIndex" );
-        if( index instanceof AvlIndex )
+        if ( index instanceof AvlIndex )
         {
             this.objectClassIdx = ( AvlIndex<String, E> ) index;
         }
@@ -2139,7 +2146,7 @@
         {
             objectClassIdx = convert( index );
         }
-        
+
         systemIndices.put( index.getAttributeId(), objectClassIdx );
     }
 
@@ -2147,7 +2154,7 @@
     public void setEntryUuidIndex( Index<String, E> index ) throws NamingException
     {
         protect( "entryUuidIndex" );
-        if( index instanceof AvlIndex )
+        if ( index instanceof AvlIndex )
         {
             this.entryUuidIdx = ( AvlIndex<String, E> ) index;
         }

Modified: directory/apacheds/trunk/core-annotations/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/pom.xml (original)
+++ directory/apacheds/trunk/core-annotations/pom.xml Thu Jan 21 11:27:15 2010
@@ -25,6 +25,12 @@
 
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-jndi</artifactId>
       <version>${pom.version}</version>
     </dependency>  

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Thu Jan 21 11:27:15 2010
@@ -37,6 +37,7 @@
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
@@ -260,7 +261,7 @@
                 }
                 catch ( Exception e )
                 {
-                    LOG.error( "Cannot inject the following entry : {}. Error : {}.", ldifFile, e.getMessage() );
+                    LOG.error( I18n.err( I18n.ERR_80, ldifFile, e.getLocalizedMessage() ) );
                 }
             }
         }

Modified: directory/apacheds/trunk/core-api/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/pom.xml (original)
+++ directory/apacheds/trunk/core-api/pom.xml Thu Jan 21 11:27:15 2010
@@ -37,6 +37,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-entry</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Thu Jan 21 11:27:15 2010
@@ -36,6 +36,7 @@
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.Partition;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -379,7 +380,7 @@
      */
     public List<Entry> loadDitContentRules( Schema... schemas ) throws Exception
     {
-        LOG.error( "DitContentRule loading NYI" );
+        LOG.error( I18n.err( I18n.ERR_86 ) );
 
         return null;
     }
@@ -390,7 +391,7 @@
      */
     public List<Entry> loadDitStructureRules( Schema... schemas ) throws Exception
     {
-        LOG.error( "DitStructureRule loading NYI" );
+        LOG.error( I18n.err( I18n.ERR_87 ) );
 
         return null;
     }
@@ -438,7 +439,7 @@
      */
     public List<Entry> loadMatchingRuleUses( Schema... schemas ) throws Exception
     {
-        LOG.error( "MatchingRuleUse loading NYI" );
+        LOG.error( I18n.err( I18n.ERR_88 ) );
 
         return null;
     }
@@ -449,7 +450,7 @@
      */
     public List<Entry> loadNameForms( Schema... schemas ) throws Exception
     {
-        LOG.error( "NameForm loading NYI" );
+        LOG.error( I18n.err( I18n.ERR_89 ) );
 
         return null;
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Thu Jan 21 11:27:15 2010
@@ -50,6 +50,7 @@
 import org.apache.directory.server.core.partition.NullPartition;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.schema.registries.synchronizers.RegistrySynchronizerAdaptor;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
@@ -240,7 +241,7 @@
         }
         catch ( Exception e )
         {
-            LOG.error( "Failed to initialize wrapped partition.", e );
+            LOG.error( I18n.err( I18n.ERR_90 ), e );
             throw new RuntimeException( e );
         }
 
@@ -258,7 +259,7 @@
         }
         catch ( Exception e )
         {
-            LOG.error( "Attempt to destroy wrapped partition failed.", e );
+            LOG.error( I18n.err( I18n.ERR_91 ), e );
             throw new RuntimeException( e );
         }
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Thu Jan 21 11:27:15 2010
@@ -33,6 +33,7 @@
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -186,7 +187,7 @@
         {
             if ( opContext.getDn().size() != 3 )
             {
-                String msg = "Schema entity containers of objectClass organizationalUnit should be 3 name components in length.";
+                String msg = I18n.err( I18n.ERR_81 );
                 LOG.error( msg );
                 throw new LdapInvalidNameException( msg, ResultCodeEnum.NAMING_VIOLATION );
             }
@@ -196,14 +197,14 @@
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
             {
-                String msg = "Expecting organizationalUnit with one of the following names: " + VALID_OU_VALUES;
+                String msg = I18n.err( I18n.ERR_82, VALID_OU_VALUES );
                 LOG.error( msg );
                 throw new LdapInvalidNameException( msg, ResultCodeEnum.NAMING_VIOLATION );
             }
         }
 
         
-        String msg = "Cannot add an entry on " + opContext.getDn();
+        String msg = I18n.err( I18n.ERR_83, opContext.getDn() );
         LOG.error( msg );
         throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
     }
@@ -299,7 +300,7 @@
             return false;
         }
         
-        LOG.error( String.format( "Unwilling to perform modify on %s:\n\nEntry:\n%s\n\nModifications:\n%s", 
+        LOG.error( String.format( I18n.err( I18n.ERR_84 ), 
             opContext.getDn(), entry, opContext.getModItems() ) );
         throw new LdapOperationNotSupportedException( ResultCodeEnum.UNWILLING_TO_PERFORM );
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SchemaSynchronizer.java Thu Jan 21 11:27:15 2010
@@ -37,6 +37,7 @@
 import org.apache.directory.server.core.entry.ServerModification;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -574,7 +575,7 @@
         if ( schema == null )
         {
             // This is not possible. We can't enable a schema which is not loaded.
-            String msg = "Unwilling to enable a not loaded schema: " + schemaName;
+            String msg = I18n.err( I18n.ERR_85, schemaName );
             LOG.error( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
         }

Modified: directory/apacheds/trunk/core-entry/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/pom.xml (original)
+++ directory/apacheds/trunk/core-entry/pom.xml Thu Jan 21 11:27:15 2010
@@ -35,6 +35,14 @@
 
   <packaging>jar</packaging>
 
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+  </dependencies>
+
   <build>
     <plugins>
       <plugin>

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerAttribute.java Thu Jan 21 11:27:15 2010
@@ -27,6 +27,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.InvalidAttributeValueException;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -179,7 +180,7 @@
     {
         if ( attributeType == null ) 
         {
-            String message = "The AttributeType parameter should not be null";
+            String message = I18n.err( I18n.ERR_92 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -337,7 +338,7 @@
                 catch( NamingException ne )
                 {
                     // The value can't be normalized : we don't add it.
-                    LOG.error( "The value '" + val + "' can't be normalized, it hasn't been added" );
+                    LOG.error( I18n.err( I18n.ERR_93, val ) );
                     return 0;
                 }
                 
@@ -347,7 +348,7 @@
                 }
                 else
                 {
-                    LOG.error( "The value '" + val + "' is incorrect, it hasn't been added" );
+                    LOG.error( I18n.err( I18n.ERR_94, val ) );
                 }
             }
             
@@ -396,7 +397,7 @@
                     }
                     else
                     {
-                        LOG.error( "The value '" + val + "' is incorrect, it hasn't been added" );
+                        LOG.error( I18n.err( I18n.ERR_94, val ) );
                     }
                 }
             }
@@ -459,7 +460,7 @@
                 }
                 else
                 {
-                    String message = "The value must be a String, as its AttributeType is H/R";
+                    String message = I18n.err( I18n.ERR_95 );
                     LOG.error( message );
                 }
             }
@@ -499,7 +500,7 @@
                 }
                 else
                 {
-                    String message = "The value must be a byte[], as its AttributeType is not H/R";
+                    String message = I18n.err( I18n.ERR_96 );
                     LOG.error( message );
                 }
             }
@@ -1115,8 +1116,7 @@
                 }
                 else
                 {
-                    String message = "The upID (" + upId + ") is not an OID or is different from the AttributeType OID (" + 
-                                        attributeType.getOid() + ")";
+                    String message = I18n.err( I18n.ERR_97, upId, attributeType.getOid() );
                     // Not a valid OID : use the AttributeTypes OID name instead
                     LOG.error( message );
                     throw new IllegalArgumentException( message );

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/DefaultServerEntry.java Thu Jan 21 11:27:15 2010
@@ -30,6 +30,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.AbstractEntry;
@@ -83,7 +84,7 @@
     {
         if ( StringTools.isEmpty( StringTools.trim( upId ) ) )
         {
-            String message = "The ID should not be null or empty";
+            String message = I18n.err( I18n.ERR_98 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -103,7 +104,7 @@
         {
             if ( StringTools.isEmpty( normUpId ) )
             {
-                String message = "Cannot add an attribute without an ID";
+                String message = I18n.err( I18n.ERR_99 );
                 LOG.error( message );
                 throw new IllegalArgumentException( message );
             }
@@ -422,7 +423,7 @@
         catch ( NamingException ne )
         {
             // Just discard the AttributeType
-            LOG.error( "We have had an error while adding the '{}' AttributeType : {}", upId, ne.getMessage() );
+            LOG.error( I18n.err( I18n.ERR_100, upId, ne.getLocalizedMessage() ) );
         }
     }
     
@@ -527,7 +528,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -535,7 +536,7 @@
         // ObjectClass with binary values are not allowed
         if ( attributeType.equals( OBJECT_CLASS_AT ) )
         {
-            String message = "Only String values supported for objectClass attribute";
+            String message = I18n.err( I18n.ERR_102 );
             LOG.error(  message  );
             throw new UnsupportedOperationException( message );
         }
@@ -580,7 +581,7 @@
     {    
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -625,7 +626,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -708,7 +709,7 @@
         // ObjectClass with binary values are not allowed
         if ( attributeType.equals( OBJECT_CLASS_AT ) )
         {
-            String message = "Only String values supported for objectClass attribute";
+            String message = I18n.err( I18n.ERR_102 );
             LOG.error(  message  );
             throw new UnsupportedOperationException( message );
         }
@@ -756,7 +757,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -792,7 +793,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1183,7 +1184,7 @@
         }
         catch ( NamingException ne )
         {
-            String message = ne.getMessage();
+            String message = ne.getLocalizedMessage();
             LOG.error( message );
             return null;
         }
@@ -1401,7 +1402,7 @@
         {
             if ( serverAttribute == null )
             {
-                String message = "The ServerAttribute list should not contain null elements";
+                String message = I18n.err( I18n.ERR_103 );
                 LOG.error( message );
                 throw new IllegalArgumentException( message );
             }
@@ -1445,7 +1446,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1456,7 +1457,7 @@
         
             if ( !tempAT.equals( attributeType ) )
             {
-                String message = "The '" + upId + "' id is not compatible with the '" + attributeType + "' attribute type";
+                String message = I18n.err( I18n.ERR_104, upId, attributeType );
                 LOG.error( message );
                 throw new IllegalArgumentException( message );
             }
@@ -1468,7 +1469,7 @@
         
         if ( attributeType.equals( OBJECT_CLASS_AT ) )
         {
-            String message = "Only String values supported for objectClass attribute";
+            String message = I18n.err( I18n.ERR_102 );
             LOG.error( message );
             throw new UnsupportedOperationException( message );
         }
@@ -1511,7 +1512,7 @@
             }
             catch ( IllegalArgumentException iae )
             {
-                String message = "The attributeType should not be null";
+                String message = I18n.err( I18n.ERR_101 );
                 LOG.error( message );
                 throw new IllegalArgumentException( message );
             }
@@ -1524,7 +1525,7 @@
             
                 if ( !tempAT.equals( attributeType ) )
                 {
-                    String message = "The '" + upId + "' id is not compatible with the '" + attributeType + "' attribute type";
+                    String message = I18n.err( I18n.ERR_104, upId, attributeType );
                     LOG.error( message );
                     throw new IllegalArgumentException( message );
                 }
@@ -1567,7 +1568,7 @@
     {
         if ( attributeType == null )
         {
-            String message = "The attributeType should not be null";
+            String message = I18n.err( I18n.ERR_101 );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1578,7 +1579,7 @@
         
             if ( !tempAT.equals( attributeType ) )
             {
-                String message = "The '" + upId + "' id is not compatible with the '" + attributeType + "' attribute type";
+                String message = I18n.err( I18n.ERR_104, upId, attributeType );
                 LOG.error( message );
                 throw new IllegalArgumentException( message );
             }
@@ -1617,8 +1618,7 @@
         }
         catch ( NamingException ne )
         {
-            String message = "Error while adding values into the '" + upId + "' attribute. Error : " + 
-                ne.getMessage();
+            String message = I18n.err( I18n.ERR_105, upId, ne.getLocalizedMessage() );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1650,8 +1650,7 @@
         }
         catch ( NamingException ne )
         {
-            String message = "Error while adding values into the '" + upId + "' attribute. Error : " + 
-                ne.getMessage();
+            String message = I18n.err( I18n.ERR_105, upId, ne.getLocalizedMessage() );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1682,8 +1681,7 @@
         }
         catch ( NamingException ne )
         {
-            String message = "Error while adding values into the '" + upId + "' attribute. Error : " + 
-                ne.getMessage();
+            String message = I18n.err( I18n.ERR_105, upId, ne.getLocalizedMessage() );
             LOG.error( message );
             throw new IllegalArgumentException( message );
         }
@@ -1749,7 +1747,7 @@
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", attributeType );
+            LOG.error( I18n.err( I18n.ERR_106, attributeType ) );
             return false;
         }
     }
@@ -1814,7 +1812,7 @@
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", attributeType );
+            LOG.error( I18n.err( I18n.ERR_106, attributeType ) );
             return false;
         }
     }
@@ -1879,7 +1877,7 @@
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", attributeType );
+            LOG.error( I18n.err( I18n.ERR_106, attributeType ) );
             return false;
         }
     }
@@ -1933,12 +1931,12 @@
         }
         catch ( NamingException ne )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_106, upId ) );
             return false;
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the bad '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_107, upId ) );
             return false;
         }
     }
@@ -1975,12 +1973,12 @@
         }
         catch ( NamingException ne )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_106, upId ) );
             return false;
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the bad '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_107, upId ) );
             return false;
         }
     }
@@ -2017,12 +2015,12 @@
         }
         catch ( NamingException ne )
         {
-            LOG.error( "The removal of values for the missing '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_106, upId ) );
             return false;
         }
         catch ( IllegalArgumentException iae )
         {
-            LOG.error( "The removal of values for the bad '{}' attribute is not possible", upId );
+            LOG.error( I18n.err( I18n.ERR_107, upId ) );
             return false;
         }
     }
@@ -2153,7 +2151,7 @@
         {
             if ( attributeType == null )
             {
-                String message = "The AttributeType list should not contain null values";
+                String message = I18n.err( I18n.ERR_108 );
                 LOG.error( message );
                 continue;
             }
@@ -2205,12 +2203,12 @@
             }
             catch ( NamingException ne )
             {
-                LOG.warn( "Trying to add a bad attribute type '{}', error : ", upId, ne.getMessage() );
+                LOG.warn( "Trying to add a bad attribute type '{}', error : ", upId, ne.getLocalizedMessage() );
                 continue;
             }
             catch ( IllegalArgumentException iae )
             {
-                LOG.warn( "Trying to add a bad attribute type '{}', error : ", upId, iae.getMessage() );
+                LOG.warn( "Trying to add a bad attribute type '{}', error : ", upId, iae.getLocalizedMessage() );
                 continue;
             }
             

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java Thu Jan 21 11:27:15 2010
@@ -28,6 +28,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
@@ -226,7 +227,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the value :" + ne.getMessage();
+                String message = "Cannot normalize the value :" + ne.getLocalizedMessage();
                 LOG.warn( message );
                 normalized = false;
             }
@@ -261,7 +262,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the value :" + ne.getMessage();
+                String message = "Cannot normalize the value :" + ne.getLocalizedMessage();
                 LOG.warn( message );
                 normalized = false;
             }
@@ -294,7 +295,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the value :" + ne.getMessage();
+                String message = "Cannot normalize the value :" + ne.getLocalizedMessage();
                 LOG.warn( message );
                 normalized = false;
             }
@@ -383,15 +384,13 @@
             }
             catch ( NamingException e )
             {
-                String msg = "Failed to compare normalized values for " + Arrays.toString( getReference() ) + " and "
-                    + value;
+                String msg = I18n.err( I18n.ERR_109, Arrays.toString( getReference() ), value );
                 LOG.error( msg, e );
                 throw new IllegalStateException( msg, e );
             }
         }
 
-        String message = "I don't really know how to compare anything other "
-            + "than ServerBinaryValues at this point in time.";
+        String message = I18n.err( I18n.ERR_110 );
         LOG.error( message );
         throw new NotImplementedException( message );
     }

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerEntryUtils.java Thu Jan 21 11:27:15 2010
@@ -225,7 +225,7 @@
             }
             catch ( NamingException ne )
             {
-                throw new InvalidAttributeIdentifierException( ne.getMessage() );
+                throw new InvalidAttributeIdentifierException( ne.getLocalizedMessage() );
             }
         }
         else

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerModification.java Thu Jan 21 11:27:15 2010
@@ -25,6 +25,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
@@ -103,7 +104,7 @@
         catch ( NamingException ne )
         {
             // The attributeType is incorrect. Log, but do nothing otherwise.
-            LOG.error( "The attribute '" + modAttribute.getId() + "' is incorrect" );
+            LOG.error( I18n.err( I18n.ERR_111, modAttribute.getId() ) );
         }
     }
     

Modified: directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java (original)
+++ directory/apacheds/trunk/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerStringValue.java Thu Jan 21 11:27:15 2010
@@ -26,6 +26,7 @@
 
 import javax.naming.NamingException;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
@@ -229,7 +230,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the value :" + ne.getMessage();
+                String message = "Cannot normalize the value :" + ne.getLocalizedMessage();
                 LOG.warn( message );
                 normalized = false;
             }
@@ -295,7 +296,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the wrapped value " + stringValue; 
+                String message = I18n.err( I18n.ERR_112, stringValue ); 
                 LOG.error( message );
             }
             
@@ -306,7 +307,7 @@
             }
             catch ( NamingException ne )
             {
-                String message = "Cannot normalize the wrapped value " + this;
+                String message = I18n.err( I18n.ERR_112, this );
                 LOG.error( message );
             }
 
@@ -317,13 +318,13 @@
             }
             catch ( NamingException e )
             {
-                String msg = "Failed to compare normalized values for " + this + " and " + value;
+                String msg = I18n.err( I18n.ERR_113, this, value );
                 LOG.error( msg, e );
                 throw new IllegalStateException( msg, e );
             }
         }
 
-        String message = "I don't know what to do if value is not a ServerStringValue";
+        String message = I18n.err( I18n.ERR_114 );
         LOG.error( message );
         throw new NotImplementedException( message );
     }

Modified: directory/apacheds/trunk/core-integ/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/pom.xml (original)
+++ directory/apacheds/trunk/core-integ/pom.xml Thu Jan 21 11:27:15 2010
@@ -36,6 +36,12 @@
 
   <dependencies>
     <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>  
+
+    <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <scope>provided</scope>

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java (original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java Thu Jan 21 11:27:15 2010
@@ -38,6 +38,7 @@
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.entry.DefaultServerEntry;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -80,12 +81,12 @@
             }
             catch ( IOException e )
             {
-                LOG.error( "Failed to delete the working directory.", e );
+                LOG.error( I18n.err( I18n.ERR_115 ), e );
             }
         }
         if ( wkdir.exists() )
         {
-            throw new IOException( "Failed to delete: " + wkdir );
+            throw new IOException( I18n.err( I18n.ERR_116, wkdir ) );
         }
     }
 
@@ -117,8 +118,7 @@
             }
             else
             {
-                String message = "Unsupported changetype found in LDIF: " + 
-                    entry.getChangeType();
+                String message = I18n.err( I18n.ERR_117, entry.getChangeType() );
                 LOG.error( message );
                 throw new NamingException( message );
             }

Modified: directory/apacheds/trunk/core-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/pom.xml (original)
+++ directory/apacheds/trunk/core-jndi/pom.xml Thu Jan 21 11:27:15 2010
@@ -41,6 +41,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/EventListenerAdapter.java Thu Jan 21 11:27:15 2010
@@ -38,6 +38,7 @@
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.i18n.I18n;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -92,7 +93,7 @@
     
     private void deliverNamingExceptionEvent( Exception e, OperationContext opContext )
     {
-        LOG.error( "Error encountered while delivering notifications.", e );
+        LOG.error( I18n.err( I18n.ERR_118 ), e );
         NamingExceptionEvent evt = null;
         
         if ( e instanceof NamingException )
@@ -101,7 +102,7 @@
         }
         else
         {
-            NamingException ne = new NamingException( "Encountered exception during event handling." );
+            NamingException ne = new NamingException( I18n.err( I18n.ERR_119 ) );
             ne.setRootCause( e );
             evt = new NamingExceptionEvent( source, ne );
         }

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JavaLdapSupport.java Thu Jan 21 11:27:15 2010
@@ -93,7 +93,7 @@
         catch ( Exception e )
         {
             NamingException ne = new NamingException( "De-serialization of '" + className + "' instance failed:\n"
-                + e.getMessage() );
+                + e.getLocalizedMessage() );
             ne.setRootCause( e );
             throw ne;
         }
@@ -135,7 +135,7 @@
         }
         catch ( Exception e )
         {
-            NamingException ne = new NamingException( "Serialization of '" + obj + "' failed:\n" + e.getMessage() );
+            NamingException ne = new NamingException( "Serialization of '" + obj + "' failed:\n" + e.getLocalizedMessage() );
             ne.setRootCause( e );
             throw ne;
         }

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JndiUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JndiUtils.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JndiUtils.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/JndiUtils.java Thu Jan 21 11:27:15 2010
@@ -37,7 +37,7 @@
             throw ( NamingException ) t;
         }
         
-        NamingException ne = new NamingException( t.getMessage() );
+        NamingException ne = new NamingException( t.getLocalizedMessage() );
         ne.setRootCause( t );
         throw ne;
     }

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/NamingEnumerationAdapter.java Thu Jan 21 11:27:15 2010
@@ -143,7 +143,7 @@
         }
         catch ( NamingException e )
         {
-            throw new NoSuchElementException( e.getMessage() );
+            throw new NoSuchElementException( e.getLocalizedMessage() );
         }
     }
 }

Modified: directory/apacheds/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/pom.xml?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core/pom.xml (original)
+++ directory/apacheds/trunk/core/pom.xml Thu Jan 21 11:27:15 2010
@@ -39,6 +39,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-core-api</artifactId>
       <version>${pom.version}</version>
     </dependency>

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Jan 21 11:27:15 2010
@@ -74,6 +74,7 @@
 import org.apache.directory.server.core.security.TlsKeyGenerator;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -268,7 +269,7 @@
                 }
                 catch ( Exception e )
                 {
-                    LOG.error( "SynchWorker failed to synch directory.", e );
+                    LOG.error( I18n.err( I18n.ERR_74 ), e );
                 }
             }
         }
@@ -844,17 +845,15 @@
                             break;
                             
                         default:
-                            LOG.error( "ChangeType unknown" );
-                            throw new NotImplementedException( "Reverts of change type " + reverse.getChangeType()
-                                    + " has not yet been implemented!");
+                            LOG.error( I18n.err( I18n.ERR_75 ) );
+                            throw new NotImplementedException( I18n.err( I18n.ERR_76, reverse.getChangeType() ) );
                     }
                 }
             }
         }
         catch ( IOException e )
         {
-            String message = "Encountered a failure while trying to revert to a previous revision: "
-                + revision;
+            String message = I18n.err( I18n.ERR_77, revision );
             LOG.error( message );
             throw new NamingException( message );
         }
@@ -1566,7 +1565,7 @@
         }
         catch ( Exception e )
         {
-            LOG.error( "Cannot build an entry for '{}' and this DN :'{}'", ldif, dn );
+            LOG.error( I18n.err( I18n.ERR_78, ldif, dn ) );
             // do nothing
             return null;
         }
@@ -1671,7 +1670,7 @@
     {
         if ( ( replicaId < 0 ) || ( replicaId > 999 ) )
         {
-            LOG.error( "The replicaId must be in [0, 999]" );
+            LOG.error( I18n.err( I18n.ERR_79 ) );
             this.replicaId = 0;
         }
         else

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Thu Jan 21 11:27:15 2010
@@ -53,6 +53,7 @@
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
@@ -416,8 +417,8 @@
         if ( operation.getSession().isAnonymous() && !directoryService.isAllowAnonymousAccess() 
             && !operation.getDn().isEmpty() )
         {
-            LOG.error( "Attempted operation {} by unauthenticated caller.", operation.getName() );
-            throw new LdapNoPermissionException( "Attempted operation by unauthenticated caller." );
+            LOG.error( I18n.err( I18n.ERR_5, operation.getName() ) );
+            throw new LdapNoPermissionException( I18n.err( I18n.ERR_5, operation.getName() ) );
         }
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Thu Jan 21 11:27:15 2010
@@ -48,6 +48,7 @@
 import org.apache.directory.server.core.schema.SchemaInterceptor;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
 import org.apache.directory.server.core.trigger.TriggerInterceptor;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.LdapSecurityConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -612,8 +613,8 @@
         }
         catch ( Exception cause )
         {
-            LOG.error( "Authentication error : " + cause.getMessage() );
-            LdapAuthenticationException e = new LdapAuthenticationException( cause.getMessage() );
+            LOG.error( I18n.err( I18n.ERR_6, cause.getLocalizedMessage() ) );
+            LdapAuthenticationException e = new LdapAuthenticationException( cause.getLocalizedMessage() );
             e.setRootCause( e );
             throw e;
         }
@@ -723,8 +724,8 @@
         }
         catch ( NoSuchAlgorithmException nsae )
         {
-            LOG.error( "Cannot create a digested password for algorithm '{}'", algorithm );
-            throw new IllegalArgumentException( nsae.getMessage() );
+            LOG.error( I18n.err( I18n.ERR_7, algorithm ) );
+            throw new IllegalArgumentException( nsae.getLocalizedMessage() );
         }
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=901657&r1=901656&r2=901657&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Thu Jan 21 11:27:15 2010
@@ -61,6 +61,7 @@
 import org.apache.directory.server.core.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.server.core.subtree.SubentryInterceptor;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.aci.ACIItem;
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
 import org.apache.directory.shared.ldap.aci.ACITuple;
@@ -233,17 +234,14 @@
 
         if ( dn.isEmpty() )
         {
-            String msg = "The rootDSE cannot be deleted, moved or renamed!";
+            String msg = I18n.err( I18n.ERR_8 );
             LOG.error( msg );
             throw new LdapNoPermissionException( msg );
         }
 
         if ( isTheAdministrator( dn ) )
         {
-            String msg = "User '" + principalDn.getName();
-            msg += "' does not have permission to move or rename the admin";
-            msg += " account.  No one not even the admin can del, move or";
-            msg += " rename " + dn.getName() + "!";
+            String msg = I18n.err( I18n.ERR_9, principalDn.getName(), dn.getName() );
             LOG.error( msg );
             throw new LdapNoPermissionException( msg );
         }
@@ -337,7 +335,7 @@
             }
             catch ( ParseException e )
             {
-                String msg = "failed to parse entryACI: " + aciString;
+                String msg = I18n.err( I18n.ERR_10, aciString );
                 LOG.error( msg, e );
                 throw new LdapNamingException( msg, ResultCodeEnum.OPERATIONS_ERROR );
             }
@@ -390,7 +388,7 @@
             }
             catch ( ParseException e )
             {
-                String msg = "failed to parse subentryACI: " + aciString;
+                String msg = I18n.err( I18n.ERR_11, aciString );
                 LOG.error( msg, e );
                 throw new LdapNamingException( msg, ResultCodeEnum.OPERATIONS_ERROR );
             }



Mime
View raw message