if (parentOas == null) { parentOas = Maps.newHashMap(); parent.setOutputAttributes(parentOas);
@Override protected void processNodeOperation(Csar csar, Topology topology, UnSetNodeAttributeAsOutputOperation operation, NodeTemplate nodeTemplate) { // check if the attribute exists check(operation, topology, nodeTemplate); Map<String, Set<String>> outputs = topology.getOutputAttributes(); removeAndClean(operation, outputs); topology.setOutputAttributes(outputs); log.debug("Unset node [ {} ]'s attribute [ {} ] as output for the topology [ {} ].", operation.getNodeName(), operation.getAttributeName(), topology.getId()); }
@Override protected void processNodeOperation(Csar csar, Topology topology, SetNodeAttributeAsOutputOperation operation, NodeTemplate nodeTemplate) { // check if the attribute exists Map<String, IValue> attributes = nodeTemplate.getAttributes(); if (!AlienUtils.safe(attributes).containsKey(operation.getAttributeName())) { throw new NotFoundException("Attribute " + operation.getAttributeName() + "not found in node template " + operation.getNodeName() + "."); } Map<String, Set<String>> outputs = topology.getOutputAttributes(); if (outputs == null) { outputs = Maps.newHashMap(); } if (outputs.containsKey(operation.getNodeName())) { outputs.get(operation.getNodeName()).add(operation.getAttributeName()); } else { outputs.put(operation.getNodeName(), Sets.newHashSet(operation.getAttributeName())); } topology.setOutputAttributes(outputs); log.debug("Set node [ {} ]'s attribute [ {} ] as output for the topology [ {} ].", operation.getNodeName(), operation.getAttributeName(), topology.getId()); }
topology.setOutputAttributes(outputAttributes); topology.setOutputCapabilityProperties(ouputCapabilityProperties);