diff options
author | raviteja.karumuri <raviteja.karumuri@est.tech> | 2023-06-20 19:10:21 +0100 |
---|---|---|
committer | raviteja.karumuri <raviteja.karumuri@est.tech> | 2023-06-22 11:23:30 +0100 |
commit | 977f7c395cee52cdecd0b01cb0412ebfeb9db048 (patch) | |
tree | 8547c2bf9426d25f3d5fd13ff4e328838ce0e1f4 /cps-ncmp-service/src/main | |
parent | cac2186419db6c3d956dd8cd759622da022ea9b2 (diff) |
NCMP : Replacing the word 'Batch' as 'DataOperation'.
Issue-ID: CPS-1754
Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech>
Change-Id: Ie9f56effb160582ba7177331fb6260b2bde2342b
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/NetworkCmProxyDataService.java | 14 | ||||
-rwxr-xr-x | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImpl.java | 12 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java | 18 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java | 20 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java | 26 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java (renamed from cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/BatchOperationDefinition.java) | 4 | ||||
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java (renamed from cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ResourceDataBatchRequest.java) | 4 |
7 files changed, 49 insertions, 49 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 046c78879b..e20780bf56 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 @@ -29,10 +29,10 @@ import org.onap.cps.ncmp.api.impl.operations.OperationType; import org.onap.cps.ncmp.api.inventory.CompositeState; import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters; import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; +import org.onap.cps.ncmp.api.models.DataOperationRequest; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; -import org.onap.cps.ncmp.api.models.ResourceDataBatchRequest; import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.model.ModuleDefinition; import org.onap.cps.spi.model.ModuleReference; @@ -83,15 +83,15 @@ public interface NetworkCmProxyDataService { FetchDescendantsOption fetchDescendantsOption); /** - * Get resource data for batch of cm handles using dmi. + * Execute (async) data operation for group of cm handles using dmi. * * @param topicParamInQuery topic name for (triggering) async responses - * @param resourceDataBatchRequest cm handle identifiers + * @param dataOperationRequest cm handle identifiers */ - void requestResourceDataForCmHandleBatch(String topicParamInQuery, - ResourceDataBatchRequest - resourceDataBatchRequest, - String requestId); + void executeDataOperationForCmHandles(String topicParamInQuery, + DataOperationRequest + dataOperationRequest, + String requestId); /** 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 536775ec5c..2e9d7c2021 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 @@ -60,10 +60,10 @@ import org.onap.cps.ncmp.api.models.CmHandleQueryApiParameters; import org.onap.cps.ncmp.api.models.CmHandleQueryServiceParameters; import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse; import org.onap.cps.ncmp.api.models.CmHandleRegistrationResponse.RegistrationError; +import org.onap.cps.ncmp.api.models.DataOperationRequest; import org.onap.cps.ncmp.api.models.DmiPluginRegistration; import org.onap.cps.ncmp.api.models.DmiPluginRegistrationResponse; import org.onap.cps.ncmp.api.models.NcmpServiceCmHandle; -import org.onap.cps.ncmp.api.models.ResourceDataBatchRequest; import org.onap.cps.spi.FetchDescendantsOption; import org.onap.cps.spi.exceptions.AlreadyDefinedExceptionBatch; import org.onap.cps.spi.exceptions.CpsException; @@ -139,11 +139,11 @@ public class NetworkCmProxyDataServiceImpl implements NetworkCmProxyDataService } @Override - public void requestResourceDataForCmHandleBatch(final String topicParamInQuery, - final ResourceDataBatchRequest - resourceDataBatchRequest, - final String requestId) { - dmiDataOperations.requestResourceDataFromDmi(topicParamInQuery, resourceDataBatchRequest, requestId); + public void executeDataOperationForCmHandles(final String topicParamInQuery, + final DataOperationRequest + dataOperationRequest, + final String requestId) { + dmiDataOperations.requestResourceDataFromDmi(topicParamInQuery, dataOperationRequest, requestId); } @Override diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java index 76ad0f7b2e..512c3bcda8 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiBatchOperation.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.List; import lombok.Builder; import lombok.Getter; -import org.onap.cps.ncmp.api.models.BatchOperationDefinition; +import org.onap.cps.ncmp.api.models.DataOperationDefinition; @JsonInclude(JsonInclude.Include.NON_NULL) @Getter @@ -45,20 +45,20 @@ public class DmiBatchOperation { private final List<CmHandle> cmHandles = new ArrayList<>(); /** - * Create and initialise a (outgoing) DMI batch operation. + * Create and initialise a (outgoing) DMI data operation. * - * @param batchOperationDefinition batchOperationDefinition definition of incoming of batch request + * @param dataOperationDefinition definition of incoming of dataOperation request * @return mapped dmi operation details */ public static DmiBatchOperation buildDmiBatchRequestBodyWithoutCmHandles( - final BatchOperationDefinition batchOperationDefinition) { + final DataOperationDefinition dataOperationDefinition) { return DmiBatchOperation.builder() - .operationType(OperationType.fromOperationName(batchOperationDefinition.getOperation())) - .operationId(batchOperationDefinition.getOperationId()) - .datastore(DatastoreType.fromDatastoreName(batchOperationDefinition.getDatastore()).getDatastoreName()) - .options(batchOperationDefinition.getOptions()) - .resourceIdentifier(batchOperationDefinition.getResourceIdentifier()) + .operationType(OperationType.fromOperationName(dataOperationDefinition.getOperation())) + .operationId(dataOperationDefinition.getOperationId()) + .datastore(DatastoreType.fromDatastoreName(dataOperationDefinition.getDatastore()).getDatastoreName()) + .options(dataOperationDefinition.getOptions()) + .resourceIdentifier(dataOperationDefinition.getResourceIdentifier()) .build(); } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java index 3e8d40a83b..adf634da57 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/operations/DmiDataOperations.java @@ -38,7 +38,7 @@ import org.onap.cps.ncmp.api.impl.utils.ResourceDataBatchRequestUtils; import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle; import org.onap.cps.ncmp.api.inventory.CmHandleState; import org.onap.cps.ncmp.api.inventory.InventoryPersistence; -import org.onap.cps.ncmp.api.models.ResourceDataBatchRequest; +import org.onap.cps.ncmp.api.models.DataOperationRequest; import org.onap.cps.spi.exceptions.CpsException; import org.onap.cps.utils.JsonObjectMapper; import org.springframework.http.ResponseEntity; @@ -118,21 +118,21 @@ public class DmiDataOperations extends DmiOperations { * The data wil be returned as message on the topic specified. * * @param topicParamInQuery topic name for (triggering) async responses - * @param resourceDataBatchRequest batch request for resource data + * @param dataOperationRequest data operation request to execute operations * @param requestId requestId for as a response */ public void requestResourceDataFromDmi(final String topicParamInQuery, - final ResourceDataBatchRequest resourceDataBatchRequest, + final DataOperationRequest dataOperationRequest, final String requestId) { final Set<String> cmHandlesIds - = getDistinctCmHandleIdsFromBatchRequest(resourceDataBatchRequest); + = getDistinctCmHandleIdsFromDataOperationRequest(dataOperationRequest); final Collection<YangModelCmHandle> yangModelCmHandles = getYangModelCmHandlesInReadyState(cmHandlesIds); final Map<String, List<DmiBatchOperation>> operationsOutPerDmiServiceName - = ResourceDataBatchRequestUtils.processPerOperationInBatchRequest(resourceDataBatchRequest, + = ResourceDataBatchRequestUtils.processPerOperationInBatchRequest(dataOperationRequest, yangModelCmHandles); buildBatchRequestUrlAndSendToDmiService(topicParamInQuery, requestId, operationsOutPerDmiServiceName); @@ -214,11 +214,11 @@ public class DmiDataOperations extends DmiOperations { } } - private static Set<String> getDistinctCmHandleIdsFromBatchRequest(final ResourceDataBatchRequest - resourceDataBatchRequest) { - return resourceDataBatchRequest.getBatchOperationDefinitions().stream() - .flatMap(batchOperationDefinition -> - batchOperationDefinition.getCmHandleIds().stream()).collect(Collectors.toSet()); + private static Set<String> getDistinctCmHandleIdsFromDataOperationRequest(final DataOperationRequest + dataOperationRequest) { + return dataOperationRequest.getDataOperationDefinitions().stream() + .flatMap(dataOperationDefinition -> + dataOperationDefinition.getCmHandleIds().stream()).collect(Collectors.toSet()); } private Collection<YangModelCmHandle> getYangModelCmHandlesInReadyState(final Set<String> requestedCmHandleIds) { diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java index e4c9bfb39b..f0d02552f6 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/utils/ResourceDataBatchRequestUtils.java @@ -33,8 +33,8 @@ import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.api.impl.operations.CmHandle; import org.onap.cps.ncmp.api.impl.operations.DmiBatchOperation; import org.onap.cps.ncmp.api.impl.yangmodels.YangModelCmHandle; -import org.onap.cps.ncmp.api.models.BatchOperationDefinition; -import org.onap.cps.ncmp.api.models.ResourceDataBatchRequest; +import org.onap.cps.ncmp.api.models.DataOperationDefinition; +import org.onap.cps.ncmp.api.models.DataOperationRequest; @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -45,13 +45,13 @@ public class ResourceDataBatchRequestUtils { /** * Create a list of DMI batch operation per DMI service (name). * - * @param resourceDataBatchRequestIn incoming batch request details for resource data - * @param yangModelCmHandles involved cm handles represented as YangModelCmHandle (incl. metadata) + * @param dataOperationRequestIn incoming data operation request details + * @param yangModelCmHandles involved cm handles represented as YangModelCmHandle (incl. metadata) * * @return {@code Map<String, List<DmiBatchOperation>>} Create a list of DMI batch operation per DMI service (name). */ public static Map<String, List<DmiBatchOperation>> processPerOperationInBatchRequest( - final ResourceDataBatchRequest resourceDataBatchRequestIn, + final DataOperationRequest dataOperationRequestIn, final Collection<YangModelCmHandle> yangModelCmHandles) { final Map<String, Map<String, Map<String, String>>> dmiPropertiesPerCmHandleIdPerServiceName = @@ -62,9 +62,9 @@ public class ResourceDataBatchRequestUtils { final Map<String, List<DmiBatchOperation>> dmiBatchOperationsOutPerDmiServiceName = new HashMap<>(); - for (final BatchOperationDefinition batchOperationDefinitionIn : - resourceDataBatchRequestIn.getBatchOperationDefinitions()) { - for (final String cmHandleId : batchOperationDefinitionIn.getCmHandleIds()) { + for (final DataOperationDefinition dataOperationDefinitionIn : + dataOperationRequestIn.getDataOperationDefinitions()) { + for (final String cmHandleId : dataOperationDefinitionIn.getCmHandleIds()) { final String dmiServiceName = dmiServiceNamesPerCmHandleId.get(cmHandleId); final Map<String, String> cmHandleIdProperties = dmiPropertiesPerCmHandleIdPerServiceName.get(dmiServiceName).get(cmHandleId); @@ -72,7 +72,7 @@ public class ResourceDataBatchRequestUtils { publishErrorMessageToClientTopic(cmHandleId); } else { final DmiBatchOperation dmiBatchOperationOut = getOrAddDmiBatchOperation(dmiServiceName, - batchOperationDefinitionIn, dmiBatchOperationsOutPerDmiServiceName); + dataOperationDefinitionIn, dmiBatchOperationsOutPerDmiServiceName); final CmHandle cmHandle = CmHandle.buildCmHandleWithProperties(cmHandleId, cmHandleIdProperties); dmiBatchOperationOut.getCmHandles().add(cmHandle); } @@ -104,8 +104,8 @@ public class ResourceDataBatchRequestUtils { } private static DmiBatchOperation getOrAddDmiBatchOperation(final String dmiServiceName, - final BatchOperationDefinition - batchOperationDefinitionIn, + final DataOperationDefinition + dataOperationDefinitionIn, final Map<String, List<DmiBatchOperation>> dmiBatchOperationsOutPerDmiServiceName) { dmiBatchOperationsOutPerDmiServiceName @@ -114,10 +114,10 @@ public class ResourceDataBatchRequestUtils { = dmiBatchOperationsOutPerDmiServiceName.get(dmiServiceName); final boolean isNewOperation = dmiBatchOperationsOut.isEmpty() || !dmiBatchOperationsOut.get(dmiBatchOperationsOut.size() - 1).getOperationId() - .equals(batchOperationDefinitionIn.getOperationId()); + .equals(dataOperationDefinitionIn.getOperationId()); if (isNewOperation) { final DmiBatchOperation newDmiBatchOperationOut = - DmiBatchOperation.buildDmiBatchRequestBodyWithoutCmHandles(batchOperationDefinitionIn); + DmiBatchOperation.buildDmiBatchRequestBodyWithoutCmHandles(dataOperationDefinitionIn); dmiBatchOperationsOut.add(newDmiBatchOperationOut); return newDmiBatchOperationOut; } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/BatchOperationDefinition.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java index 04075b3b7c..8182fbfcc8 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/BatchOperationDefinition.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationDefinition.java @@ -35,7 +35,7 @@ import lombok.Setter; @EqualsAndHashCode @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) -public class BatchOperationDefinition { +public class DataOperationDefinition { private String operation; private String operationId; @@ -45,5 +45,5 @@ public class BatchOperationDefinition { @JsonProperty("targetIds") @Valid - private List<String> cmHandleIds = new ArrayList(); + private List<String> cmHandleIds = new ArrayList<>(); } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ResourceDataBatchRequest.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java index 7af107c37a..6fa7d5c755 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/ResourceDataBatchRequest.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/models/DataOperationRequest.java @@ -35,9 +35,9 @@ import lombok.Setter; @EqualsAndHashCode @JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonIgnoreProperties(ignoreUnknown = true) -public class ResourceDataBatchRequest { +public class DataOperationRequest { @JsonProperty("operations") @Valid - private List<BatchOperationDefinition> batchOperationDefinitions = Collections.emptyList(); + private List<DataOperationDefinition> dataOperationDefinitions = Collections.emptyList(); } |