use of com.sequenceiq.cloudbreak.api.endpoint.v4.common.ResourceStatus.DEFAULT_DELETED in project cloudbreak by hortonworks.
the class BlueprintLoaderService method deleteOldDefaults.
public void deleteOldDefaults(Set<Blueprint> blueprintsInDatabase) {
List<Blueprint> deletableDefaults = blueprintsInDatabase.stream().filter(blueprint -> blueprint.getStatus().equals(DEFAULT)).filter(blueprint -> !defaultBlueprintCache.defaultBlueprints().containsKey(blueprint.getName())).filter(blueprint -> clusterTemplateService.getTemplatesByBlueprint(blueprint).isEmpty()).collect(Collectors.toList());
LOGGER.info("Put old default blueprints to DEFAULT_DELETED: " + deletableDefaults);
for (Blueprint blueprint : deletableDefaults) {
blueprint.setStatus(DEFAULT_DELETED);
}
blueprintService.pureSaveAll(deletableDefaults);
}
Aggregations