Fixed Checkstyle issues
[clamp.git] / src / main / java / org / onap / clamp / clds / service / SecureServiceBase.java
index f653089..0e28a4b 100644 (file)
@@ -30,6 +30,8 @@ import java.util.Date;
 import javax.ws.rs.NotAuthorizedException;
 
 import org.onap.clamp.clds.util.LoggingUtils;
+import org.onap.clamp.clds.util.ONAPLogConstants;
+import org.slf4j.event.Level;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContext;
@@ -206,4 +208,19 @@ public abstract class SecureServiceBase {
 
         return false;
     }
+
+    protected void auditLogInfo(LoggingUtils util, String actionDescription, Date startTime) {
+        LoggingUtils.setTimeContext(startTime, new Date());
+        auditLogger.info(actionDescription + " completed");
+        util.exiting("200", actionDescription + " success", Level.INFO,
+            ONAPLogConstants.ResponseStatus.COMPLETED);
+    }
+
+    protected void auditLogInfo(String actionDescription, Date startTime) {
+
+        LoggingUtils.setTimeContext(startTime, new Date());
+        LoggingUtils.setResponseContext("0", actionDescription + " success",
+            this.getClass().getName());
+        auditLogger.info(actionDescription + " completed");
+    }
 }
\ No newline at end of file