Fix #2880 findings (#2887)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2026-01-23 10:15:45 +02:00
committed by GitHub
parent 97762360c3
commit d9e52cb542
5 changed files with 7 additions and 10 deletions

View File

@@ -317,7 +317,7 @@ public interface DdiRootControllerRestApi {
e.g. the canceled actions have been started already.""")
@PostUpdateResponses
@ApiResponses(value = {
@ApiResponse(responseCode = METHOD_NOT_ALLOWED_405, description = "Software module is locked", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
@ApiResponse(responseCode = METHOD_NOT_ALLOWED_405, description = "The action is not cancelable / force quitable", content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
})
@PostMapping(value = CONTROLLER_V1 + "/{controllerId}/" + CANCEL_ACTION + "/{actionId}/" +
FEEDBACK, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })

View File

@@ -276,7 +276,7 @@ public interface MgmtTargetRestApi {
description = "Cancels an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET")
@DeleteResponses
@ApiResponses(value = {
@ApiResponse(responseCode = METHOD_NOT_ALLOWED_405, description = "Software module is locked",
@ApiResponse(responseCode = METHOD_NOT_ALLOWED_405, description = "Action is not in cancelling state",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
})
@DeleteMapping(value = TARGETS_V1 + "/{targetId}/actions/{actionId}")

View File

@@ -143,7 +143,7 @@ public interface MgmtTargetTypeRestApi {
"Required Permission: CREATE_TARGET")
@PostCreateResponses
@ApiResponses(value = {
@ApiResponse(responseCode = NOT_FOUND_404, description = "Target type not found.",
@ApiResponse(responseCode = NOT_FOUND_404, description = "Compatible distributions sets not found.",
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
})
@PostMapping(value = TARGETTYPES_V1,

View File

@@ -35,9 +35,7 @@ public class LockedException extends AbstractServerRtException {
public LockedException(
final Class<? extends BaseEntity> type, final Object entityId, final String operation, final String reason) {
super(
THIS_ERROR, type.getSimpleName() + " with given identifier {" + entityId + "} is locked and " + operation + " is forbidden!" +
(reason == null ? "" : " Reason: " + reason)
);
super(THIS_ERROR, type.getSimpleName() + " with given identifier {" + entityId + "} is locked and " + operation + " is forbidden!" +
(reason == null ? "" : " Reason: " + reason));
}
}

View File

@@ -99,9 +99,8 @@ public class JpaDistributionSetInvalidationManagement implements DistributionSet
private void invalidateDistributionSetsInTransaction(final DistributionSetInvalidation distributionSetInvalidation, final String tenant) {
DeploymentHelper.runInNewTransaction(txManager, tenant + "-invalidateDS", status -> {
distributionSetInvalidation.getDistributionSetIds().forEach(setId -> invalidateDistributionSet(setId,
distributionSetInvalidation.getActionCancellationType()));
distributionSetInvalidation.getDistributionSetIds().forEach(
setId -> invalidateDistributionSet(setId, distributionSetInvalidation.getActionCancellationType()));
return 0;
});
}