summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-requests-db
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-06 21:17:24 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-06 21:17:37 -0500
commit9e795bea4075ab0f5666c173c822f5a443ea5449 (patch)
tree66349bbbe16491ecb3ac7f7f8abc66960146793f /mso-api-handlers/mso-requests-db
parentd109233f1a626d5bbb299209ff94dcee3aac4693 (diff)
store raw distribution notification in db
updated the test case to verify ASDC notification sent is the same as one persisted in the DB and verified it updated the test case to verify ASDC notification sent is the same as one persisted in the DB Added unit test case for WatchdogServiceModVerIdLookup changes Updated test resources schema.sql and data.sql to include changes to watchdog_service_mod_ver_id_lookup table Added length to consumer id column with WatchdogServiceModVerIdLookup class ASDC Controller has been enhanced to include the notification message and consumer id as part of existing table watchdog_service_mod_ver_id_lookup. Change-Id: Iee805761ffc16f456d068c44b53804a7febc7933 Issue-ID: SO-1475 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-requests-db')
-rw-r--r--mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java40
1 files changed, 36 insertions, 4 deletions
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java
index 77089cbbdc..25f5802413 100644
--- a/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/onap/so/db/request/beans/WatchdogServiceModVerIdLookup.java
@@ -22,6 +22,8 @@ package org.onap.so.db.request.beans;
import java.io.Serializable;
import java.util.Date;
+import java.util.Objects;
+import java.util.Optional;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -31,7 +33,7 @@ import javax.persistence.PrePersist;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
-import java.util.Objects;
+
import org.apache.commons.lang3.builder.ToStringBuilder;
@IdClass(WatchdogServiceModVerIdLookupId.class)
@@ -50,6 +52,10 @@ public class WatchdogServiceModVerIdLookup implements Serializable {
@Id
@Column(name = "SERVICE_MODEL_VERSION_ID", length=45)
private String serviceModelVersionId;
+ @Column(name = "DISTRIBUTION_NOTIFICATION")
+ private String distributionNotification;
+ @Column(name = "CONSUMER_ID", length=200)
+ private String consumerId;
@Column(name = "CREATE_TIME", updatable=false)
@Temporal(TemporalType.TIMESTAMP)
private Date createTime;
@@ -57,9 +63,19 @@ public class WatchdogServiceModVerIdLookup implements Serializable {
public WatchdogServiceModVerIdLookup() {
}
- public WatchdogServiceModVerIdLookup(String distributionId, String serviceModelVersionId) {
+ /**
+ *
+ * @param distributionId - Distribution ID
+ * @param serviceModelVersionId -- service UUID
+ * @param distributionNotification -- Notification content from ASDC
+ * @param consumerId -- Consumer ID associated with subscription.
+ */
+ public WatchdogServiceModVerIdLookup(String distributionId, String serviceModelVersionId,
+ Optional<String> distributionNotification, String consumerId) {
this.distributionId = distributionId;
this.serviceModelVersionId = serviceModelVersionId;
+ this.distributionNotification= distributionNotification.orElse(null);
+ this.consumerId = consumerId;
}
public String getDistributionId() {
@@ -104,8 +120,24 @@ public class WatchdogServiceModVerIdLookup implements Serializable {
}
@Override
public String toString() {
- return new ToStringBuilder(this).append("distributionId", getDistributionId())
- .append("serviceModelVersionId", getServiceModelVersionId()).append("createTime", getCreateTime())
+ return new ToStringBuilder(this)
+ .append("distributionId", getDistributionId())
+ .append("serviceModelVersionId", getServiceModelVersionId())
+ .append("createTime", getCreateTime())
+ .append("distributionNotification", getDistributionNotification())
+ .append("consumerId", getConsumerId())
.toString();
}
+ public String getDistributionNotification() {
+ return distributionNotification;
+ }
+ public void setDistributionNotification(String distributionNotification) {
+ this.distributionNotification = distributionNotification;
+ }
+ public String getConsumerId() {
+ return consumerId;
+ }
+ public void setConsumerId(String consumerId) {
+ this.consumerId = consumerId;
+ }
}