summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-tosca-converter-lib
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib')
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java54
-rw-r--r--openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/resources/ToscaConverters.json3
2 files changed, 0 insertions, 57 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java
deleted file mode 100644
index 4917533dd8..0000000000
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterManagerImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.openecomp.core.impl;
-
-import org.openecomp.core.converter.ToscaConverter;
-import org.openecomp.core.converter.api.ToscaConverterManager;
-import org.openecomp.core.utilities.file.FileContentHandler;
-import org.openecomp.core.utilities.file.FileUtils;
-import org.openecomp.core.utilities.json.JsonUtil;
-import org.openecomp.sdc.logging.api.Logger;
-import org.openecomp.sdc.logging.api.LoggerFactory;
-import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class ToscaConverterManagerImpl implements ToscaConverterManager {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(ToscaConverterManagerImpl.class.getName());
- private static List<ToscaConverter> toscaConverters;
- private static final String toscaConverterFileName = "ToscaConverters.json";
- private static final String TOSCA_CONVERTER_IMPL_FORMAT_ERROR = "Failed to construct TOSCA converter for '%s' implementation.";
-
- static {
- toscaConverters = getConvertersList();
- }
-
- @Override
- public ToscaServiceModel convert(String csarName, FileContentHandler fileContentHandler) {
- return null;
- }
-
- private static List<ToscaConverter> getConvertersList(){
- List<ToscaConverter> toscaConvertersList = new ArrayList<>();
- Map<String, String> convertersMap = FileUtils.readViaInputStream(toscaConverterFileName,
- stream -> JsonUtil.json2Object(stream, Map.class));
- return getToscaConvertersList(toscaConvertersList, convertersMap);
- }
-
- private static List<ToscaConverter> getToscaConvertersList(
- List<ToscaConverter> toscaConvertersList, Map<String, String> convertersMap) {
- for(String implClassName : convertersMap.values()){
- try{
- Class<?> clazz = Class.forName(implClassName);
- Constructor<?> constructor = clazz.getConstructor();
- toscaConvertersList.add((ToscaConverter) constructor.newInstance());
- }catch (Exception ex){
- LOGGER.debug(String.format(TOSCA_CONVERTER_IMPL_FORMAT_ERROR, implClassName), ex);
- continue;
- }
- }
- return toscaConvertersList;
- }
-}
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/resources/ToscaConverters.json b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/resources/ToscaConverters.json
deleted file mode 100644
index e1cddeb854..0000000000
--- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/resources/ToscaConverters.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "ToscaConverter" : "org.openecomp.core.converter.impl.ToscaConverterImpl"
-} \ No newline at end of file