aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java
new file mode 100644
index 0000000000..6347bc2eaf
--- /dev/null
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/exceptions/ComponentException.java
@@ -0,0 +1,44 @@
+package org.openecomp.sdc.be.components.impl.exceptions;
+
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.exception.ResponseFormat;
+
+public class ComponentException extends RuntimeException {
+
+ /**
+ * This class will be initialized either by action status and params or by ResponseFormat
+ */
+
+ private final transient ResponseFormat responseFormat;
+
+ private final ActionStatus actionStatus;
+ private final String[] params;
+
+ public ComponentException(ResponseFormat responseFormat) {
+ this(responseFormat, ActionStatus.OK, null);
+ }
+
+ public ComponentException(ActionStatus actionStatus, String... params) {
+ this(null, actionStatus, params);
+ }
+
+ private ComponentException(ResponseFormat responseFormat, ActionStatus actionStatus, String... params) {
+ this.actionStatus = actionStatus;
+ this.params = params;
+ this.responseFormat = responseFormat;
+ }
+
+ public ResponseFormat getResponseFormat() {
+ return responseFormat;
+ }
+
+ public ActionStatus getActionStatus() {
+ return actionStatus;
+ }
+
+ public String[] getParams() {
+ return params;
+ }
+
+
+}