Search in sources :

Example 1 with AbstractRelationshipTask

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

the class TopologyAbstractRelationshipValidationService method getTaskListFromMapArray.

/**
 * Constructs a TopologyTask list given a Map (node template name => component) and the code
 */
private <T extends AbstractInheritableToscaType> List<AbstractRelationshipTask> getTaskListFromMapArray(Map<String, T[]> components, TaskCode taskCode) {
    List<AbstractRelationshipTask> taskList = Lists.newArrayList();
    for (Map.Entry<String, T[]> entry : components.entrySet()) {
        for (AbstractInheritableToscaType compo : entry.getValue()) {
            AbstractRelationshipTask task = new AbstractRelationshipTask();
            task.setNodeTemplateName(entry.getKey());
            task.setComponent(compo);
            task.setCode(taskCode);
            taskList.add(task);
        }
    }
    if (taskList.isEmpty()) {
        return null;
    } else {
        return taskList;
    }
}
Also used : AbstractInheritableToscaType(org.alien4cloud.tosca.model.types.AbstractInheritableToscaType) AbstractRelationshipTask(alien4cloud.topology.task.AbstractRelationshipTask) Map(java.util.Map)

Aggregations

AbstractRelationshipTask (alien4cloud.topology.task.AbstractRelationshipTask)1 Map (java.util.Map)1 AbstractInheritableToscaType (org.alien4cloud.tosca.model.types.AbstractInheritableToscaType)1