diff --git a/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java b/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java index 404a801e09..0bd901ac49 100644 --- a/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java +++ b/core-shared/src/main/java/org/apache/directory/server/core/shared/SortedEntrySerializer.java @@ -134,7 +134,7 @@ public Object deserialize( byte[] serialized ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java b/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java index fe9f21011c..9f22eb0009 100644 --- a/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java +++ b/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/DefaultPartitionNexus.java @@ -170,7 +170,7 @@ public DefaultPartitionNexus( Entry rootDse ) throws LdapException } catch ( IOException e ) { - LOG.error( I18n.err( I18n.ERR_33 ) ); + LOG.error( I18n.err( I18n.ERR_07001_FAILED_TO_LOG_VERSION ) ); } rootDse.put( SchemaConstants.VENDOR_VERSION_AT, props.getProperty( "apacheds.version", "UNKNOWN" ) ); @@ -312,7 +312,7 @@ protected synchronized void doDestroy( PartitionTxn partitionTxn ) @Override public void setId( String id ) { - throw new UnsupportedOperationException( I18n.err( I18n.ERR_264 ) ); + throw new UnsupportedOperationException( I18n.err( I18n.ERR_07005_PARTITION_ID_CANNOT_BE_SET ) ); } @@ -348,7 +348,7 @@ public void sync() throws LdapException if ( errors == null ) { //noinspection ThrowableInstanceNeverThrown - errors = new MultiException( I18n.err( I18n.ERR_265 ) ); + errors = new MultiException( I18n.err( I18n.ERR_07006_GROUPING_EXCEPTIONS_ON_ROOT_NEXUS ) ); } // @todo really need to send this info to a monitor @@ -826,7 +826,7 @@ public synchronized void addContextPartition( Partition partition ) throws LdapE if ( partitions.containsKey( key ) ) { - throw new LdapOtherException( I18n.err( I18n.ERR_263, key ) ); + throw new LdapOtherException( I18n.err( I18n.ERR_07004_DUPLICATE_PARTITION_SUFFIX, key ) ); } if ( !partition.isInitialized() ) @@ -840,7 +840,7 @@ public synchronized void addContextPartition( Partition partition ) throws LdapE if ( partitionSuffix == null ) { - throw new LdapOtherException( I18n.err( I18n.ERR_267, partition.getId() ) ); + throw new LdapOtherException( I18n.err( I18n.ERR_07007_PARTITION_HAS_NO_SUFFIX, partition.getId() ) ); } partitions.put( partitionSuffix.getNormName(), partition ); @@ -874,7 +874,7 @@ public synchronized void removeContextPartition( String partitionDn ) if ( partition == null ) { - String msg = I18n.err( I18n.ERR_34, partitionDn ); + String msg = I18n.err( I18n.ERR_07002_NO_PARTITION_WITH_SUFFIX, partitionDn ); LOG.error( msg ); throw new LdapNoSuchObjectException( msg ); } @@ -906,7 +906,7 @@ public synchronized void removeContextPartition( String partitionDn ) } else { - String msg = I18n.err( I18n.ERR_35, partitionDn ); + String msg = I18n.err( I18n.ERR_07003_NO_PARTITION_WITH_SUFFIX_IN_NAMING_CONTEXTS, partitionDn ); LOG.error( msg ); throw new LdapNoSuchObjectException( msg ); } @@ -961,7 +961,7 @@ public Partition getPartition( Dn dn ) throws LdapException if ( parent == null ) { - throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_268, dn ) ); + throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_07008_CANNOT_FIND_PARTITION, dn ) ); } else { diff --git a/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java b/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java index 548d119cb3..52ea0d01f6 100644 --- a/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java +++ b/i18n/src/main/java/org/apache/directory/server/i18n/I18n.java @@ -224,6 +224,15 @@ public enum I18n // apacheds-core-jndi errors 6000 - 6999 // apacheds-core-shared errors 7000 - 7999 + ERR_07000_CANNOT_DESERIALIZE_ENTRY("ERR_07000_CANNOT_DESERIALIZE_ENTRY"), + ERR_07001_FAILED_TO_LOG_VERSION("ERR_07001_FAILED_TO_LOG_VERSION"), + ERR_07002_NO_PARTITION_WITH_SUFFIX("ERR_07002_NO_PARTITION_WITH_SUFFIX"), + ERR_07003_NO_PARTITION_WITH_SUFFIX_IN_NAMING_CONTEXTS("ERR_07003_NO_PARTITION_WITH_SUFFIX_IN_NAMING_CONTEXTS"), + ERR_07004_DUPLICATE_PARTITION_SUFFIX("ERR_07004_DUPLICATE_PARTITION_SUFFIX"), + ERR_07005_PARTITION_ID_CANNOT_BE_SET("ERR_07005_PARTITION_ID_CANNOT_BE_SET"), + ERR_07006_GROUPING_EXCEPTIONS_ON_ROOT_NEXUS("ERR_07006_GROUPING_EXCEPTIONS_ON_ROOT_NEXUS"), + ERR_07007_PARTITION_HAS_NO_SUFFIX("ERR_07007_PARTITION_HAS_NO_SUFFIX"), + ERR_07008_CANNOT_FIND_PARTITION("ERR_07008_CANNOT_FIND_PARTITION"), // apacheds-http-directory-bridge errors 8000 - 8999 @@ -252,6 +261,8 @@ public enum I18n // apacheds-interceptors-ppolicy errors 26000 - 26999 // apacheds-interceptors-referral errors 27000 - 27999 // apacheds-interceptors-schema errors 28000 - 28999 + ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY("ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY"), + // apacheds-interceptors-subtree errors 29000 - 29999 // apacheds-interceptors-trigger errors 30000 - 30999 // apacheds-jdbm-partition errors 31000 - 31999 @@ -313,9 +324,6 @@ public enum I18n ERR_30("ERR_30"), ERR_31("ERR_31"), ERR_32("ERR_32"), - ERR_33("ERR_33"), - ERR_34("ERR_34"), - ERR_35("ERR_35"), ERR_36("ERR_36"), ERR_37("ERR_37"), ERR_38("ERR_38"), @@ -392,7 +400,6 @@ public enum I18n ERR_131("ERR_131"), ERR_132("ERR_132"), ERR_133("ERR_133"), - ERR_134("ERR_134"), ERR_135("ERR_135"), ERR_136("ERR_136"), ERR_137("ERR_137"), @@ -513,12 +520,6 @@ public enum I18n ERR_260("ERR_260"), ERR_261("ERR_261"), ERR_262("ERR_262"), - ERR_263("ERR_263"), - ERR_264("ERR_264"), - ERR_265("ERR_265"), - ERR_266("ERR_266"), - ERR_267("ERR_267"), - ERR_268("ERR_268"), ERR_269("ERR_269"), ERR_270("ERR_270"), ERR_271("ERR_271"), diff --git a/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties b/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties index 94caeabfe0..ee0a3ac950 100644 --- a/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties +++ b/i18n/src/main/resources/org/apache/directory/server/i18n/errors.properties @@ -213,6 +213,16 @@ ERR_03019_ALREADY_IN_ORDERED_SET_MODE=Already in ordered set mode. # apacheds-core-jndi errors 6000 - 6999 # apacheds-core-shared errors 7000 - 7999 +ERR_07000_CANNOT_DESERIALIZE_ENTRY=Cannot deserialize the entry : {0} +ERR_07001_FAILED_TO_LOG_VERSION=failed to LOG version properties +ERR_07002_NO_PARTITION_WITH_SUFFIX=No partition with suffix: {0} +ERR_07003_NO_PARTITION_WITH_SUFFIX_IN_NAMING_CONTEXTS=No partition with suffix ''{0}'' can be found in the NamingContexts +ERR_07004_DUPLICATE_PARTITION_SUFFIX=Duplicate partition suffix: {0} +ERR_07005_PARTITION_ID_CANNOT_BE_SET=The id cannot be set for the partition nexus. +ERR_07006_GROUPING_EXCEPTIONS_ON_ROOT_NEXUS=Grouping many exceptions on root nexus sync() +ERR_07007_PARTITION_HAS_NO_SUFFIX=The current partition does not have any suffix: {0} +ERR_07008_CANNOT_FIND_PARTITION=Cannot find a partition for {0} + # apacheds-http-directory-bridge errors 8000 - 8999 @@ -242,12 +252,15 @@ ERR_09001_FAILED_TO_CONFIGURE_WEB_APPLICATION=Failed to configure the web applic # apacheds-interceptors-ppolicy errors 26000 - 26999 # apacheds-interceptors-referral errors 27000 - 27999 # apacheds-interceptors-schema errors 28000 - 28999 +ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY={0} not found within the attributeType registry + # apacheds-interceptors-subtree errors 29000 - 29999 # apacheds-interceptors-trigger errors 30000 - 30999 # apacheds-jdbm-partition errors 31000 - 31999 ERR_31001_ODD_NUMBER_OF_BYTES_IN_SERIALIZED_STRING=The serialized String contains an odd number of bytes ERR_31002_NEGATIOVE_NB_ATTRIBUTES_IN_ENTRY=The number of attributes is negative + # apacheds-kerberos-codec errors 32000 - 32999 # apacheds-ldif-partition errors 33000 - 33999 @@ -304,9 +317,6 @@ ERR_29=Cannot set a changeLog store when one is already active ERR_30=The {0} operational attribute cannot be modified by a user ERR_31=The ModifiersName operational attribute cannot be modified by a user ERR_32=The ModifyTimestamp operational attribute cannot be modified by a user -ERR_33=failed to LOG version properties -ERR_34=No partition with suffix: {0} -ERR_35=No partition with suffix ''{0}'' can be found in the NamingContexts ERR_36=An LDAPURL should not contains a scope ERR_37=An LDAPURL should not contains filters ERR_38=An LDAPURL should not contains any description attribute list @@ -383,7 +393,6 @@ ERR_128=Failed to identify OID for\: ERR_131=Error while adding {0} on table {1} ERR_132=Error while adding {0}, {1} on table {2} ERR_133=Exception while removing {0} from index {1} -ERR_134=Cannot deserialize the entry : {0} ERR_135=Cannot create a ticket for the {0} KerberosPrincipal, error : {1} ERR_136=Cannot create a ticket : {0} ERR_137=Cannot encode the Ticket object, the PDU size is {0} when only {1} bytes has been allocated @@ -504,12 +513,6 @@ ERR_259=Attempt to search under non-existant entry\: ERR_260=Unknown assertion type: {0} ERR_261=Failed to expand node ERR_262=System partition has wrong name: should be ''system'' not ''{0}''. -ERR_263=Duplicate partition suffix: {0} -ERR_264=The id cannot be set for the partition nexus. -ERR_265=Grouping many exceptions on root nexus sync() -ERR_266={0} not found within the attributeType registry -ERR_267=The current partition does not have any suffix: {0} -ERR_268=Cannot find a partition for {0} ERR_269=userRoot() in org.apache.directory.server.prefs.ServerPreferencesFactory not implemented! ERR_270=Failed to set up node. ERR_271=Failed to get SPI. diff --git a/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java b/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java index aec6f94195..a79b2385e9 100644 --- a/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java +++ b/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java @@ -175,7 +175,7 @@ public boolean compare( CompareOperationContext compareContext ) throws LdapExce } catch ( LdapException le ) { - throw new LdapInvalidAttributeTypeException( I18n.err( I18n.ERR_266, compareContext.getOid() ) ); + throw new LdapInvalidAttributeTypeException( I18n.err( I18n.ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY, compareContext.getOid() ) ); } return next( compareContext ); diff --git a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java index 662cae30c0..78cb226476 100644 --- a/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java +++ b/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java @@ -1150,7 +1150,7 @@ public boolean compare( CompareOperationContext compareContext ) throws LdapExce // complain if we do not recognize the attribute being compared if ( !schemaManager.getAttributeTypeRegistry().contains( compareContext.getOid() ) ) { - throw new LdapInvalidAttributeTypeException( I18n.err( I18n.ERR_266, compareContext.getOid() ) ); + throw new LdapInvalidAttributeTypeException( I18n.err( I18n.ERR_28000_OBJECT_NOT_FOUND_IN_AT_REGISTRY, compareContext.getOid() ) ); } return next( compareContext ); diff --git a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DnSerializer.java b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DnSerializer.java index 8a6ba55176..68def0ee7b 100644 --- a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DnSerializer.java +++ b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DnSerializer.java @@ -123,7 +123,7 @@ public Object deserialize( byte[] bytes ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java index acae9ea09d..c3555065c8 100644 --- a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java +++ b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/EntrySerializer.java @@ -236,7 +236,7 @@ public Object deserialize( byte[] bytes ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ParentIdAndRdnSerializer.java b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ParentIdAndRdnSerializer.java index 30cff443f7..dff71154c8 100644 --- a/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ParentIdAndRdnSerializer.java +++ b/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ParentIdAndRdnSerializer.java @@ -179,7 +179,7 @@ public Object deserialize( byte[] bytes ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/DnSerializer.java b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/DnSerializer.java index 82f11525a6..b15d6e2c72 100644 --- a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/DnSerializer.java +++ b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/DnSerializer.java @@ -141,7 +141,7 @@ public Dn deserialize( BufferHandler bufferHandler ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } @@ -176,7 +176,7 @@ public Dn fromBytes( byte[] buffer, int pos ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotEntrySerializer.java b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotEntrySerializer.java index 518e6d05b0..be54d4fe46 100644 --- a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotEntrySerializer.java +++ b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotEntrySerializer.java @@ -263,7 +263,7 @@ public Entry deserialize( ByteBuffer buffer ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } @@ -363,7 +363,7 @@ public Entry fromBytes( byte[] buffer, int pos ) throws IOException } catch ( ClassNotFoundException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } } diff --git a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java index 68e70ea0ea..f5c9d33442 100644 --- a/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java +++ b/mavibot-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/mavibot/MavibotParentIdAndRdnSerializer.java @@ -276,7 +276,7 @@ public ParentIdAndRdn fromBytes( byte[] buffer, int pos ) throws IOException } catch ( LdapInvalidAttributeValueException cnfe ) { - LOG.error( I18n.err( I18n.ERR_134, cnfe.getLocalizedMessage() ) ); + LOG.error( I18n.err( I18n.ERR_07000_CANNOT_DESERIALIZE_ENTRY, cnfe.getLocalizedMessage() ) ); throw new IOException( cnfe.getLocalizedMessage() ); } }