diff options
author | Luke Gleeson <luke.gleeson@est.tech> | 2023-04-20 12:34:01 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-04-20 12:34:01 +0000 |
commit | 3c9f2b305b9f85edfe8791295e0c1bbdbd4b8304 (patch) | |
tree | 84bafb88c0cec3bed390c842c18d49b3395e33c6 /src/main/java | |
parent | 5f68d54d9f3af043d7f87d9a0b3a5f2de6f06dc5 (diff) | |
parent | 17c24efd4babc61a818fef26ce56954b703fbfb7 (diff) |
Merge "Align dependencies with CPS/NCMP"
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java index da0ac3e1..176a445a 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/rest/controller/DmiRestController.java @@ -28,7 +28,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.validation.Valid; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.dmi.model.CmHandles; @@ -74,7 +73,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { @Override public ResponseEntity<ModuleSet> getModuleReferences(final String cmHandle, - final @Valid ModuleReferencesRequest body) { + final ModuleReferencesRequest body) { // For onap-dmi-plugin we don't need cmHandleProperties, so DataAccessReadRequest is not used. final ModuleSet moduleSet = dmiService.getModulesForCmHandle(cmHandle); return ResponseEntity.ok(moduleSet); @@ -82,8 +81,8 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { @Override public ResponseEntity<YangResources> retrieveModuleResources( - final @Valid ModuleResourcesReadRequest moduleResourcesReadRequest, - final String cmHandle) { + final String cmHandle, + final ModuleResourcesReadRequest moduleResourcesReadRequest) { final List<ModuleReference> moduleReferences = convertRestObjectToJavaApiObject(moduleResourcesReadRequest); final YangResources yangResources = dmiService.getModuleResources(cmHandle, moduleReferences); return new ResponseEntity<>(yangResources, HttpStatus.OK); @@ -95,7 +94,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { * @param cmHandles list of cm-handles * @return (@ code ResponseEntity) response entity */ - public ResponseEntity<String> registerCmHandles(final @Valid CmHandles cmHandles) { + public ResponseEntity<String> registerCmHandles(final CmHandles cmHandles) { final List<String> cmHandlesList = cmHandles.getCmHandles(); if (cmHandlesList.isEmpty()) { return new ResponseEntity<>("Need at least one cmHandle to process.", HttpStatus.BAD_REQUEST); @@ -125,20 +124,20 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { * supports both read and write operation whereas passthrough operational does not support write operations. * * @param resourceIdentifier resource identifier to fetch data - * @param datastoreName name of the datastore + * @param datastoreName name of the datastore * @param cmHandle cm handle identifier - * @param dataAccessRequest data Access Request * @param optionsParamInQuery options query parameter * @param topicParamInQuery topic name for (triggering) async responses + * @param dataAccessRequest data Access Request * @return {@code ResponseEntity} response entity */ @Override public ResponseEntity<Object> dataAccessPassthrough(final String resourceIdentifier, final String datastoreName, final String cmHandle, - final DataAccessRequest dataAccessRequest, final String optionsParamInQuery, - final String topicParamInQuery) { + final String topicParamInQuery, + final DataAccessRequest dataAccessRequest) { if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(datastoreName)) { return dataAccessPassthroughOperational(resourceIdentifier, cmHandle, dataAccessRequest, optionsParamInQuery, topicParamInQuery); @@ -203,7 +202,7 @@ public class DmiRestController implements DmiPluginApi, DmiPluginInternalApi { dataAccessRequest.getDataType(), dataAccessRequest.getData()); } - private boolean isReadOperation(final @Valid DataAccessRequest dataAccessRequest) { + private boolean isReadOperation(final DataAccessRequest dataAccessRequest) { return dataAccessRequest.getOperation() == null || dataAccessRequest.getOperation().equals(DataAccessRequest.OperationEnum.READ); } |