[#1580] Software Module & Distribution Set lock: add lock at rest level (#1646)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-02-15 11:46:06 +02:00
committed by GitHub
parent e535420065
commit 850fa3507f
17 changed files with 123 additions and 35 deletions

View File

@@ -111,6 +111,7 @@ public final class MgmtDistributionSetMapper {
response.setComplete(distributionSet.isComplete());
response.setType(distributionSet.getType().getKey());
response.setTypeName(distributionSet.getType().getName());
response.setLocked(distributionSet.isLocked());
response.setDeleted(distributionSet.isDeleted());
response.setValid(distributionSet.isValid());

View File

@@ -198,10 +198,10 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
public ResponseEntity<MgmtDistributionSet> updateDistributionSet(
@PathVariable("distributionSetId") final Long distributionSetId,
@RequestBody final MgmtDistributionSetRequestBodyPut toUpdate) {
final DistributionSet updated = distributionSetManagement.update(entityFactory.distributionSet()
.update(distributionSetId).name(toUpdate.getName()).description(toUpdate.getDescription())
.version(toUpdate.getVersion()).requiredMigrationStep(toUpdate.getRequiredMigrationStep()));
.version(toUpdate.getVersion()).locked(toUpdate.getLocked())
.requiredMigrationStep(toUpdate.getRequiredMigrationStep()));
final MgmtDistributionSet response = MgmtDistributionSetMapper.toResponse(updated);
MgmtDistributionSetMapper.addLinks(updated, response);

View File

@@ -115,6 +115,7 @@ public final class MgmtSoftwareModuleMapper {
response.setType(softwareModule.getType().getKey());
response.setTypeName(softwareModule.getType().getName());
response.setVendor(softwareModule.getVendor());
response.setLocked(softwareModule.isLocked());
response.setDeleted(softwareModule.isDeleted());
response.setEncrypted(softwareModule.isEncrypted());

View File

@@ -248,7 +248,9 @@ public class MgmtSoftwareModuleResource implements MgmtSoftwareModuleRestApi {
@RequestBody final MgmtSoftwareModuleRequestBodyPut restSoftwareModule) {
final SoftwareModule module = softwareModuleManagement
.update(entityFactory.softwareModule().update(softwareModuleId)
.description(restSoftwareModule.getDescription()).vendor(restSoftwareModule.getVendor()));
.description(restSoftwareModule.getDescription())
.vendor(restSoftwareModule.getVendor())
.locked(restSoftwareModule.getLocked()));
final MgmtSoftwareModule response = MgmtSoftwareModuleMapper.toResponse(module);
MgmtSoftwareModuleMapper.addLinks(module, response);