You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2024/08/21 12:51:21 UTC
(directory-server) branch master updated: Partial fix to DIRSERVER_1728: interceptor-exception
This is an automated email from the ASF dual-hosted git repository.
elecharny pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/directory-server.git
The following commit(s) were added to refs/heads/master by this push:
new 3663272ffe Partial fix to DIRSERVER_1728: interceptor-exception
3663272ffe is described below
commit 3663272ffe59c05220182141afe9a030ca75e334
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Wed Aug 21 14:51:17 2024 +0200
Partial fix to DIRSERVER_1728: interceptor-exception
---
.../src/main/java/org/apache/directory/server/i18n/I18n.java | 11 ++++++-----
.../org/apache/directory/server/i18n/errors.properties | 11 ++++++-----
.../server/core/exception/ExceptionInterceptor.java | 12 ++++++------
3 files changed, 18 insertions(+), 16 deletions(-)
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 321d2e1c8b..f34c4345db 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
@@ -327,6 +327,12 @@ public enum I18n
// No error
// apacheds-interceptors-exception errors 19000 - 19999
+ ERR_19000_PARENT_NOT_FOUND("ERR_19000_PARENT_NOT_FOUND"),
+ ERR_19001_ALIAS_WITH_CHILD_NOT_ALLOWED("ERR_19001_ALIAS_WITH_CHILD_NOT_ALLOWED"),
+ ERR_19002_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_DELETION("ERR_19002_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_DELETION"),
+ ERR_19003_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_RENAMING("ERR_19003_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_RENAMING"),
+ ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE("ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE"),
+
// apacheds-interceptors-hash errors 20000 - 20999
// No error
@@ -618,12 +624,7 @@ public enum I18n
ERR_224("ERR_224"),
ERR_226("ERR_226"),
ERR_249("ERR_249"),
- ERR_251_PARENT_NOT_FOUND("ERR_251_PARENT_NOT_FOUND"),
- ERR_252_ALIAS_WITH_CHILD_NOT_ALLOWED("ERR_252_ALIAS_WITH_CHILD_NOT_ALLOWED"),
- ERR_253("ERR_253"),
ERR_254_ADD_EXISTING_VALUE("ERR_254_ADD_EXISTING_VALUE"),
- ERR_255("ERR_255"),
- ERR_258("ERR_258"),
ERR_259("ERR_259"),
ERR_261("ERR_261"),
ERR_262("ERR_262"),
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 087039ba55..9c1a0e17a4 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
@@ -317,6 +317,12 @@ ERR_17002_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT=A CollectiveAttribute Subent
# --- no error ---
# apacheds-interceptors-exception errors 19000 - 19999
+ERR_19000_PARENT_NOT_FOUND=Parent {0} not found
+ERR_19001_ALIAS_WITH_CHILD_NOT_ALLOWED=Attempt to add entry ''{0}'' under alias ''{1}'' not allowed.
+ERR_19002_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_DELETION=Can not allow the deletion of the subschemaSubentry ({0}) for the global schema.
+ERR_19003_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_RENAMING=Can not allow the renaming of the subschemaSubentry ({0}) for the global schema: it is fixed at {1}
+ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE=Can not allow the move of the subschemaSubentry ({0}) for the global schema\: it is fixed at {1}
+
# apacheds-interceptors-hash errors 20000 - 20999
# --- no error ---
@@ -633,12 +639,7 @@ ERR_223=[36] aliasDereferencingProblem - attempt to create alias to itself.
ERR_224=[36] aliasDereferencingProblem - attempt to create alias with cycle to relative {0} not allowed from descendent alias {1}
ERR_226=[33] aliasProblem - the alias when dereferenced would not name a known object the aliasedObjectName must be set to a valid existing entry.
ERR_249=The global schema subentry cannot be added since it exists by default.
-ERR_251_PARENT_NOT_FOUND=Parent {0} not found
-ERR_252_ALIAS_WITH_CHILD_NOT_ALLOWED=Attempt to add entry ''{0}'' under alias ''{1}'' not allowed.
-ERR_253=Can not allow the deletion of the subschemaSubentry ({0}) for the global schema.
ERR_254_ADD_EXISTING_VALUE=Trying to add existing value ''{0}'' to attribute {1}
-ERR_255=Can not allow the renaming of the subschemaSubentry ({0}) for the global schema: it is fixed at {1}
-ERR_258=Can not allow the move of the subschemaSubentry ({0}) for the global schema\: it is fixed at {1}
ERR_259=Attempt to search under non-existant entry\:
ERR_261=Failed to expand node
ERR_262=System partition has wrong name: should be ''system'' not ''{0}''.
diff --git a/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java b/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
index 1472e69c5d..4283e66390 100644
--- a/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
+++ b/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
@@ -162,7 +162,7 @@ public class ExceptionInterceptor extends BaseInterceptor
}
catch ( Exception e )
{
- throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_251_PARENT_NOT_FOUND, parentDn.getName() ) );
+ throw new LdapNoSuchObjectException( I18n.err( I18n.ERR_19000_PARENT_NOT_FOUND, parentDn.getName() ) );
}
Attribute objectClass = ( ( ClonedServerEntry ) attrs ).getOriginalEntry().get(
@@ -170,7 +170,7 @@ public class ExceptionInterceptor extends BaseInterceptor
if ( objectClass.contains( SchemaConstants.ALIAS_OC ) )
{
- String msg = I18n.err( I18n.ERR_252_ALIAS_WITH_CHILD_NOT_ALLOWED, name.getName(), parentDn.getName() );
+ String msg = I18n.err( I18n.ERR_19001_ALIAS_WITH_CHILD_NOT_ALLOWED, name.getName(), parentDn.getName() );
throw new LdapAliasException( msg );
}
else
@@ -197,7 +197,7 @@ public class ExceptionInterceptor extends BaseInterceptor
if ( dn.equals( subschemSubentryDn ) )
{
- throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_253,
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_19002_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_DELETION,
subschemSubentryDn ) );
}
@@ -282,7 +282,7 @@ public class ExceptionInterceptor extends BaseInterceptor
if ( oriChildName.equals( subschemSubentryDn ) )
{
- throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_258,
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE,
subschemSubentryDn, subschemSubentryDn ) );
}
@@ -313,7 +313,7 @@ public class ExceptionInterceptor extends BaseInterceptor
// Don't allow M&R in the SSSE
if ( oldDn.getNormName().equals( subschemSubentryDn.getNormName() ) )
{
- throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_258,
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_19004_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_MOVE,
subschemSubentryDn, subschemSubentryDn ) );
}
@@ -343,7 +343,7 @@ public class ExceptionInterceptor extends BaseInterceptor
if ( dn.equals( subschemSubentryDn ) )
{
- throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_255,
+ throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, I18n.err( I18n.ERR_19003_CANNOT_ALLOW_SUBSCHEMA_SUBENTRY_RENAMING,
subschemSubentryDn, subschemSubentryDn ) );
}