summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'cps-ncmp-service/src/main')
-rwxr-xr-xcps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java16
1 files changed, 11 insertions, 5 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 a37b27199c..b2c71941c5 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
@@ -389,11 +389,7 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
}
});
- final List<CmHandleRegistrationResponse> cmHandleRegistrationResponses
- = upgradeCmHandles(cmHandleStatePerCmHandle);
- cmHandleRegistrationResponses.addAll(CmHandleRegistrationResponse.createFailureResponses(notReadyCmHandles,
- CM_HANDLES_NOT_READY));
- return cmHandleRegistrationResponses;
+ return prepareAndGetCmHandleUpgradeResponses(cmHandleStatePerCmHandle, notReadyCmHandles);
}
private CmHandleRegistrationResponse deleteCmHandleAndGetCmHandleRegistrationResponse(final String cmHandleId) {
@@ -462,6 +458,16 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService
}
}
+ private List<CmHandleRegistrationResponse> prepareAndGetCmHandleUpgradeResponses(final Map<YangModelCmHandle,
+ CmHandleState> cmHandleStatePerCmHandle, final Collection<String> notReadyCmHandles) {
+ final List<CmHandleRegistrationResponse> cmHandleRegistrationResponses
+ = upgradeCmHandles(cmHandleStatePerCmHandle);
+ final List<CmHandleRegistrationResponse> failedCmHandleRegistrationResponses
+ = CmHandleRegistrationResponse.createFailureResponses(notReadyCmHandles, CM_HANDLES_NOT_READY);
+ failedCmHandleRegistrationResponses.forEach(cmHandleRegistrationResponses::add);
+ return cmHandleRegistrationResponses;
+ }
+
private List<CmHandleRegistrationResponse> upgradeCmHandles(final Map<YangModelCmHandle, CmHandleState>
cmHandleStatePerCmHandle) {
final List<String> cmHandleIds = getCmHandleIds(cmHandleStatePerCmHandle);