}
private List<Map<String, Map<String, String>>> getDefaultToscaImports(final String modelId) {
- if (modelId == null) {
+ if (StringUtils.isEmpty(modelId)) {
return getDefaultToscaImportConfig();
}
}
}
- private Map<String, String> convertMetadata(Component component) {
+ private Map<String, Object> convertMetadata(Component component) {
return convertMetadata(component, false, null);
}
- private Map<String, String> convertMetadata(Component component, boolean isInstance, ComponentInstance componentInstance) {
- Map<String, String> toscaMetadata = new LinkedHashMap<>();
+ private Map<String, Object> convertMetadata(Component component, boolean isInstance, ComponentInstance componentInstance) {
+ Map<String, Object> toscaMetadata = new LinkedHashMap<>();
toscaMetadata.put(convertMetadataKey(JsonPresentationFields.INVARIANT_UUID), component.getInvariantUUID());
toscaMetadata.put(JsonPresentationFields.UUID.getPresentation(), component.getUUID());
toscaMetadata
}
toscaMetadata.put(JsonPresentationFields.RESOURCE_VENDOR_RELEASE.getPresentation(), resource.getVendorRelease());
toscaMetadata.put(JsonPresentationFields.RESOURCE_VENDOR_MODEL_NUMBER.getPresentation(), resource.getResourceVendorModelNumber());
+ toscaMetadata.put(resource.isTopologyTemplate() ? JsonPresentationFields.TEMPLATE_VERSION.getPresentation() : JsonPresentationFields.VERSION.getPresentation(), resource.getVersion());
break;
case SERVICE:
Service service = (Service) component;
toscaMetadata.put(JsonPresentationFields.SERVICE_ROLE.getPresentation(), service.getServiceRole());
toscaMetadata.put(JsonPresentationFields.SERVICE_FUNCTION.getPresentation(), service.getServiceFunction());
toscaMetadata.put(JsonPresentationFields.ENVIRONMENT_CONTEXT.getPresentation(), service.getEnvironmentContext());
+ toscaMetadata.put(JsonPresentationFields.TEMPLATE_VERSION.getPresentation(), service.getVersion());
toscaMetadata.put(JsonPresentationFields.INSTANTIATION_TYPE.getPresentation(),
service.getEnvironmentContext() == null ? StringUtils.EMPTY : service.getInstantiationType());
if (!isInstance) {
- // DE268546
- toscaMetadata.put(JsonPresentationFields.ECOMP_GENERATED_NAMING.getPresentation(), service.isEcompGeneratedNaming().toString());
- toscaMetadata.put(JsonPresentationFields.ECOMP_GENERATED_NAMING.getPresentation(), service.isEcompGeneratedNaming().toString());
+ toscaMetadata.put(JsonPresentationFields.ECOMP_GENERATED_NAMING.getPresentation(), service.isEcompGeneratedNaming());
toscaMetadata.put(JsonPresentationFields.NAMING_POLICY.getPresentation(), service.getNamingPolicy());
}
break;