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.java10
3 files changed, 12 insertions, 2 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 cb8f92070a..c47bbdbefb 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
@@ -216,7 +216,7 @@ public class NsLcmOpOcc {
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
- sb.append("class NfvoNsInst {\n");
+ sb.append("class NsLcmOpOcc {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" operationState: ").append(toIndentedString(operationState)).append("\n");
sb.append(" stateEnteredTime: ").append(toIndentedString(stateEnteredTime)).append("\n");
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 390c7fd776..ce917dd771 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, INSTANTIATING, INSTANTIATED, FAILED;
+ NOT_INSTANTIATED, INSTANTIATING, INSTANTIATED, FAILED, TERMINATING;
}
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 368242515b..762408a089 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
@@ -127,6 +127,16 @@ public class DatabaseServiceProvider {
return nfvoNfInstRepository.findByNfInstId(nfInstId);
}
+ public boolean isNfInstExists(final String nfInstId) {
+ logger.info("Checking if NfvoNfInst entry exists in database using nfInstId: {}", nfInstId);
+ return nfvoNfInstRepository.findByNfInstId(nfInstId).isPresent();
+ }
+
+ public void deleteNfvoNfInst(final String nfInstId) {
+ logger.info("Deleting NfvoNfInst with nfInstId: {} from database", nfInstId);
+ nfvoNfInstRepository.deleteById(nfInstId);
+ }
+
public boolean addNSLcmOpOcc(final NsLcmOpOcc nsLcmOpOcc) {
logger.info("Adding NSLcmOpOcc: {} to database", nsLcmOpOcc);
return nsLcmOpOccRepository.save(nsLcmOpOcc) != null;