Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -317,7 +317,7 @@ public interface DdiRootControllerRestApi {
|
|||||||
e.g. the canceled actions have been started already.""")
|
e.g. the canceled actions have been started already.""")
|
||||||
@PostUpdateResponses
|
@PostUpdateResponses
|
||||||
@ApiResponses(value = {
|
@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}/" +
|
@PostMapping(value = CONTROLLER_V1 + "/{controllerId}/" + CANCEL_ACTION + "/{actionId}/" +
|
||||||
FEEDBACK, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
FEEDBACK, consumes = { APPLICATION_JSON_VALUE, MEDIA_TYPE_APPLICATION_CBOR })
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ public interface MgmtTargetRestApi {
|
|||||||
description = "Cancels an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET")
|
description = "Cancels an active action, only active actions can be deleted. Required Permission: UPDATE_TARGET")
|
||||||
@DeleteResponses
|
@DeleteResponses
|
||||||
@ApiResponses(value = {
|
@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)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@DeleteMapping(value = TARGETS_V1 + "/{targetId}/actions/{actionId}")
|
@DeleteMapping(value = TARGETS_V1 + "/{targetId}/actions/{actionId}")
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public interface MgmtTargetTypeRestApi {
|
|||||||
"Required Permission: CREATE_TARGET")
|
"Required Permission: CREATE_TARGET")
|
||||||
@PostCreateResponses
|
@PostCreateResponses
|
||||||
@ApiResponses(value = {
|
@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)))
|
content = @Content(mediaType = "application/json", schema = @Schema(hidden = true)))
|
||||||
})
|
})
|
||||||
@PostMapping(value = TARGETTYPES_V1,
|
@PostMapping(value = TARGETTYPES_V1,
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ public class LockedException extends AbstractServerRtException {
|
|||||||
|
|
||||||
public LockedException(
|
public LockedException(
|
||||||
final Class<? extends BaseEntity> type, final Object entityId, final String operation, final String reason) {
|
final Class<? extends BaseEntity> type, final Object entityId, final String operation, final String reason) {
|
||||||
super(
|
super(THIS_ERROR, type.getSimpleName() + " with given identifier {" + entityId + "} is locked and " + operation + " is forbidden!" +
|
||||||
THIS_ERROR, type.getSimpleName() + " with given identifier {" + entityId + "} is locked and " + operation + " is forbidden!" +
|
(reason == null ? "" : " Reason: " + reason));
|
||||||
(reason == null ? "" : " Reason: " + reason)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -99,9 +99,8 @@ public class JpaDistributionSetInvalidationManagement implements DistributionSet
|
|||||||
|
|
||||||
private void invalidateDistributionSetsInTransaction(final DistributionSetInvalidation distributionSetInvalidation, final String tenant) {
|
private void invalidateDistributionSetsInTransaction(final DistributionSetInvalidation distributionSetInvalidation, final String tenant) {
|
||||||
DeploymentHelper.runInNewTransaction(txManager, tenant + "-invalidateDS", status -> {
|
DeploymentHelper.runInNewTransaction(txManager, tenant + "-invalidateDS", status -> {
|
||||||
distributionSetInvalidation.getDistributionSetIds().forEach(setId -> invalidateDistributionSet(setId,
|
distributionSetInvalidation.getDistributionSetIds().forEach(
|
||||||
distributionSetInvalidation.getActionCancellationType()));
|
setId -> invalidateDistributionSet(setId, distributionSetInvalidation.getActionCancellationType()));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user