summaryrefslogtreecommitdiffstats
path: root/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2020-09-08 14:15:20 +0100
committerwaqas.ikram <waqas.ikram@est.tech>2020-09-08 14:37:08 +0100
commit36982a7db770806b0a3e12d07686b4e3a72a0871 (patch)
tree6245d7a2f5ae91512e06a12b5e9a0eee7c9bf722 /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src
parent332383726cf074facc419588258abff96a9a113f (diff)
Adding NS instantiation
Change-Id: I41d32ddab1ba1e4eea42129a5918bdea3312de94 Issue-ID: SO-2868 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src')
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/State.java2
-rw-r--r--so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java12
3 files changed, 13 insertions, 3 deletions
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
index 7549b49264..cb8f92070a 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/NsLcmOpOcc.java
@@ -65,7 +65,7 @@ public class NsLcmOpOcc {
@Column(name = "IS_AUTO_INNOVATION")
private boolean isAutoInnovation;
- @Column(name = "OPERATION_PARAMS")
+ @Column(name = "OPERATION_PARAMS", columnDefinition = "LONGTEXT")
private String operationParams;
@Column(name = "IS_CANCEL_PENDING")
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/State.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/State.java
index 08dbef3866..390c7fd776 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/State.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/beans/State.java
@@ -24,6 +24,6 @@ package org.onap.so.etsi.nfvo.ns.lcm.database.beans;
*
*/
public enum State {
- NOT_INSTANTIATED, INSTANTIATED;
+ NOT_INSTANTIATED, INSTANTIATING, INSTANTIATED, FAILED;
}
diff --git a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
index 254a3698c9..368242515b 100644
--- a/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
+++ b/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/database/service/DatabaseServiceProvider.java
@@ -81,6 +81,12 @@ public class DatabaseServiceProvider {
return nfvoNsInstRepository.existsNfvoNsInstByName(name);
}
+ public boolean isNsInstExists(final String nsInstId, final String nfName) {
+ logger.info("Checking if NfvoNfInst entry exists in database using nsInstId: {} and nfName: {}", nsInstId,
+ nfName);
+ return nfvoNfInstRepository.findByNsInstNsInstIdAndName(nsInstId, nfName).isEmpty();
+ }
+
public boolean saveNfvoNsInst(final NfvoNsInst nfvoNsInst) {
logger.info("Saving NfvoNsInst: {} to database", nfvoNsInst);
return nfvoNsInstRepository.save(nfvoNsInst) != null;
@@ -116,6 +122,11 @@ public class DatabaseServiceProvider {
return nfvoNfInstRepository.findByNsInstNsInstIdAndName(nsInstId, name);
}
+ public Optional<NfvoNfInst> getNfvoNfInst(final String nfInstId) {
+ logger.info("Querying database for NfvoNfInst using nfInstId: {}", nfInstId);
+ return nfvoNfInstRepository.findByNfInstId(nfInstId);
+ }
+
public boolean addNSLcmOpOcc(final NsLcmOpOcc nsLcmOpOcc) {
logger.info("Adding NSLcmOpOcc: {} to database", nsLcmOpOcc);
return nsLcmOpOccRepository.save(nsLcmOpOcc) != null;
@@ -127,5 +138,4 @@ public class DatabaseServiceProvider {
}
-
}