Search in sources :

Example 1 with UseCaseAdminDeletesExecutorConfiguration

use of com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminDeletesExecutorConfiguration in project sechub by mercedes-benz.

the class DeleteProductExecutorConfigService method deleteProductExecutorConfig.

/* @formatter:off */
@UseCaseAdminDeletesExecutorConfiguration(@Step(number = 2, name = "Service call", description = "Service deletes an existing product executor configuration by its UUID"))
public void deleteProductExecutorConfig(UUID uuid) {
    auditLogService.log("Wants to removed product execution {}", uuid);
    Optional<ProductExecutorConfig> opt = repository.findById(uuid);
    if (!opt.isPresent()) {
        LOG.info("Delete canceled, because executor config with uuid {} did not exist", uuid);
        ;
        return;
    }
    ProductExecutorConfig found = opt.get();
    String name = found.getName();
    ProductIdentifier productIdentifier = found.getProductIdentifier();
    Integer executorVersion = found.getExecutorVersion();
    repository.deleteById(uuid);
    LOG.info("Removed product execution config uuid:{}, name:{} which was for product:{} V{}", uuid, name, productIdentifier, executorVersion);
}
Also used : ProductIdentifier(com.mercedesbenz.sechub.domain.scan.product.ProductIdentifier) UseCaseAdminDeletesExecutorConfiguration(com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminDeletesExecutorConfiguration)

Aggregations

ProductIdentifier (com.mercedesbenz.sechub.domain.scan.product.ProductIdentifier)1 UseCaseAdminDeletesExecutorConfiguration (com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdminDeletesExecutorConfiguration)1