diff options
author | Byung-Woo Jun <byung-woo.jun@est.tech> | 2020-09-25 11:23:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-09-25 11:23:13 +0000 |
commit | 0f8b52fead32497543616b1d42d46e7319b22059 (patch) | |
tree | d6f991c7db6730845d927d7bf8009124025247bd /so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main | |
parent | 924bf901cd966e20eaf2412f576ebc4a0a31fb8c (diff) | |
parent | b4b7e11715b8dbeda752229012d8cdc00ed5c32f (diff) |
Merge "Terminate NS Backend Service"
Diffstat (limited to 'so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-database-service/src/main')
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; |