Upgraded to Support VES 7.0
[dcaegen2/services/mapper.git] / UniversalVesAdapter / src / main / java / org / onap / universalvesadapter / utils / SmooksUtils.java
index 8c17dc2..9b341d5 100644 (file)
@@ -27,7 +27,7 @@ import javax.xml.transform.stream.StreamSource;
 import org.milyn.Smooks;
 import org.milyn.container.ExecutionContext;
 import org.milyn.payload.StringResult;
-import org.onap.dcaegen2.ves.domain.VesEvent;
+import org.onap.dcaegen2.ves.domain.ves7_0.VesEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,10 +38,13 @@ import org.slf4j.LoggerFactory;
  * @author kmalbari
  *
  */
+
+
 public class SmooksUtils {
 
        
-       private final static Logger LOGGER = LoggerFactory.getLogger(SmooksUtils.class);        
+        private static final Logger debugLogger = LoggerFactory.getLogger("debugLogger");
+        private static final Logger errorLogger = LoggerFactory.getLogger("errorLogger");      
        
        /**
         * converts the incoming json using passed smooks instance and return the pojo representation of VES event
@@ -53,23 +56,19 @@ public class SmooksUtils {
         */
        public static VesEvent getTransformedObjectForInput(Smooks smooks, String incomingJsonString) {
                
-               LOGGER.debug("Transforming json " + incomingJsonString);
+               debugLogger.info("Transforming incoming json " );
                ExecutionContext executionContext = smooks.createExecutionContext();
-               LOGGER.debug("Context created");
+               debugLogger.info("Context created");
                Locale defaultLocale = Locale.getDefault();
         Locale.setDefault(new Locale("en", "IE"));
 
         StringResult result = new StringResult();
 
-        // Configure the execution context to generate a report...
-//        executionContext.setEventListener(new HtmlReportGenerator("target/report/report.html"));
-
-        // Filter the input message to the outputWriter, using the execution context...
         smooks.filterSource(executionContext, new StreamSource(new ByteArrayInputStream(incomingJsonString.getBytes(StandardCharsets.UTF_8))), result);
-        LOGGER.debug("Transformed incoming json now");
+       
         Locale.setDefault(defaultLocale);
         VesEvent vesEvent = (VesEvent) executionContext.getBeanContext().getBean("vesEvent");
-        LOGGER.debug("Converted vesEvent from incoming json"); 
+        debugLogger.debug("consversion successful to VES Event"); 
         
                return vesEvent;
        }