import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.api.CpsDataService;
-import org.onap.cps.ncmp.api.NetworkCmProxyCmHandlerQueryService;
+import org.onap.cps.ncmp.api.NetworkCmProxyCmHandleQueryService;
import org.onap.cps.ncmp.api.NetworkCmProxyDataService;
-import org.onap.cps.ncmp.api.impl.event.lcm.LcmEventsCmHandleStateHandler;
+import org.onap.cps.ncmp.api.impl.events.lcm.LcmEventsCmHandleStateHandler;
import org.onap.cps.ncmp.api.impl.operations.DmiDataOperations;
import org.onap.cps.ncmp.api.impl.operations.DmiOperations;
import org.onap.cps.ncmp.api.impl.utils.CmHandleQueryConditions;
private final NetworkCmProxyDataServicePropertyHandler networkCmProxyDataServicePropertyHandler;
private final InventoryPersistence inventoryPersistence;
private final CmHandleQueries cmHandleQueries;
- private final NetworkCmProxyCmHandlerQueryService networkCmProxyCmHandlerQueryService;
+ private final NetworkCmProxyCmHandleQueryService networkCmProxyCmHandleQueryService;
private final LcmEventsCmHandleStateHandler lcmEventsCmHandleStateHandler;
private final CpsDataService cpsDataService;
private final IMap<String, Object> moduleSyncStartedOnCmHandles;
* @return cm handles with details
*/
@Override
- public Set<NcmpServiceCmHandle> executeCmHandleSearch(final CmHandleQueryApiParameters cmHandleQueryApiParameters) {
+ public Collection<NcmpServiceCmHandle> executeCmHandleSearch(
+ final CmHandleQueryApiParameters cmHandleQueryApiParameters) {
final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = jsonObjectMapper.convertToValueType(
cmHandleQueryApiParameters, CmHandleQueryServiceParameters.class);
validateCmHandleQueryParameters(cmHandleQueryServiceParameters, CmHandleQueryConditions.ALL_CONDITION_NAMES);
- return networkCmProxyCmHandlerQueryService.queryCmHandles(cmHandleQueryServiceParameters);
+ return networkCmProxyCmHandleQueryService.queryCmHandles(cmHandleQueryServiceParameters);
}
/**
* @return cm handle ids
*/
@Override
- public Set<String> executeCmHandleIdSearch(final CmHandleQueryApiParameters cmHandleQueryApiParameters) {
+ public Collection<String> executeCmHandleIdSearch(final CmHandleQueryApiParameters cmHandleQueryApiParameters) {
final CmHandleQueryServiceParameters cmHandleQueryServiceParameters = jsonObjectMapper.convertToValueType(
cmHandleQueryApiParameters, CmHandleQueryServiceParameters.class);
validateCmHandleQueryParameters(cmHandleQueryServiceParameters, CmHandleQueryConditions.ALL_CONDITION_NAMES);
- return networkCmProxyCmHandlerQueryService.queryCmHandleIds(cmHandleQueryServiceParameters);
+ return networkCmProxyCmHandleQueryService.queryCmHandleIds(cmHandleQueryServiceParameters);
}
/**
* @return set of cm handle IDs
*/
@Override
- public Set<String> getAllCmHandleIdsByDmiPluginIdentifier(final String dmiPluginIdentifier) {
- final Set<NcmpServiceCmHandle> ncmpServiceCmHandles =
- cmHandleQueries.getCmHandlesByDmiPluginIdentifier(dmiPluginIdentifier);
- final Set<String> cmHandleIds = new HashSet<>(ncmpServiceCmHandles.size());
- ncmpServiceCmHandles.forEach(cmHandle -> cmHandleIds.add(cmHandle.getCmHandleId()));
- return cmHandleIds;
+ public Collection<String> getAllCmHandleIdsByDmiPluginIdentifier(final String dmiPluginIdentifier) {
+ return cmHandleQueries.getCmHandleIdsByDmiPluginIdentifier(dmiPluginIdentifier);
}
/**
* @return set of cm handle IDs
*/
@Override
- public Set<String> executeCmHandleIdSearchForInventory(
+ public Collection<String> executeCmHandleIdSearchForInventory(
final CmHandleQueryServiceParameters cmHandleQueryServiceParameters) {
validateCmHandleQueryParameters(cmHandleQueryServiceParameters, InventoryQueryConditions.ALL_CONDITION_NAMES);
- return networkCmProxyCmHandlerQueryService.queryCmHandleIdsForInventory(cmHandleQueryServiceParameters);
+ return networkCmProxyCmHandleQueryService.queryCmHandleIdsForInventory(cmHandleQueryServiceParameters);
}
/**
}
private void batchDeleteCmHandlesFromDbAndModuleSyncMap(final Collection<String> tobeRemovedCmHandles) {
- tobeRemovedCmHandles.forEach(inventoryPersistence::deleteSchemaSetWithCascade);
+ inventoryPersistence.deleteSchemaSetsWithCascade(tobeRemovedCmHandles);
inventoryPersistence.deleteDataNodes(mapCmHandleIdsToXpaths(tobeRemovedCmHandles));
tobeRemovedCmHandles.forEach(this::removeDeletedCmHandleFromModuleSyncMap);
}
return CmHandleRegistrationResponse.createFailureResponses(cmHandleIds, exception);
}
}
+
}