aboutsummaryrefslogtreecommitdiffstats
path: root/so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service
diff options
context:
space:
mode:
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service')
-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 {
}
-
}