}
public Either<ToscaRepresentation, ToscaError> exportComponentInterface(Component component) {
+ if(null == DEFAULT_IMPORTS) {
+ log.debug("convertToToscaTemplate - failed to get Default Imports section from configuration");
+ return Either.right(ToscaError.GENERAL_ERROR);
+ }
+
ToscaTemplate toscaTemplate = new ToscaTemplate(TOSCA_VERSION);
toscaTemplate.setImports(new ArrayList<>(DEFAULT_IMPORTS));
Map<String, ToscaNodeType> nodeTypes = new HashMap<>();
}
private Either<ToscaTemplate, ToscaError> convertToToscaTemplate(Component component) {
+ if(null == DEFAULT_IMPORTS) {
+ log.debug("convertToToscaTemplate - failed to get Default Imports section from configuration");
+ return Either.right(ToscaError.GENERAL_ERROR);
+ }
+
log.trace("start tosca export for {}", component.getUniqueId());
ToscaTemplate toscaTemplate = new ToscaTemplate(TOSCA_VERSION);
private Either<ImmutablePair<ToscaTemplate, Map<String, Component>>, ToscaError> fillImports(Component component,
ToscaTemplate toscaTemplate) {
+
+ if(null == DEFAULT_IMPORTS) {
+ log.debug("convertToToscaTemplate - failed to get Default Imports section from configuration");
+ return Either.right(ToscaError.GENERAL_ERROR);
+ }
+
Map<String, Component> componentCache = new HashMap<>();
if (!ToscaUtils.isAtomicType(component)) {
}
for (GroupInstance groupInst : groupInstances) {
ToscaGroupTemplate toscaGroup = convertGroupInstance(groupInst);
- String keyName = groupInst.getGroupName();
- groupsMap.put(keyName, toscaGroup);
+ groupsMap.put(groupInst.getName(), toscaGroup);
}
}
ToscaGroupTemplate toscaGroup = new ToscaGroupTemplate();
Map<String, String> members = group.getMembers();
if (members != null)
- toscaGroup.setMembers(new ArrayList(members.keySet()));
+ toscaGroup.setMembers(new ArrayList<String>(members.keySet()));
Supplier<String> supplGroupType = () -> group.getType();
Supplier<String> supplDescription = () -> group.getDescription();