You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2010/01/22 22:43:45 UTC

svn commit: r902289 - in /directory/apacheds/trunk: core-mock/src/main/java/org/apache/directory/server/core/ default-config/src/main/java/org/apache/directory/server/config/ i18n/src/main/resources/org/apache/directory/server/i18n/

Author: felixk
Date: Fri Jan 22 21:43:45 2010
New Revision: 902289

URL: http://svn.apache.org/viewvc?rev=902289&view=rev
Log:
I18n

Modified:
    directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/LdifConfigExtractor.java
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties

Modified: directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java?rev=902289&r1=902288&r2=902289&view=diff
==============================================================================
--- directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java (original)
+++ directory/apacheds/trunk/core-mock/src/main/java/org/apache/directory/server/core/MockCoreSession.java Fri Jan 22 21:43:45 2010
@@ -50,6 +50,7 @@
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.Value;
@@ -203,7 +204,7 @@
             }
             else
             {
-                throw new NamingException( "Bad value for the OID " + oid );
+                throw new NamingException( I18n.err( I18n.ERR_502, oid ) );
             }
         }
         else
@@ -218,7 +219,7 @@
             }
             else
             {
-                throw new NamingException( "Bad value for the OID " + oid );
+                throw new NamingException( I18n.err( I18n.ERR_502, oid ) );
             }
         }
         

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=902289&r1=902288&r2=902289&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Fri Jan 22 21:43:45 2010
@@ -54,6 +54,7 @@
 import org.apache.directory.server.dhcp.store.DhcpStore;
 import org.apache.directory.server.dhcp.store.SimpleDhcpStore;
 import org.apache.directory.server.dns.DnsServer;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.integration.http.HttpServer;
 import org.apache.directory.server.integration.http.WebApp;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
@@ -131,12 +132,12 @@
     {
         if ( configPartition == null )
         {
-            throw new IllegalArgumentException( "Config partition cannot be null" );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_503 ) );
         }
 
         if ( !configPartition.isInitialized() )
         {
-            throw new IllegalStateException( "the config partition is not initialized" );
+            throw new IllegalStateException( I18n.err( I18n.ERR_504 ) );
         }
 
         this.configPartition = configPartition;
@@ -549,7 +550,7 @@
         
         if ( systemPartition == null )
         {
-            throw new Exception( "system partition doesn't exist" );
+            throw new Exception( I18n.err( I18n.ERR_505 ) );
         }
 
         dirService.setSystemPartition( systemPartition );
@@ -722,7 +723,7 @@
             }
             else
             {
-                throw new NotImplementedException( "yet to implement" );
+                throw new NotImplementedException( I18n.err( I18n.ERR_506 ) );
             }
         }
         
@@ -799,7 +800,7 @@
             }
             else
             {
-                throw new NotImplementedException( "yet to implement" );
+                throw new NotImplementedException( I18n.err( I18n.ERR_506 ) );
             }
         }
         
@@ -1045,7 +1046,7 @@
         {
             if ( order < 1 )
             {
-                throw new IllegalArgumentException( "Invalid interceptor order" );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_507 ) );
             }
             
             this.id = id;

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/LdifConfigExtractor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/LdifConfigExtractor.java?rev=902289&r1=902288&r2=902289&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/LdifConfigExtractor.java (original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/LdifConfigExtractor.java Fri Jan 22 21:43:45 2010
@@ -34,6 +34,7 @@
 import java.util.Map.Entry;
 import java.util.regex.Pattern;
 
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.ResourceMap;
 import org.slf4j.Logger;
@@ -80,8 +81,7 @@
         }
         else if ( !overwrite )
         {
-            throw new IOException( "Cannot overwrite, config output directory already exists: "
-                + configDirectory.getAbsolutePath() );
+            throw new IOException( I18n.err( I18n.ERR_508, configDirectory.getAbsolutePath() ) );
         }
 
         LOG.info( "extracting the configuration to the directory at {}", configDirectory.getAbsolutePath() );
@@ -125,8 +125,7 @@
         
         if ( ! source.getParentFile().exists() )
         {
-            throw new FileNotFoundException( "Cannot copy non-existant " +
-                    "source file " + source.getAbsolutePath() );
+            throw new FileNotFoundException( I18n.err( I18n.ERR_509, source.getAbsolutePath() ) );
         }
         
         FileWriter out = new FileWriter( destination );
@@ -222,14 +221,13 @@
             if ( parent.equals( parent.getParentFile() )
                     || parent.getParentFile() == null )
             {
-                throw new IllegalStateException( 
-                    "Should not be hitting root without config/config pattern." );
+                throw new IllegalStateException( I18n.err( I18n.ERR_510 ) );
             }
             
             parent = parent.getParentFile();
         }
 
-        throw new IllegalStateException( "parent cannot be null" );
+        throw new IllegalStateException( I18n.err( I18n.ERR_511 ) );
     }
 
     /**

Modified: directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties?rev=902289&r1=902288&r2=902289&view=diff
==============================================================================
--- directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties (original)
+++ directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties Fri Jan 22 21:43:45 2010
@@ -500,9 +500,9 @@
 ERR_476=Unidentified change type value: {0}
 ERR_477=Cannot find directory service in environment: {0}
 ERR_478=Can't convert '{0}' to byte[].
-ERR_479=De-serialization of '{0}' instance failed:\n{1}
+ERR_479=De-serialization of '{0}' instance failed\:\n{1}
 ERR_480=object deserialization stream close() failure
-ERR_481=Serialization of '{0}' failed:\n{1}
+ERR_481=Serialization of '{0}' failed\:\n{1}
 ERR_482=object serialization stream close() failure
 ERR_483=Don't know how to interpret {0} objects for environment property {1}
 ERR_484=Expected property {0} but could not find it in env!
@@ -524,15 +524,15 @@
 ERR_500=Encountered parse exception while parsing the filter: '{0}'
 ERR_501=could not parse filter: {0}
 ERR_502=Bad value for the OID {0}
-ERR_503=
-ERR_504=
-ERR_505=
-ERR_506=
-ERR_507=
-ERR_508=
-ERR_509=
-ERR_510=
-ERR_511=
+ERR_503=Config partition cannot be null
+ERR_504=the config partition is not initialized
+ERR_505=system partition doesn't exist
+ERR_506=yet to implement
+ERR_507=Invalid interceptor order
+ERR_508=Cannot overwrite, config output directory already exists: {0}
+ERR_509=Cannot copy non-existant source file {0}
+ERR_510=Should not be hitting root without config/config pattern.
+ERR_511=parent cannot be null
 ERR_512=
 ERR_513=
 ERR_514=