Skip to content

Commit

Permalink
WFCORE-6865 Stability of generated OperationDefinition for add/remove…
Browse files Browse the repository at this point in the history
… resource operations should match stability of the corresponding resource definition.
  • Loading branch information
pferraro committed Jun 24, 2024
1 parent 42dcc70 commit 63e94d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ protected void registerAddOperation(final ManagementResourceRegistration registr
.setParameters(this.getAddOperationParameters(registration))
.setDescriptionProvider(descriptionProvider)
.setEntryType(OperationEntry.EntryType.PUBLIC)
.setStability(registration.getStability())
.withFlags(flags)
.build();
registration.registerOperationHandler(definition, handler);
Expand All @@ -234,6 +235,7 @@ protected void registerRemoveOperation(final ManagementResourceRegistration regi
OperationDefinition definition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.REMOVE, this.descriptionResolver)
.setDescriptionProvider(descriptionProvider)
.setEntryType(OperationEntry.EntryType.PUBLIC)
.setStability(registration.getStability())
.withFlags(flags)
.build();
registration.registerOperationHandler(definition, handler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ public void register(ManagementResourceRegistration registration) {
OperationDefinition addDefinition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.ADD, this.descriptor.getResourceDescriptionResolver())
.setParameters(attributes.toArray(AttributeDefinition[]::new))
.setDescriptionProvider(new DefaultResourceAddDescriptionProvider(registration, this.descriptor.getResourceDescriptionResolver(), ordered))
.setStability(registration.getStability())
.withFlag(this.descriptor.getAddOperationRestartFlag())
.build();
registration.registerOperationHandler(addDefinition, this.descriptor.getAddOperationTransformation().apply(new AddResourceOperationStepHandler(this.descriptor)));

// Register remove resource operation handler
OperationDefinition removeDefinition = new SimpleOperationDefinitionBuilder(ModelDescriptionConstants.REMOVE, this.descriptor.getResourceDescriptionResolver())
.setDescriptionProvider(new DefaultResourceRemoveDescriptionProvider(this.descriptor.getResourceDescriptionResolver()))
.setStability(registration.getStability())
.withFlag(this.descriptor.getRemoveOperationRestartFlag())
.build();
registration.registerOperationHandler(removeDefinition, this.descriptor.getResourceOperationTransformation().apply(new RemoveResourceOperationStepHandler(this.descriptor)));
Expand Down

0 comments on commit 63e94d4

Please sign in to comment.