diff options
author | JosephKeenan <joseph.keenan@est.tech> | 2021-11-23 12:18:28 +0000 |
---|---|---|
committer | JosephKeenan <joseph.keenan@est.tech> | 2021-11-25 15:40:10 +0000 |
commit | 20b4f9cf0b662de4a7665b2a82593ef0205f5e06 (patch) | |
tree | ab849ff17b861f246c328e421e8dcfc8ceb9e851 /cps-ncmp-rest/src/main/java | |
parent | bc742a1dbe39a3269abab9e62a9d489f460144b0 (diff) |
Allow separate registration of DMIDataPlugin and DmiModelPugin
Moved relevant code from NetworkCmProxyDataServiceImp to DmiOperations
Split DmiOperations into DMiData... and DMIModelOperations
Merged update-operation changes
Added tests for error message validation in NetworkCmProxyDataServiceImplSpec
Removede @Service from DMIOperations and added @component to
DmiDataOperations & DmiModelOperations
Verify sync robot test is now hardened
Added exitonfailure so robot tests stop after first encountered failed
test
Issue-ID: CPS-736
Change-Id: I0b40931cc8cd4fc0452328a0a7e0f60e6fc38d0a
Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
Diffstat (limited to 'cps-ncmp-rest/src/main/java')
-rwxr-xr-x | cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java index 449a4344dd..222957c9f4 100755 --- a/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java +++ b/cps-ncmp-rest/src/main/java/org/onap/cps/ncmp/rest/controller/NetworkCmProxyController.java @@ -22,6 +22,9 @@ package org.onap.cps.ncmp.rest.controller; +import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum.CREATE; +import static org.onap.cps.ncmp.api.impl.operations.DmiRequestBody.OperationEnum.UPDATE; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.ArrayList; @@ -132,14 +135,6 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { return new ResponseEntity<>(HttpStatus.OK); } - @Override - public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String resourceIdentifier, - final String cmHandle, final String requestBody, final String contentType) { - networkCmProxyDataService.updateResourceDataPassThroughRunningForCmHandle(cmHandle, - resourceIdentifier, requestBody, contentType); - return new ResponseEntity<>(HttpStatus.OK); - } - /** * Update Node Leaves. * @deprecated This Method is no longer used as part of NCMP. @@ -195,25 +190,49 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { } /** - * Create resource data in datastore pass through running - * for given cm-handle. + * Create resource data in datastore pass through running for given cm-handle. * * @param resourceIdentifier resource identifier * @param cmHandle cm handle identifier - * @param requestBody requestBody + * @param requestBody the request body * @param contentType content type of body - * @return {@code ResponseEntity} response from dmi plugi + * @return {@code ResponseEntity} response from dmi plugin */ @Override public ResponseEntity<Void> createResourceDataRunningForCmHandle(final String resourceIdentifier, final String cmHandle, final String requestBody, final String contentType) { - networkCmProxyDataService.createResourceDataPassThroughRunningForCmHandle(cmHandle, - resourceIdentifier, requestBody, contentType); + networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle, + resourceIdentifier, CREATE, requestBody, contentType); return new ResponseEntity<>(HttpStatus.CREATED); } + /** + * Update resource data in datastore pass through running for given cm-handle. + * + * @param resourceIdentifier resource identifier + * @param cmHandle cm handle identifier + * @param requestBody the request body + * @param contentType content type of the body + * @return response entity + */ + @Override + public ResponseEntity<Object> updateResourceDataRunningForCmHandle(final String resourceIdentifier, + final String cmHandle, + final String requestBody, + final String contentType) { + networkCmProxyDataService.writeResourceDataPassThroughRunningForCmHandle(cmHandle, + resourceIdentifier, UPDATE, requestBody, contentType); + return new ResponseEntity<>(HttpStatus.OK); + } + + /** + * Execute cm handle search. + * + * @param conditions the conditions + * @return cm handles returned from search. + */ @Override public ResponseEntity<CmHandles> executeCmHandleSearch(final Conditions conditions) { final List<ConditionProperties> conditionProperties = @@ -223,6 +242,12 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { return ResponseEntity.ok(cmHandles); } + /** + * Return module references for a cm handle. + * + * @param cmHandle the cm handle + * @return module references for cm handle + */ @Override public ResponseEntity<Object> getModuleReferencesByCmHandle(final String cmHandle) { final Collection<ModuleReference> @@ -264,6 +289,4 @@ public class NetworkCmProxyController implements NetworkCmProxyApi { } return cmHandleProperties; } - - } |