Search in sources :

Example 1 with EmptyTask

use of alien4cloud.topology.task.EmptyTask in project alien4cloud by alien4cloud.

the class TopologyValidationService method doValidate.

private TopologyValidationResult doValidate(Topology topology) {
    TopologyValidationResult dto = new TopologyValidationResult();
    if (MapUtils.isEmpty(topology.getNodeTemplates())) {
        dto.addTask(new EmptyTask());
        dto.setValid(false);
        return dto;
    }
    // validate the workflows
    dto.addTasks(workflowBuilderService.validateWorkflows(topology));
    // validate abstract relationships
    dto.addTasks(topologyAbstractRelationshipValidationService.validateAbstractRelationships(topology));
    // validate requirements lowerBounds
    dto.addTasks(topologyRequirementBoundsValidationServices.validateRequirementsLowerBounds(topology));
    // validate the node filters for all relationships
    dto.addTasks(nodeFilterValidationService.validateStaticRequirementFilters(topology));
    // validate that all artifacts has been filled
    dto.addTasks(topologyArtifactsValidationService.validate(topology));
    // Add warning for deprecated nodes.
    dto.addWarnings(deprecatedNodeTypesValidationService.validate(topology));
    // validate required properties (properties of NodeTemplate, Relationship and Capability)
    List<PropertiesTask> validateProperties = topologyPropertiesValidationService.validateStaticProperties(topology);
    // List<PropertiesTask> validateProperties = null;
    if (hasOnlyPropertiesWarnings(validateProperties)) {
        dto.addWarnings(validateProperties);
    } else {
        dto.addTasks(validateProperties);
    }
    dto.setValid(isValidTaskList(dto.getTaskList()));
    return dto;
}
Also used : PropertiesTask(alien4cloud.topology.task.PropertiesTask) EmptyTask(alien4cloud.topology.task.EmptyTask)

Aggregations

EmptyTask (alien4cloud.topology.task.EmptyTask)1 PropertiesTask (alien4cloud.topology.task.PropertiesTask)1