aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
diff options
context:
space:
mode:
authorDylanB95EST <dylan.byrne@est.tech>2022-01-27 17:12:52 +0000
committerDylan Byrne <dylan.byrne@est.tech>2022-03-01 16:17:16 +0000
commite557338803286d8aaa0f877aa25d52d18735f309 (patch)
tree059b68301b3e6c34d8bb68a8cb7dadf6bed45a06 /cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
parent03459a08895ecc7e481fc5ec34779556268992f1 (diff)
Create Endpoint For Get Cm Handles By Name
Create endpoint and implement logic for get cm handle details by cm handle name Issue-ID: CPS-817 Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java')
-rw-r--r--cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
index 3599213499..ca2f578f46 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServicePropertyHandler.java
@@ -37,7 +37,7 @@ import java.util.regex.Pattern;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.api.CpsDataService;
-import org.onap.cps.ncmp.api.models.CmHandle;
+import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle;
import org.onap.cps.spi.FetchDescendantsOption;
import org.onap.cps.spi.exceptions.DataNodeNotFoundException;
import org.onap.cps.spi.model.DataNode;
@@ -56,28 +56,31 @@ public class NetworkCmProxyDataServicePropertyHandler {
private final CpsDataService cpsDataService;
/**
- * Iterates over incoming cmHandles and update the dataNodes based on the updated attributes.
+ * Iterates over incoming ncmpServiceCmHandles and update the dataNodes based on the updated attributes.
* The attributes which are not passed will remain as is.
*
- * @param cmHandles collection of cmHandles
+ * @param ncmpServiceCmHandles collection of ncmpServiceCmHandles
*/
- public void updateCmHandleProperties(final Collection<CmHandle> cmHandles) throws DataNodeNotFoundException {
- for (final CmHandle cmHandle : cmHandles) {
+ public void updateCmHandleProperties(final Collection<NcmpServiceCmHandle> ncmpServiceCmHandles)
+ throws DataNodeNotFoundException {
+ for (final NcmpServiceCmHandle ncmpServiceCmHandle : ncmpServiceCmHandles) {
try {
- final String cmHandleXpath = String.format(CM_HANDLE_XPATH_TEMPLATE, cmHandle.getCmHandleID());
+ final String cmHandleXpath = String.format(CM_HANDLE_XPATH_TEMPLATE,
+ ncmpServiceCmHandle.getCmHandleID());
final DataNode existingCmHandleDataNode =
cpsDataService.getDataNode(NCMP_DATASPACE_NAME, NCMP_DMI_REGISTRY_ANCHOR, cmHandleXpath,
FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS);
- processUpdates(existingCmHandleDataNode, cmHandle);
+ processUpdates(existingCmHandleDataNode, ncmpServiceCmHandle);
} catch (final DataNodeNotFoundException e) {
- log.error("Unable to find dataNode for cmHandleId : {} , caused by : {}", cmHandle.getCmHandleID(),
+ log.error("Unable to find dataNode for cmHandleId : {} , caused by : {}",
+ ncmpServiceCmHandle.getCmHandleID(),
e.getMessage());
throw e;
}
}
}
- private void processUpdates(final DataNode existingCmHandleDataNode, final CmHandle incomingCmHandle) {
+ private void processUpdates(final DataNode existingCmHandleDataNode, final NcmpServiceCmHandle incomingCmHandle) {
if (!incomingCmHandle.getPublicProperties().isEmpty()) {
updateProperties(existingCmHandleDataNode, PUBLIC_PROPERTY, incomingCmHandle.getPublicProperties());
}