Merge "Issue-ID: PORTAL-913 optimization in git clone using --depth"
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / scheduleraux / SchedulerAuxRestInt.java
index 18f4ce8..f120c4f 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
  *
  * Unless otherwise specified, all software contained herein is licensed
  * under the Apache License, Version 2.0 (the "License");
  *
  * ============LICENSE_END============================================
  *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 
 package org.onap.portalapp.portal.scheduleraux;
 
-import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import org.onap.portalapp.portal.scheduler.policy.rest.RequestDetails;
+import org.onap.portalapp.util.DateUtil;
 import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -51,15 +53,9 @@ public class SchedulerAuxRestInt {
        
        /** The logger. */
        EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxRestInterface.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /** The request date format. */
-       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-       
+
        public SchedulerAuxRestInt() {
-               requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
+               DateUtil.getRequestDateFormat().setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
        }
 
        /**
@@ -67,19 +63,21 @@ public class SchedulerAuxRestInt {
         *
         * @param r the r
         */
-       public void logRequest ( RequestDetails r ) {
-       String methodName = "logRequest";
-           ObjectMapper mapper = new ObjectMapper();
-           String r_json_str = "";
-           if ( r != null ) {
-               r_json_str = r.toString();
-                   try {
-                       r_json_str = mapper.writeValueAsString(r);
-                   }
-                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-                   }
-           }
-           logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
+    public void logRequest(RequestDetails r) {
+        SimpleDateFormat dateFormat = DateUtil.getDateFormat();
+        String methodName = "logRequest";
+        ObjectMapper mapper = new ObjectMapper();
+        String rJsonStr = "";
+        if (r != null) {
+            rJsonStr = r.toString();
+            try {
+                rJsonStr = mapper.writeValueAsString(r);
+            } catch (com.fasterxml.jackson.core.JsonProcessingException j) {
+                logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== "
+                        + methodName + " " + "Unable to " + "parse request as json", j);
+            }
+        }
+        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== "
+                + methodName + " Request=" + "(" + rJsonStr + ")");
     }
-}
\ No newline at end of file
+}