diff options
Diffstat (limited to 'cps-ncmp-service/src/main/java/org')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java | 9 | ||||
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 18 |
2 files changed, 27 insertions, 0 deletions
diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java index 058c42b7b9..7527ae5c50 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java @@ -26,6 +26,7 @@ package org.onap.cps.ncmp.api; import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum; import java.util.Collection; +import java.util.Map; import java.util.Set; import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; @@ -122,6 +123,14 @@ public interface NetworkCmProxyDataService { NcmpServiceCmHandle getNcmpServiceCmHandle(String cmHandleId); /** + * Get cm handle public properties by cm handle id. + * + * @param cmHandleId cm handle identifier + * @return a collection of cm handle public properties. + */ + Map<String, String> getCmHandlePublicProperties(String cmHandleId); + + /** * Query and return cm handles that match the given query parameters. * * @param cmHandleQueryApiParameters the cm handle query parameters 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 c0f73d92d6..0e748c7fe7 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 @@ -34,6 +34,7 @@ import static org.onap.cps.spi.CascadeDeleteAllowed.CASCADE_DELETE_ALLOWED; import com.google.common.base.Strings; import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -194,6 +195,23 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } /** + * Get cm handle public properties for a given cm handle id. + * + * @param cmHandleId cm handle identifier + * @return cm handle public properties + */ + @Override + public Map<String, String> getCmHandlePublicProperties(final String cmHandleId) { + CpsValidator.validateNameCharacters(cmHandleId); + final YangModelCmHandle yangModelCmHandle = + yangModelCmHandleRetriever.getYangModelCmHandle(cmHandleId); + final List<YangModelCmHandle.Property> yangModelPublicProperties = yangModelCmHandle.getPublicProperties(); + final Map<String, String> cmHandlePublicProperties = new HashMap<>(); + asPropertiesMap(yangModelPublicProperties, cmHandlePublicProperties); + return cmHandlePublicProperties; + } + + /** * THis method registers a cm handle and initiates modules sync. * * @param dmiPluginRegistration dmi plugin registration information. |