Enhancements for the aai-common library
[aai/aai-common.git] / aai-els-onap-logging / src / main / java / org / onap / aai / logging / ErrorObject.java
@@ -38,6 +38,7 @@ public class ErrorObject {
     private String errorCode;
     private String errorText;
     private String details;
+    private String aaiElsErrorCode = AaiElsErrorCode.UNKNOWN_ERROR;
 
     /**
      * Instantiates a new error object.
@@ -47,7 +48,7 @@ public class ErrorObject {
     }
 
     /**
-     * Creates an error object with the default HTTP Error Code (Status.INTERNAL_SERVER_ERROR)
+     * Creates an error object
      *
      * @param disposition the disposition
      * @param category the category
@@ -67,13 +68,13 @@ public class ErrorObject {
         this.setRESTErrorCode(restErrorCode);
         this.setErrorCode(errorCode);
         this.setErrorText(errorText);
+        this.setAaiElsErrorCode(AaiElsErrorCode.UNKNOWN_ERROR);
     }
 
     // OLD STARTS HERE
 
     /**
      * Instantiates a new error object.
-     *
      * @param severity the severity
      * @param errorCode the error code
      * @param errorText the error text
@@ -103,6 +104,7 @@ public class ErrorObject {
         this.setErrorText(errorText);
         this.setDisposition(disposition);
         this.setCategory(category);
+        this.setAaiElsErrorCode(AaiElsErrorCode.UNKNOWN_ERROR);
     }
 
     /**
@@ -124,6 +126,7 @@ public class ErrorObject {
         this.setErrorText(errorText);
         this.setDisposition(disposition);
         this.setCategory(category);
+        this.setAaiElsErrorCode(AaiElsErrorCode.UNKNOWN_ERROR);
     }
 
     /**
@@ -302,7 +305,22 @@ public class ErrorObject {
     public void setDetails(String details) {
         this.details = details == null ? "" : details;
     }
-
+    /**
+     * Sets the aai els error code.
+     *
+     * @param elsErrorCode the new code
+     */
+    public void setAaiElsErrorCode(String elsErrorCode) {
+        aaiElsErrorCode = elsErrorCode;
+    }
+    /**
+     * Gets the aai els error code.
+     *
+     * @return the code
+     */
+    public String getAaiElsErrorCode() {
+        return (aaiElsErrorCode);
+    }
     /**
      * Gets the error code string. This is also the string
      * configured in Nagios to alert on