aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db/src/main/java
diff options
context:
space:
mode:
authorc00149107 <chenchuanyu@huawei.com>2017-10-18 11:48:21 +0800
committerc00149107 <chenchuanyu@huawei.com>2017-10-19 14:12:16 +0800
commita13d6f4c3dd6d4c38d1f9cd97ac9fd377f580a4b (patch)
treea370ad9261b9cde7455a1cc3bf80444a58ecf5ce /mso-api-handlers/mso-requests-db/src/main/java
parent61354fab1e3c8783fd6a2ff5fcf7d1997fd999b5 (diff)
Deal With Error Response from Vfc
Deal With Error Response from Vfc Change-Id: Id5ce999d561099581b49524969c901ac6dac3f90 Issue-ID:SO-233 Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db/src/main/java')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java55
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java2
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java60
3 files changed, 113 insertions, 4 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java
index 010b79d38d..796a3f90fe 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/OperationStatus.java
@@ -19,6 +19,7 @@
*/
package org.openecomp.mso.requestsdb;
+import java.io.Serializable;
import java.sql.Timestamp;
/**
@@ -30,8 +31,13 @@ import java.sql.Timestamp;
* @author
* @version ONAP Amsterdam Release 2017-08-28
*/
-public class OperationStatus {
+public class OperationStatus implements Serializable{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
private String serviceId;
private String operationId;
@@ -152,4 +158,51 @@ public class OperationStatus {
this.finishedAt = finishedAt;
}
+
+ /**
+ * <br>
+ *
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
+ result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
+ return result;
+ }
+
+
+ /**
+ * <br>
+ *
+ * @param obj
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj)
+ return true;
+ if(obj == null)
+ return false;
+ if(getClass() != obj.getClass())
+ return false;
+ OperationStatus other = (OperationStatus)obj;
+ if(operationId == null) {
+ if(other.operationId != null)
+ return false;
+ } else if(!operationId.equals(other.operationId))
+ return false;
+ if(serviceId == null) {
+ if(other.serviceId != null)
+ return false;
+ } else if(!serviceId.equals(other.serviceId))
+ return false;
+ return true;
+ }
+
+
}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
index b426c39176..c6f0cea993 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
@@ -647,7 +647,7 @@ public class RequestsDatabase {
+ operStatus.getResourceTemplateUUID());
try {
String hql =
- "FROM ResourceOperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id and RESOURCE_TEMPLATE_UUID = : res_uuid";
+ "FROM ResourceOperationStatus WHERE SERVICE_ID = :service_id and OPERATION_ID = :operation_id and RESOURCE_TEMPLATE_UUID = :res_uuid";
Query query = session.createQuery(hql);
query.setParameter("service_id", operStatus.getServiceId());
query.setParameter("operation_id", operStatus.getOperationId());
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java
index 298eb9cf4b..2e91397d14 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/ResourceOperationStatus.java
@@ -19,6 +19,8 @@
*/
package org.openecomp.mso.requestsdb;
+import java.io.Serializable;
+
/**
* The Resource operation status
* <br>
@@ -28,7 +30,12 @@ package org.openecomp.mso.requestsdb;
* @author
* @version ONAP Amsterdam Release 2017-08-28
*/
-public class ResourceOperationStatus {
+public class ResourceOperationStatus implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
private String serviceId;
@@ -161,6 +168,55 @@ public class ResourceOperationStatus {
public void setOperType(String operType) {
this.operType = operType;
}
-
+
+ /**
+ * <br>
+ *
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((operationId == null) ? 0 : operationId.hashCode());
+ result = prime * result + ((resourceTemplateUUID == null) ? 0 : resourceTemplateUUID.hashCode());
+ result = prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
+ return result;
+ }
+
+ /**
+ * <br>
+ *
+ * @param obj
+ * @return
+ * @since ONAP Amsterdam Release
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj)
+ return true;
+ if(obj == null)
+ return false;
+ if(getClass() != obj.getClass())
+ return false;
+ ResourceOperationStatus other = (ResourceOperationStatus)obj;
+ if(operationId == null) {
+ if(other.operationId != null)
+ return false;
+ } else if(!operationId.equals(other.operationId))
+ return false;
+ if(resourceTemplateUUID == null) {
+ if(other.resourceTemplateUUID != null)
+ return false;
+ } else if(!resourceTemplateUUID.equals(other.resourceTemplateUUID))
+ return false;
+ if(serviceId == null) {
+ if(other.serviceId != null)
+ return false;
+ } else if(!serviceId.equals(other.serviceId))
+ return false;
+ return true;
+ }
}