directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r901905 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/apache/directory/server/cor...
Date Thu, 21 Jan 2010 22:49:22 GMT
Author: felixk
Date: Thu Jan 21 22:49:21 2010
New Revision: 901905

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

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.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-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
    directory/apacheds/trunk/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Thu Jan 21 22:49:21 2010
@@ -55,6 +55,7 @@
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
@@ -268,7 +269,7 @@
             }
             else
             {
-                throw new InterceptorException( null, "Failed to initialize interceptor chain.", t );
+                throw new InterceptorException( null, I18n.err( I18n.ERR_329 ), t );
             }
         }
     }
@@ -361,7 +362,7 @@
         Entry e = name2entry.get( nextInterceptorName );
         if ( e == null )
         {
-            throw new ConfigurationException( "Interceptor not found: " + nextInterceptorName );
+            throw new ConfigurationException( I18n.err( I18n.ERR_330, nextInterceptorName ) );
         }
         register0( interceptor, e );
     }
@@ -379,7 +380,7 @@
         Entry e = name2entry.get( prevInterceptorName );
         if ( e == null )
         {
-            throw new ConfigurationException( "Interceptor not found: " + prevInterceptorName );
+            throw new ConfigurationException( I18n.err( I18n.ERR_330, prevInterceptorName ) );
         }
         register0( interceptor, e.nextEntry );
     }
@@ -476,7 +477,7 @@
 
         if ( e == null )
         {
-            throw new ConfigurationException( "Unknown interceptor name:" + name );
+            throw new ConfigurationException( I18n.err( I18n.ERR_331, name ) );
         }
 
         return e;
@@ -492,7 +493,7 @@
     {
         if ( name2entry.containsKey( interceptor.getName() ) )
         {
-            throw new ConfigurationException( "Other interceptor is using name '" + interceptor.getName() + "'" );
+            throw new ConfigurationException( I18n.err( I18n.ERR_332, interceptor.getName() ) );
         }
     }
 
@@ -1459,6 +1460,6 @@
 
     private static void throwInterceptorException( Interceptor interceptor, Throwable e ) throws InterceptorException
     {
-        throw new InterceptorException( interceptor, "Unexpected exception.", e );
+        throw new InterceptorException( interceptor, I18n.err( I18n.ERR_333 ), e );
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java Thu Jan 21 22:49:21 2010
@@ -32,6 +32,7 @@
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
@@ -332,7 +333,7 @@
     {
         if ( opContext != next )
         {
-            throw new IllegalStateException( "Cannot execute indirect lookup if it is not the next operation." );
+            throw new IllegalStateException( I18n.err( I18n.ERR_319 ) );
         }
         return session.getDirectoryService().getOperationManager().lookup( opContext );
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java Thu Jan 21 22:49:21 2010
@@ -34,6 +34,7 @@
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
+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.message.MessageTypeEnum;
@@ -524,7 +525,7 @@
      */
     public void throwReferral()
     {
-        throw new NotImplementedException( " The throwReferral method is not implemented for a Bind operation" );
+        throw new NotImplementedException( I18n.err( I18n.ERR_320 ) );
     }
     
     
@@ -533,7 +534,7 @@
      */
     public boolean isReferralThrown()
     {
-        throw new NotImplementedException( " The isReferralThrown method is not implemented for a Bind operation" );
+        throw new NotImplementedException( I18n.err( I18n.ERR_321 ) );
     }
 
 
@@ -542,7 +543,7 @@
      */
     public void ignoreReferral()
     {
-        throw new NotImplementedException( " The ignoreReferral method is not implemented for a Bind operation" );
+        throw new NotImplementedException( I18n.err( I18n.ERR_322 ) );
     }
 
 
@@ -551,6 +552,6 @@
      */
     public boolean isReferralIgnored()
     {
-        throw new NotImplementedException( " The isReferralIgnored method is not implemented for a Bind operation" );
+        throw new NotImplementedException( I18n.err( I18n.ERR_323 ) );
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java Thu Jan 21 22:49:21 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -54,8 +55,7 @@
             return;
         }
         
-        throw new UnsupportedOperationException( 
-            "Cannot set the empty operation context to anything other than the EmptyDN" );
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_324 ) );
     }
 
     

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java Thu Jan 21 22:49:21 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.message.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.message.control.ManageDsaITControl;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -74,7 +75,7 @@
         
         if ( parent == null )
         {
-            throw new IllegalStateException( "NewSuperior must not be null: " + modifyDnRequest );
+            throw new IllegalStateException( I18n.err( I18n.ERR_325, modifyDnRequest ) );
         }
         
         if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java Thu Jan 21 22:49:21 2010
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.message.control.ManageDsaITControl;
@@ -66,14 +67,14 @@
         
         if ( parent == null )
         {
-            throw new IllegalArgumentException( "The new superior cannot be null for " + modifyDnRequest );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_326, modifyDnRequest ) );
         }
         
         this.requestControls = modifyDnRequest.getControls();
         
         if ( modifyDnRequest.getNewRdn() != null )
         {
-            throw new IllegalArgumentException( modifyDnRequest + " represents a move and rename operation." );
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_327, modifyDnRequest ) );
         }
         
         if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java Thu Jan 21 22:49:21 2010
@@ -22,6 +22,7 @@
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.message.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.control.ManageDsaITControl;
@@ -84,7 +85,7 @@
         
         if ( newRdn == null )
         {
-            throw new IllegalStateException( "newRdn must not be null for a rename: " + modifyDnRequest );
+            throw new IllegalStateException( I18n.err( I18n.ERR_328, modifyDnRequest ) );
         }
         
         this.delOldDn = modifyDnRequest.getDeleteOldRdn();

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java Thu Jan 21 22:49:21 2010
@@ -29,6 +29,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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;
@@ -152,7 +153,7 @@
     {
         if ( dn.size() < 2 )
         {
-            throw new NamingException( "At least two name components are expected for the dn" );
+            throw new NamingException( I18n.err( I18n.ERR_334 ) );
         }
         
         RDN rdn = dn.getRdn( 1 );
@@ -166,7 +167,7 @@
 
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema entity is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_335, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -186,7 +187,7 @@
         }
         else
         {
-            throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity does not exist.",
+            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_336, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -199,24 +200,20 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a attributeType should be at most 3 name components in length.", 
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_337 ), ResultCodeEnum.NAMING_VIOLATION );
         }
         
         RDN rdn = newParent.getRdn();
         
         if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a " + objectType + " should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_338, objectType ), 
                 ResultCodeEnum.NAMING_VIOLATION );
         }
         
         if ( ! ( ( String ) rdn.getNormValue() ).equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get( objectType ) ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a " + objectType + " should have a relative name of ou=" + 
-                OBJECT_TYPE_TO_PATH.get( objectType ) + ".", 
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_339, objectType,  OBJECT_TYPE_TO_PATH.get( objectType ) ), 
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }
@@ -227,7 +224,7 @@
 
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity is not unique.",
+            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_340, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -237,7 +234,7 @@
     {
         if ( schemaManager.getGlobalOidRegistry().contains( oid ) )
         {
-            throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity is not unique.",
+            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_340, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -264,8 +261,7 @@
             
             if ( schemaObjects.contains( schemaObjectWrapper ) )
             {
-                String msg = "Cannot inject " + schemaObject.getName() + " into " + schemaName + 
-                " as this schema already contains this element";
+                String msg = I18n.err( I18n.ERR_341, schemaObject.getName(), schemaName );
                 LOG.warn( msg );
             
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
@@ -276,8 +272,7 @@
         }
         else
         {
-            String msg = "Cannot inject " + schemaObject.getName() + " into " + schemaName + 
-            " as this schema is not loaded";
+            String msg = I18n.err( I18n.ERR_342, schemaObject.getName(), schemaName );
             LOG.warn( msg );
         
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
@@ -301,8 +296,7 @@
             
             if ( !schemaObjects.contains( schemaObjectWrapper ) )
             {
-                String msg = "Cannot remove " + schemaObject.getName() + " from " + schemaName + 
-                " as this schema does not contain this element";
+                String msg = I18n.err( I18n.ERR_343, schemaObject.getName(), schemaName );
                 LOG.warn( msg );
             
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
@@ -313,8 +307,7 @@
         }
         else
         {
-            String msg = "Cannot inject " + schemaObject.getName() + " into " + schemaName + 
-            " as this schema is not loaded";
+            String msg = I18n.err( I18n.ERR_344, schemaObject.getName(), schemaName );
             LOG.warn( msg );
         
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -22,6 +22,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapOperationNotSupportedException;
@@ -96,9 +97,7 @@
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the AttributeType " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_345, entry.getDn().getName(), StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -178,9 +177,8 @@
             else
             {
                 // We have some error : reject the deletion and get out
-                String msg = "Cannot delete the AttributeType " + entry.getDn().getName() + " from the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_346, entry.getDn().getName(), 
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -221,8 +219,7 @@
             // Check that the entry has no descendant
             if ( schemaManager.getAttributeTypeRegistry().hasDescendants( oldAt.getOid() ) )
             {
-                String msg = "Cannot rename " + entry.getDn().getName() + " to " + newDn
-                    + " as the later has descendants' AttributeTypes";
+                String msg = I18n.err( I18n.ERR_347, entry.getDn().getName(), newDn );
 
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -255,14 +252,14 @@
 
         if ( !isSchemaLoaded( oldSchemaName ) )
         {
-            String msg = "Cannot move a schemaObject from a not loaded schema " + oldSchemaName;
+            String msg = I18n.err( I18n.ERR_348, oldSchemaName );
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         if ( !isSchemaLoaded( newSchemaName ) )
         {
-            String msg = "Cannot move a schemaObject to a not loaded schema " + newSchemaName;
+            String msg = I18n.err( I18n.ERR_349, newSchemaName );
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
@@ -309,7 +306,7 @@
 
         if ( !isSchemaLoaded( newSchemaName ) )
         {
-            String msg = "Cannot move a schemaObject to a not loaded schema " + newSchemaName;
+            String msg = I18n.err( I18n.ERR_349, newSchemaName );
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -27,6 +27,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapInvalidNameException;
@@ -131,9 +132,8 @@
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the Comparator " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_350, entry.getDn().getName(), StringTools.listToString( 
+                    schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -194,8 +194,7 @@
             else
             {
                 // Ok, definitively an error
-                String msg = "Cannot delete the Comparator " + entry.getDn().getName() + " as it "
-                    + "does not exist in any schema";
+                String msg = I18n.err( I18n.ERR_351, entry.getDn().getName() );
                 LOG.info( msg );
                 throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -211,8 +210,8 @@
             }
             else
             {
-                String msg = "Cannot delete the Comparator " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = I18n.err( I18n.ERR_352, entry.getDn().getName(), StringTools.listToString( 
+                    errors ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -233,9 +232,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException(
-                "The comparator with OID " + oldOid + " cannot have it's OID changed until all "
-                    + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_353, oldOid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -274,9 +272,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException(
-                "The comparator with OID " + oldOid + " cannot have it's OID changed until all "
-                    + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_353, oldOid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -308,9 +305,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The comparator with OID " + oid
-                + " cannot be moved to another schema until all "
-                + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_354, oid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String newSchemaName = getSchemaName( newParentName );
@@ -336,7 +332,7 @@
     {
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_355, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -348,7 +344,7 @@
 
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_355, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -368,7 +364,7 @@
         }
         else
         {
-            throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity does not exist.",
+            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_356, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -378,8 +374,7 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException(
-                "The parent dn of a comparator should be at most 3 name components in length.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_357 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
@@ -388,15 +383,12 @@
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a comparator should be an organizationalUnit.",
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_358 ), ResultCodeEnum.NAMING_VIOLATION );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
         {
-            throw new LdapInvalidNameException(
-                "The parent entry of a comparator should have a relative name of ou=comparators.",
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_359 ), ResultCodeEnum.NAMING_VIOLATION );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -24,6 +24,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapInvalidNameException;
@@ -127,9 +128,8 @@
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the MatchingRule " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_360, entry.getDn().getName(), 
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -181,9 +181,8 @@
             {
                 // We have some error : reject the deletion and get out
                 // The schema is disabled. We still have to update the backend
-                String msg = "Cannot delete the MatchingRule " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_360, entry.getDn().getName(), 
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -293,8 +292,7 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException(
-                "The parent dn of a matchingRule should be at most 3 name components in length.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_361 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
@@ -303,14 +301,13 @@
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a matchingRule should be an organizationalUnit.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_362 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
         {
-            throw new LdapInvalidNameException(
-                "The parent entry of a syntax should have a relative name of ou=matchingRules.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_363 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -27,6 +27,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapInvalidNameException;
@@ -128,8 +129,8 @@
             }
             else
             {
-                String msg = "Cannot delete the Normalizer " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = I18n.err( I18n.ERR_364, entry.getDn().getName(), 
+                    StringTools.listToString( errors ) );
                 LOG.info( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -141,8 +142,8 @@
 
             if ( !errors.isEmpty() )
             {
-                String msg = "Cannot add the Normalizer " + entry.getDn().getName() + " into the registries, "
-                    + "we have got some errors :" + StringTools.listToString( errors );
+                String msg = I18n.err( I18n.ERR_365, entry.getDn().getName(),
+                    StringTools.listToString( errors ) );
 
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -174,8 +175,7 @@
         {
             if ( schemaManager.getRegistries().isReferenced( normalizer ) )
             {
-                String msg = "Cannot delete " + entry.getDn().getName() + ", as there are some "
-                    + " dependant SchemaObjects :\n" + getReferenced( normalizer );
+                String msg = I18n.err( I18n.ERR_366, entry.getDn().getName(), getReferenced( normalizer ) );
                 LOG.warn( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -207,9 +207,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException(
-                "The normalizer with OID " + oldOid + " cannot have it's OID changed until all "
-                    + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_367, oldOid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String newOid = ( String ) newRdn.getNormValue();
@@ -245,9 +244,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException(
-                "The normalizer with OID " + oldOid + " cannot have it's OID changed until all "
-                    + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_367, oldOid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getNormValue();
@@ -276,9 +274,8 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The normalizer with OID " + oid
-                + " cannot be moved to another schema until all "
-                + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_368, oid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
@@ -300,7 +297,7 @@
     {
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_369, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -312,7 +309,7 @@
 
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_369, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -322,9 +319,7 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException(
-                "The parent dn of a normalizer should be at most 3 name components in length.",
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_370 ), ResultCodeEnum.NAMING_VIOLATION );
         }
 
         RDN rdn = newParent.getRdn();
@@ -332,15 +327,12 @@
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a normalizer should be an organizationalUnit.",
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_371 ), ResultCodeEnum.NAMING_VIOLATION );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
         {
-            throw new LdapInvalidNameException(
-                "The parent entry of a normalizer should have a relative name of ou=normalizers.",
-                ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_372 ), ResultCodeEnum.NAMING_VIOLATION );
         }
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -24,6 +24,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapInvalidNameException;
@@ -123,9 +124,8 @@
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the ObjectClass " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_373, entry.getDn().getName(), 
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -177,9 +177,8 @@
             else
             {
                 // We have some error : reject the deletion and get out
-                String msg = "Cannot delete the ObjectClass " + entry.getDn().getName() + " from the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_374, entry.getDn().getName(),
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -228,8 +227,7 @@
             // Check that the entry has no descendant
             if ( schemaManager.getObjectClassRegistry().hasDescendants( oldOc.getOid() ) )
             {
-                String msg = "Cannot rename " + entry.getDn().getName() + " to " + newDn
-                    + " as the later has descendants' ObjectClasses";
+                String msg = I18n.err( I18n.ERR_375, entry.getDn().getName(), newDn );
 
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -345,14 +343,13 @@
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a objectClass should be an organizationalUnit.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_376 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
         {
-            throw new LdapInvalidNameException(
-                "The parent entry of a attributeType should have a relative name of ou=objectClasses.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_377 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

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=901905&r1=901904&r2=901905&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 22:49:21 2010
@@ -242,9 +242,7 @@
         {
             if ( opContext.getDn().size() != 3 )
             {
-                throw new LdapNamingException( 
-                    "Only schema entity containers of objectClass organizationalUnit with 3 name components in length" +
-                    " can be deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+                throw new LdapNamingException( I18n.err( I18n.ERR_378 ), ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
             
             String ouValue = ( String ) opContext.getDn().getRdn().getNormValue();
@@ -252,9 +250,8 @@
             
             if ( ! VALID_OU_VALUES.contains( ouValue ) )
             {
-                throw new LdapInvalidNameException( 
-                    "Can only delete organizationalUnit entity containers with one of the following names: " 
-                    + VALID_OU_VALUES, ResultCodeEnum.NAMING_VIOLATION );
+                throw new LdapInvalidNameException( I18n.err( I18n.ERR_379, VALID_OU_VALUES ),
+                    ResultCodeEnum.NAMING_VIOLATION );
             }
             
             return;

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=901905&r1=901904&r2=901905&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 22:49:21 2010
@@ -189,8 +189,8 @@
 
         if ( !parentDn.equals( ouSchemaDN ) )
         {
-            throw new LdapInvalidNameException( "The parent dn of a schema should be " + ouSchemaDN.getName() + " and not: "
-                + parentDn.toNormName(), ResultCodeEnum.NAMING_VIOLATION );
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_380, ouSchemaDN.getName(),
+                parentDn.toNormName() ), ResultCodeEnum.NAMING_VIOLATION );
         }
 
         // check if the new schema is enabled or disabled
@@ -261,7 +261,7 @@
         
         if ( ( dependents != null ) && ! dependents.isEmpty() )
         {
-            String msg = "Cannot delete schema that has dependents: " + dependents; 
+            String msg = I18n.err( I18n.ERR_381, dependents ); 
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException(
                 msg,
@@ -291,9 +291,7 @@
 
         if ( ! rdnAttributeOid.equals( cnAT.getOid() ) )
         {
-            throw new LdapOperationNotSupportedException( 
-                "Cannot allow rename with rdnAttribute set to " 
-                + rdnAttribute + ": cn must be used instead." ,
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_382, rdnAttribute ),
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
@@ -371,7 +369,7 @@
     public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn, 
         ServerEntry entry, boolean cascade ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_383 ),
             ResultCodeEnum.UNWILLING_TO_PERFORM );
     }
 
@@ -383,7 +381,7 @@
     public void move( LdapDN oriChildName, LdapDN newParentName, 
         ServerEntry entry, boolean cascade ) throws NamingException
     {
-        throw new LdapOperationNotSupportedException( "Moving around schemas is not allowed.",
+        throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_383 ),
             ResultCodeEnum.UNWILLING_TO_PERFORM );
     }
 
@@ -492,7 +490,7 @@
                 break;
                 
             default:
-                throw new IllegalArgumentException( "Unknown modify operation type: " + modOp );
+                throw new IllegalArgumentException( I18n.err( I18n.ERR_384, modOp ) );
         }
         
         return SCHEMA_UNCHANGED;
@@ -707,8 +705,7 @@
                 
                 if ( schemaManager.getLoadedSchema( StringTools.toLowerCase( dependency ) ) == null )
                 {
-                    throw new LdapOperationNotSupportedException( 
-                        "Unwilling to perform operation on schema with missing dependencies: " + dependency, 
+                    throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_385, dependency ), 
                         ResultCodeEnum.UNWILLING_TO_PERFORM );
                 }
             }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=901905&r1=901904&r2=901905&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java Thu Jan 21 22:49:21 2010
@@ -24,6 +24,7 @@
 
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+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.exception.LdapInvalidNameException;
@@ -128,9 +129,8 @@
             }
             else
             {
-                String msg = "Cannot delete the SyntaxChecker " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_386, entry.getDn().getName(),
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -191,8 +191,7 @@
             else
             {
                 // Ok, definitively an error
-                String msg = "Cannot delete the SyntaxChecker " + entry.getDn().getName() + " as it "
-                    + "does not exist in any schema";
+                String msg = I18n.err( I18n.ERR_387, entry.getDn().getName() );
                 LOG.info( msg );
                 throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -206,9 +205,8 @@
             }
             else
             {
-                String msg = "Cannot delete the syntaxChecker " + entry.getDn().getName() + " into the registries, "
-                    + "the resulting registries would be inconsistent :" + 
-                    StringTools.listToString( schemaManager.getErrors() );
+                String msg = I18n.err( I18n.ERR_388, entry.getDn().getName(),
+                    StringTools.listToString( schemaManager.getErrors() ) );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -230,8 +228,7 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid
-                + " cannot have it's OID changed until all " + "syntaxes using that syntaxChecker have been deleted.",
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_389, oldOid ),
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
@@ -240,7 +237,7 @@
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_390, newOid ),
                 ResultCodeEnum.OTHER );
         }
 
@@ -266,8 +263,7 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid
-                + " cannot have it's OID changed until all " + "syntaxes using that syntaxChecker have been deleted.",
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_391, oldOid ),
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
@@ -277,7 +273,7 @@
 
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_392, newOid ),
                 ResultCodeEnum.OTHER );
         }
 
@@ -306,9 +302,8 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oid
-                + " cannot be moved to another schema until all "
-                + "syntax using that syntaxChecker have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( I18n.err( I18n.ERR_393, oid ),
+                ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
@@ -332,7 +327,7 @@
 
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema SyntaxChecker is not unique.",
+            throw new LdapNamingException( I18n.err( I18n.ERR_394, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -352,7 +347,7 @@
         }
         else
         {
-            throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity does not exist.",
+            throw new LdapSchemaViolationException( I18n.err( I18n.ERR_395, oid ),
                 ResultCodeEnum.OTHER );
         }
     }
@@ -362,8 +357,7 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException(
-                "The parent dn of a syntaxChecker should be at most 3 name components in length.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_396 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
@@ -371,14 +365,13 @@
         if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
             SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should be an organizationalUnit.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_397 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
 
         if ( !( ( String ) rdn.getNormValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
         {
-            throw new LdapInvalidNameException(
-                "The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.",
+            throw new LdapInvalidNameException( I18n.err( I18n.ERR_398 ),
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

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=901905&r1=901904&r2=901905&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 Thu Jan 21 22:49:21 2010
@@ -340,84 +340,84 @@
 ERR_316=Directory service is not started.
 ERR_317=Schema load failed : {0}
 ERR_318=Unsupported changetype found in LDIF: {0}
-ERR_319=
-ERR_320=
-ERR_321=
-ERR_322=
-ERR_323=
-ERR_324=
-ERR_325=
-ERR_326=
-ERR_327=
-ERR_328=
-ERR_329=
-ERR_330=
-ERR_331=
-ERR_332=
-ERR_333=
-ERR_334=
-ERR_335=
-ERR_336=
-ERR_337=
-ERR_338=
-ERR_339=
-ERR_340=
-ERR_341=
-ERR_342=
-ERR_343=
-ERR_344=
-ERR_345=
-ERR_346=
-ERR_347=
-ERR_348=
-ERR_349=
-ERR_350=
-ERR_351=
-ERR_352=
-ERR_353=
-ERR_354=
-ERR_355=
-ERR_356=
-ERR_357=
-ERR_358=
-ERR_359=
-ERR_360=
-ERR_361=
-ERR_362=
-ERR_363=
-ERR_364=
-ERR_365=
-ERR_366=
-ERR_367=
-ERR_368=
-ERR_369=
-ERR_370=
-ERR_371=
-ERR_372=
-ERR_373=
-ERR_374=
-ERR_375=
-ERR_376=
-ERR_377=
-ERR_378=
-ERR_379=
-ERR_380=
-ERR_381=
-ERR_382=
-ERR_383=
-ERR_384=
-ERR_385=
-ERR_386=
-ERR_387=
-ERR_388=
-ERR_389=
-ERR_390=
-ERR_391=
-ERR_392=
-ERR_393=
-ERR_394=
-ERR_395=
-ERR_396=
-ERR_397=
-ERR_398=
+ERR_319=Cannot execute indirect lookup if it is not the next operation.
+ERR_320=The throwReferral method is not implemented for a Bind operation
+ERR_321=The isReferralThrown method is not implemented for a Bind operation
+ERR_322=The ignoreReferral method is not implemented for a Bind operation
+ERR_323=The isReferralIgnored method is not implemented for a Bind operation
+ERR_324=Cannot set the empty operation context to anything other than the EmptyDN
+ERR_325=NewSuperior must not be null: {0}
+ERR_326=The new superior cannot be null for {0}
+ERR_327={0} represents a move and rename operation.
+ERR_328=newRdn must not be null for a rename: {0}
+ERR_329=Failed to initialize interceptor chain.
+ERR_330=Interceptor not found: {0}
+ERR_331=Unknown interceptor name: {0}
+ERR_332=Other interceptor is using name '{0}'
+ERR_333=Unexpected exception.
+ERR_334=At least two name components are expected for the dn
+ERR_335=Oid {0} for new schema entity is not unique.
+ERR_336=Oid {0} for new schema entity does not exist.
+ERR_337=The parent dn of a attributeType should be at most 3 name components in length.
+ERR_338=The parent entry of a {0} should be an organizationalUnit.
+ERR_339=The parent entry of a {0} should have a relative name of ou={1}.
+ERR_340=Oid {0} for new schema entity is not unique.
+ERR_341=Cannot inject {0} into {1} as this schema already contains this element
+ERR_342=Cannot inject {0} into {1} as this schema is not loaded
+ERR_343=Cannot remove {0} from {1} as this schema does not contain this element
+ERR_344=Cannot inject {0} into {1} as this schema is not loaded
+ERR_345=Cannot add the AttributeType {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_346=Cannot delete the AttributeType {0} from the registries, the resulting registries would be inconsistent : {1}
+ERR_347=Cannot rename {0} to {1} as the later has descendants' AttributeTypes
+ERR_348=Cannot move a schemaObject from a not loaded schema {0}
+ERR_349=Cannot move a schemaObject to a not loaded schema {0}
+ERR_350=Cannot add the Comparator {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_351=Cannot delete the Comparator {0} as it does not exist in any schema
+ERR_352=Cannot delete the Comparator {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_353=The comparator with OID {0} cannot have it's OID changed until all matchingRules using that comparator have been deleted.
+ERR_354=The comparator with OID {0} cannot be moved to another schema until all matchingRules using that comparator have been deleted.
+ERR_355=Oid {0} for new schema comparator is not unique.
+ERR_356=Oid {0} for new schema entity does not exist.
+ERR_357=The parent dn of a comparator should be at most 3 name components in length.
+ERR_358=The parent entry of a comparator should be an organizationalUnit.
+ERR_359=The parent entry of a comparator should have a relative name of ou=comparators.
+ERR_360=Cannot add the MatchingRule {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_361=The parent dn of a matchingRule should be at most 3 name components in length.
+ERR_362=The parent entry of a matchingRule should be an organizationalUnit.
+ERR_363=The parent entry of a syntax should have a relative name of ou=matchingRules.
+ERR_364=Cannot delete the Normalizer {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_365=Cannot add the Normalizer {0} into the registries, we have got some errors : {1}
+ERR_366=Cannot delete {0}, as there are some dependant SchemaObjects :\n{1}
+ERR_367=The normalizer with OID {0} cannot have it's OID changed until all matchingRules using that normalizer have been deleted.
+ERR_368=The normalizer with OID {0} cannot be moved to another schema until all matchingRules using that normalizer have been deleted.
+ERR_369=Oid {0} for new schema normalizer is not unique.
+ERR_370=The parent dn of a normalizer should be at most 3 name components in length.
+ERR_371=The parent entry of a normalizer should be an organizationalUnit.
+ERR_372=The parent entry of a normalizer should have a relative name of ou=normalizers.
+ERR_373=Cannot add the ObjectClass {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_374=Cannot delete the ObjectClass {0} from the registries, the resulting registries would be inconsistent : {1}
+ERR_375=Cannot rename {0} to {1} as the later has descendants' ObjectClasses
+ERR_376=The parent entry of a objectClass should be an organizationalUnit.
+ERR_377=The parent entry of a attributeType should have a relative name of ou=objectClasses.
+ERR_378=Only schema entity containers of objectClass organizationalUnit with 3 name components in length can be deleted.
+ERR_379=Can only delete organizationalUnit entity containers with one of the following names: {0}
+ERR_380=The parent dn of a schema should be {0} and not: {1}
+ERR_381=Cannot delete schema that has dependents: {0}
+ERR_382=Cannot allow rename with rdnAttribute set to {0}: cn must be used instead.
+ERR_383=Moving around schemas is not allowed.
+ERR_384=Unknown modify operation type: {0}
+ERR_385=Unwilling to perform operation on schema with missing dependencies: {0}
+ERR_386=Cannot delete the SyntaxChecker {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_387=Cannot delete the SyntaxChecker {0} as it does not exist in any schema
+ERR_388=Cannot delete the syntaxChecker {0} into the registries, the resulting registries would be inconsistent : {1}
+ERR_389=The syntaxChecker with OID {0} cannot have it's OID changed until all syntaxes using that syntaxChecker have been deleted.
+ERR_390=Oid {0} for new schema syntaxChecker is not unique.
+ERR_391=The syntaxChecker with OID {0} cannot have it's OID changed until all syntaxes using that syntaxChecker have been deleted.
+ERR_392=Oid {0} for new schema syntaxChecker is not unique.
+ERR_393=The syntaxChecker with OID {0} cannot be moved to another schema until all syntax using that syntaxChecker have been deleted.
+ERR_394=Oid {0} for new schema SyntaxChecker is not unique.
+ERR_395=Oid {0} for new schema entity does not exist.
+ERR_396=The parent dn of a syntaxChecker should be at most 3 name components in length.
+ERR_397=The parent entry of a syntaxChecker should be an organizationalUnit.
+ERR_398=The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.
 ERR_399=



Mime
View raw message