diff options
Diffstat (limited to 'cps-ncmp-rest/src/main/java/org/onap')
2 files changed, 18 insertions, 1 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java index 118fa45263..eb48754b4f 100644 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NcmpRestInputMapper.java @@ -25,8 +25,10 @@ import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.NullValueCheckStrategy; import org.mapstruct.NullValuePropertyMappingStrategy; +import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; +import org.onap.cps.ncmp.rest.model.CmHandleQueryParameters; import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration; import org.onap.cps.ncmp.rest.model.RestInputCmHandle; import org.onap.cps.ncmp.rest.model.RestModuleDefinition; @@ -59,4 +61,7 @@ public interface NcmpRestInputMapper { @InheritConfiguration(name = "toRestModuleReference") RestModuleDefinition toRestModuleDefinition( final ModuleDefinition moduleDefinition); -}
\ No newline at end of file + + CmHandleQueryServiceParameters toCmHandleQueryServiceParameters( + final CmHandleQueryParameters cmHandleQueryParameters); +} diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java index 0c428e4423..98da15093c 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyInventoryController.java @@ -27,10 +27,12 @@ import java.util.stream.Collectors; import javax.validation.Valid; import lombok.RequiredArgsConstructor; import org.onap.cps.ncmp.api.NetworkCmProxyDataService; +import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse; import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse.Status; import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse; import org.onap.cps.ncmp.rest.api.NetworkCmProxyInventoryApi; +import org.onap.cps.ncmp.rest.model.CmHandleQueryParameters; import org.onap.cps.ncmp.rest.model.CmHandlerRegistrationErrorResponse; import org.onap.cps.ncmp.rest.model.DmiPluginRegistrationErrorResponse; import org.onap.cps.ncmp.rest.model.RestDmiPluginRegistration; @@ -47,6 +49,16 @@ public class NetworkCmProxyInventoryController implements NetworkCmProxyInventor private final NetworkCmProxyDataService networkCmProxyDataService; private final NcmpRestInputMapper ncmpRestInputMapper; + @Override + public ResponseEntity<List<String>> searchCmHandleIds(final CmHandleQueryParameters cmHandleQueryParameters) { + final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = ncmpRestInputMapper + .toCmHandleQueryServiceParameters(cmHandleQueryParameters); + + final Set<String> cmHandleIds = networkCmProxyDataService + .executeCmHandleIdSearchForInventory(cmHandleQueryServiceParameters); + return ResponseEntity.ok(List.copyOf(cmHandleIds)); + } + /** * Get all cm-handle IDs under a registered DMI plugin. * |