summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
authorniamhcore <niamh.core@est.tech>2021-09-01 17:12:28 +0100
committeraditya puthuparambil <aditya.puthuparambil@bell.ca>2021-09-06 14:06:16 +0000
commitd0422226b45f752086c9920bdead753c644d9289 (patch)
tree219118e284927589ad69dc4ded6d520e76e77530 /cps-ncmp-service/src/main
parentc27465347d10b573e7a211c0b11b7c8a6fd792c0 (diff)
P1 - Get module name and revision persistence layer
Rename ModuleReference to ExtendedModuleReference Create new ModuleReference class (moduleName and revision) Update existing sync model flow to use new module reference class Create native query to get module name and revision Issue-ID: CPS-485 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I0d0da7742ceef3a68e83a5dd4852091e6adf138b
Diffstat (limited to 'cps-ncmp-service/src/main')
-rwxr-xr-xcps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
index c840c0a7d4..6e1e7275bb 100755
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java
@@ -349,13 +349,13 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
protected void createAnchorAndSyncModel(final PersistenceCmHandle cmHandle) {
final var modulesForCmHandle =
dmiOperations.getResourceFromDmi(cmHandle.getDmiServiceName(), cmHandle.getId(), "modules");
-
- final List<ModuleReference> moduleReferencesFromDmiForCmHandle = getModuleReferences(modulesForCmHandle);
-
- final var knownModuleReferencesInCps = cpsModuleService.getAllYangResourcesModuleReferences();
-
+ final List<ModuleReference> moduleReferencesFromDmiForCmHandle =
+ getModuleReferences(modulesForCmHandle);
+ final var knownModuleReferencesInCps =
+ cpsModuleService.getAllYangResourceModuleReferences(NF_PROXY_DATASPACE_NAME);
final List<ModuleReference> existingModuleReferences = new ArrayList<>();
- for (final ModuleReference moduleReferenceFromDmiForCmHandle : moduleReferencesFromDmiForCmHandle) {
+ for (final ModuleReference moduleReferenceFromDmiForCmHandle :
+ moduleReferencesFromDmiForCmHandle) {
if (knownModuleReferencesInCps.contains(moduleReferenceFromDmiForCmHandle)) {
existingModuleReferences.add(moduleReferenceFromDmiForCmHandle);
}
@@ -396,7 +396,8 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
final JsonObject convertedObject = new Gson().fromJson(response.getBody(), JsonObject.class);
final JsonArray moduleReferencesAsJson = convertedObject.getAsJsonArray("schemas");
for (final JsonElement moduleReferenceAsJson : moduleReferencesAsJson) {
- final ModuleReference moduleReference = toModuleReference((JsonObject) moduleReferenceAsJson);
+ final ModuleReference moduleReference =
+ toModuleReference((JsonObject) moduleReferenceAsJson);
modulesFromDmiForCmHandle.add(moduleReference);
}
return modulesFromDmiForCmHandle;
@@ -404,8 +405,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
private ModuleReference toModuleReference(final JsonObject moduleReferenceAsJson) {
final var moduleReference = new ModuleReference();
- moduleReference.setName(moduleReferenceAsJson.get("moduleName").getAsString());
- moduleReference.setNamespace(NO_NAMESPACE);
+ moduleReference.setModuleName(moduleReferenceAsJson.get("moduleName").getAsString());
moduleReference.setRevision(moduleReferenceAsJson.get("revision").getAsString());
return moduleReference;
}