diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java')
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 18 |
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; } |