Skip to content

Commit

Permalink
Partial fix to DIRSERVER_1728: interceptor-collective
Browse files Browse the repository at this point in the history
  • Loading branch information
elecharny committed Aug 21, 2024
1 parent 28964e8 commit ec2f1fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 4 additions & 3 deletions i18n/src/main/java/org/apache/directory/server/i18n/I18n.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,10 @@ public enum I18n


// apacheds-interceptors-collective errors 17000 - 17999
ERR_17000_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY("ERR_17000_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY"),
ERR_17001_CANNOT_OPERATE_ON_COLLECTIVE_ATTRIBUTE("ERR_17001_CANNOT_OPERATE_ON_COLLECTIVE_ATTRIBUTE"),
ERR_17002_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT("ERR_17002_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT"),

// apacheds-interceptors-event errors 18000 - 18999
// No error

Expand Down Expand Up @@ -613,15 +617,12 @@ public enum I18n
ERR_223("ERR_223"),
ERR_224("ERR_224"),
ERR_226("ERR_226"),
ERR_241_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY("ERR_241_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY"),
ERR_242("ERR_242"),
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_257_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT("ERR_257_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT"),
ERR_258("ERR_258"),
ERR_259("ERR_259"),
ERR_261("ERR_261"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ ERR_16004_FILE_CANNOT_BE_DELETED=Can''t delete file {0}


# apacheds-interceptors-collective errors 17000 - 17999
ERR_17000_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY=Collective attributes cannot be stored in non-collectiveAttributeSubentries
ERR_17001_CANNOT_OPERATE_ON_COLLECTIVE_ATTRIBUTE=Cannot operate on collective attributes in non-collectiveAttributeSubentries
ERR_17002_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT=A CollectiveAttribute Subentry must have at least one collective Attribute


# apacheds-interceptors-event errors 18000 - 18999
# --- no error ---

Expand Down Expand Up @@ -627,15 +632,12 @@ ERR_222=Cannot call store method: {0}
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_241_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY=Collective attributes cannot be stored in non-collectiveAttributeSubentries
ERR_242=Cannot operate on collective attributes in non-collectiveAttributeSubentries
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_257_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT=A CollectiveAttribute Subentry must have at least one collective Attribute
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private void checkAdd( Dn normName, Entry entry ) throws LdapException

LOG.info( "A CollectiveAttribute subentry *should* have at least one collectiveAttribute" );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION,
I18n.err( I18n.ERR_257_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT ) );
I18n.err( I18n.ERR_17002_COLLECTIVE_SUBENTRY_WITHOUT_COLLECTIVE_AT ) );
}

if ( containsAnyCollectiveAttributes( entry ) )
Expand All @@ -228,7 +228,7 @@ private void checkAdd( Dn normName, Entry entry ) throws LdapException
"Cannot add the entry {} : it contains some CollectiveAttributes and is not a collective subentry",
entry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION,
I18n.err( I18n.ERR_241_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY ) );
I18n.err( I18n.ERR_17000_CANNOT_STORE_COLLECTIVE_ATT_IN_ENTRY ) );
}
}

Expand Down Expand Up @@ -259,7 +259,7 @@ private void checkModify( ModifyOperationContext modifyContext ) throws LdapExce
LOG.info(
"Cannot modify the entry {} : it contains some CollectiveAttributes and is not a collective subentry",
targetEntry );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_242 ) );
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECT_CLASS_VIOLATION, I18n.err( I18n.ERR_17001_CANNOT_OPERATE_ON_COLLECTIVE_ATTRIBUTE ) );
}
}

Expand Down

0 comments on commit ec2f1fb

Please sign in to comment.