summaryrefslogtreecommitdiffstats
path: root/cps-rest/src
AgeCommit message (Collapse)AuthorFilesLines
2023-12-18Remove the dependency-cycle between beansToineSiebelink3-34/+46
- Splitting admin service into AnchorService and DataspaceService (this resolves the cyclic dependency) - Improved Delete dataspace integration error tests (were depending on execution order, now independent) Issue-ID: CPS-871 Change-Id: I47efedb6eb4bd2900f72d689616b7b7b62df2938 Signed-off-by: halil.cakal <halil.cakal@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2023-11-14CPS Delta API 1: Delta between 2 anchorsArpit Singh2-1/+38
- CPS Delta Feature Part 1: To find delta between two anchors - created new endpoint deltaByDataspaceAndAnchors - endpoint to take dataspaceName, source anchor, target anchor, xpath, descendants as input - added new service CpsDeltaService - added method to find delta between DataNodes: getDeltaReport - added method to find removed data nodes: getRemovedDeltaReports - added method to get Added DataNodes: getAddedDeltaReports - added method to get Map of xpath to DataNode: convertToXPathToDataNodesMap - added a POJO for delta report - Added new JSON data for delta feature testing - Added groovy test files CpsDeltaServiceImplSpec and DeltaReportBuilderSpec - code related to update operation, will be added in separate commit Issue-ID: CPS-1824 Signed-off-by: Arpit Singh <as00745003@techmahindra.com> Change-Id: I313f0f71d04b03878be7643f709d8af1aa6df6ba
2023-09-22Reinstate Spring Boot 3.0 after revertegernug3-5/+5
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b
2023-09-20Revert "Migrate CPS to Spring-boot 3.0"Toine Siebelink3-5/+5
This reverts commit 9693ec51cf6526082f0ad0c3ad208d144cbbb163. Reason for revert: Bug fix delivery Change-Id: I73bdc1528192c662983b0bbef73b10b6d612a719 Signed-off-by: egernug <gerard.nugent@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2023-09-14Migrate CPS to Spring-boot 3.0egernug3-5/+5
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I932fca8a50cedf2ae0604401c5e2b27896e4d449
2023-08-17Add code coverage for missing branches in pagination API(ep4)rajesh.kumar1-2/+36
Add new test cases for missing branch covereage in Pagiantion API - Added test cases in cps-rest to cover the scenario of missing page index and missing page size Issue-ID:CPS-1835 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1108bc Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2023-08-03Merge "Support pagination in query across all anchors(ep4)"Luke Gleeson2-14/+92
2023-08-02Support pagination in query across all anchors(ep4)rajesh.kumar2-14/+92
Add pagination query parameters in query across all anchors API pagination parameters (pageIndex and pageSize) are optional default is to query all fragments each pageSize represents number of records(number of anchors) TotalRecords is returned in response header to find number of pages. - If pagination option is provided in request then query number of anchors equal to pageSize. pageIndex is used for setting offset. - return number of records(one anchor per record) as per pagesize and pageSize Issue-ID: CPS-1605 Change-ID: I73f97f986a817d423f93a8d922dcd9647b2504bc Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2023-07-31Add 'direct' keyword to descendants option to query direct children (ep1)Rudrangi Anupriya1-2/+2
-added 'direct' keyword also to Fetch Descendants Option along with 'all' and 'none' to Query direct child. -added unit tests to test direct keyword Issue-ID: CPS-1784 Change-Id: Icb7f59fbeebb03703626132d6d5d2cfde0e5ab4d Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-28Add 'direct' keyword to descendants option to query direct children (ep1)Rudrangi Anupriya1-2/+8
-added 'direct' keyword also to Fetch Descendants Option along with 'all' and 'none' to Query direct child. -added unit tests to test direct keyword Issue-ID:CPS-1784 Change-Id: Iab7f59fbeebb03703626132c6d5c2afde0e5ab4d Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-18Persisting a list element to a parent list (ep2)Rudrangi Anupriya1-0/+23
Post List Element does not allow for create List Element, only appends onto existing node as children -Add a check in saveListElements to see if the parent xpath is a root path ("/").If root node store list element as top node. Else add passed list element to parent xpath node. -Add test for scenario for above -Add test scenario Saving list element data fragment under Root node -Add Integration Tests Add and Delete top-level list (element) data nodes with root node -Update bookstore model with TopLevelList datanode Issue-ID: CPS-1586 Change-Id: Iaa7f59fbeebb03703626132c6d5c2afde0e7ab4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-11Combine alreadyDefinedException classesdanielhanrahan1-3/+2
Issue-ID: CPS-1774 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10
2023-06-29Improved code coverage (branches) around multipart file utilsToineSiebelink1-11/+26
- added test - moved wrongly placed test (from MultipartFileUtilSpec to DataMapUtilsSpec) - applied curent conventions to DataMapUtilsSpec Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie8dc7f6802bb6ff0a256dc05df73da6af75409f3
2023-06-26Chsnge to OpenApi 3.0egernug2-15/+19
In preparation for the Java 17 and Springboot 3 migrations Swagger Codegen has to upgrade to OpenApi 3.0 This effects cps-rest and cps-ncmp-rest Issue-Id: CPS-1745 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I18b8e9ca26d0123009702c2474efbfbeec6d4c44
2023-03-21Query data nodes across all anchors under one dataspacerajesh.kumar2-0/+49
Issue-ID: CPS-1396 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1412ab Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2023-03-09Add new metrics to the get data node methodkissand2-0/+10
Issue-ID: CPS-1509 Change-Id: I2eded9a23b56f5263591c710c7a707cf281f93d7 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2023-02-20Fix sonar code smellhalil.cakal3-5/+5
Issue-ID: CPS-475 Change-Id: I6c213090862b68ccf44fb95395c57c717f52a9b2 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-02-17CPS-1401 Implement V2 of GET Data Node APIarpitsingh2-39/+97
- Modified the GET Data Node API so it returns all the data nodes when xpath set to root "/" - Fragment Repository now returns a collection of Fragment Entities - Instead of returning only the first Fragment Entity now all fragment entities are returned when xpath is set to root - The Fragemnt Entities are further processed to a Collection of Data Nodes. As opposed to singular Data Node in current implementation. - Finally the DataRestController also returns a Collection of Data Nodes when xpath is set to root and valid data is present - Response body changed from JSON object to JSON Array. - Exception handling for invalid xpath and non-existing xpath is now done separately at persistence layer. - Refactored code against CPS-1422 - Deprecated getDataNode method from Service and Persistence layer - Modified V1 of Get Data Node API to use the getDataNodes method and get the first data node from the collection returned. - Modified NCMP to use getDataNodes method - NCMP still does not support multiple data nodes. It retrieves the first data node from the collection returned by getDataNodes Signed-off-by: arpitsingh <as00745003@techmahindra.com> Change-Id: I494a5740a53f65376d135fcb9f1e2e8900a2803e
2023-02-13Test for yang file archive limitationhalil.cakal5-38/+72
- add new test - fixed misleading method names Issue-ID: CPS-1480 Change-Id: I9dd8f41d0acfc8b1c063aab65567d619670f4905 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-02-08Correct calculation of zip archive size for schemaset uploadArne Chrestin1-1/+1
Correct calculation of zip archive size for schemaset upload Issue-ID: CPS-1477 Change-Id: I73f97f986a817d423f93a8d922dcd9647b0203ab Signed-off-by: Arne Chrestin <arne.chrestin@telekom.de>
2023-01-31Introduce InstrumentationToineSiebelink2-3/+16
- Add instrumentation related dependency - Added Timed Instrumentation - CPS-Service Crud methods - CPS Yang parsing - NCMP Registration methods - NCMP Events handling - Remove manual Gauge for YanResources Cache as (better!) instrumentation is already built into the 3PP - Sorted dependecies alphabetically (as we used to enforce, to prevent duplicates) - Added ## P E R F O R M A N C E T E S T R E S U L T S ### mini report - (unrelated) test improvement (because of bug that turned out to be invalid) Reviewers: Sourabh,Priyank, Luke Issue-ID: CPS-1457 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I34b20bece2f59488b022b8effa9470704c57be4d
2023-01-23Added depth parameter in query nodes API.rajesh.kumar4-13/+90
Issue-ID: CPS-1381 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1206bb Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-12-22XML content on create anchors node supportMichal Jagiello3-47/+60
Add XML content type support on anchor node creation. Issue-ID: CPS-1257 Change-Id: I7e7a9a1961b6e81de93a4e32e842b47f8a163a09 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Signed-off-by: Lee Anjella Macabuhay <lee.anjella.macabuhay@est.tech>
2022-12-16API versioning supported and added different versions for POST APIsrajesh.kumar4-47/+119
Issue-ID: CPS-1189 Change-ID: I73f97f986a817d423f92f8d922dcd9647b1214aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-12-09Added API to get all schema sets for a given dataspace.rajesh.kumar2-0/+29
Issue-ID: CPS-1187 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0914aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-11-18Added get APIs for dataspace.rajesh.kumar3-0/+50
Issue-ID: CPS-1186 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0829aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-11-10HTTP error code 500 changed to 400 for invalid JSON payloadrajesh.kumar2-1/+16
Issue-ID: CPS-1289 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1012aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-11-02Ensure prefix is correct module prefixToineSiebelink5-8/+33
- Moved Prefix logic from RI to Service layer - Prefix is no PREFIX propety, not the moduel name! == RI (DB Layer) Changes - Removed prefix logic incl hazelcast - Added new basic ri-test for getDataNode and assert prefix is null - Updated exsiting ri-test to us getDataNode - Updated existing ri-test to only use " where really needed == CPS Service Layer Changes - Introduced PrefixResolver with clear and limited responsibility - Use PrefixResolver where needed - Cache prefix map per anchor, use cached entry when available - Disabled SONAR on new Regex == REST Layer - Use PrefixResolver where needed Issue-ID: CPS-1353 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie16f0e1ee1c280f3eb69c9e64fab69a780fb692a
2022-09-13Handle partial failure (improvements)ToineSiebelink1-1/+2
- catching of failures on retry of individual nodes - extract cm handle id from xpaths (can only report xpaths in cps core) - add test for same Issue-ID: CPS-1232 Issue-ID: CPS-1126 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ice2032c8b15fea97ae0aaa4d1ed642b3499228fa
2022-08-25Performance Improvement: Batch Update DataNodeslukegleeson2-4/+4
Implemented methods to perform a batch operation on updating datanodes Refactored replace data node(s) tree methods to update data node(s) and descendants Issue-ID: CPS-1203 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I365d657422b19c9ce384110c9a23d041eaed06f4
2022-04-25Fix Absolute Path to list with Integer/String keyLathish1-1/+0
- Introduced normalizedXpath to normalize the xpath and cpspath - Introduced normalizedAncestorpath to normalize the ancestor path in xpath and cpspath - Added new condition in the ANTLR Grammar to capture the invalid path in the xpath - Introduced PathParsingException to replace the IllegalStateException Issue-ID: CPS-961 Change-Id: Ie10f5c6cfc466387e79eec184b933297d1d79587 Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
2022-03-30Additional validation for names/identifiersDylanB95EST1-4/+3
Implementing additional regex validation for names/identifiers in CPS - Introduces a CpsValidator - Applies to relevent java public API's - Tests have been updated where necessary Issue-ID: CPS-322 Change-Id: I29ab8820bb1fe0eee247e425d6bb018bcd38f28e Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-03-10Replacing ModelMapper with MapStructlukegleeson6-78/+109
- Removed Model Mapper from pom files - Replaced ModelMapper with MapStruct - Added Tests for MapStruct - Changed mapstruct annotations for individual variables to be null safe rather than all variables - Excluded generated code from code coverage - Set ModuleReferences input to required for SchemaSet so that ModuleReferences list set to empty list rather than null Issue-ID: CPS-127 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I43f874aea79f58dda5526c6fdead27d8474d90af
2022-03-01Create Endpoint For Get Cm Handles By NameDylanB95EST1-10/+5
Create endpoint and implement logic for get cm handle details by cm handle name Issue-ID: CPS-817 Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-02-17Align JSON DataNode for Get and Post/Put API in CPSputhuparambil.aditya4-13/+17
Issue-ID: CPS-865 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I60b1f9c94e79bdd66d60fe6a68f5fc4adc718d35
2022-02-14Improve logging in NCMPsourabh_sourabh1-0/+3
- Code to change to apply logs at runtime - Fix for minor code smell Issue-ID: CPS-855 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I93a556fe0fb7ca05a42e84eb5ec4f84afaa8fd92
2022-01-27Merge "Improve logging in NCMP"Toine Siebelink1-4/+1
2022-01-25Improve logging in NCMPsourabh_sourabh1-4/+1
Issue-ID: CPS-855 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I5d8a6a711d1c6b13d5d8eeba52a1dcd689dbdae2
2022-01-25Replace gson mapper with jackson mappersourabh_sourabh5-36/+45
We introduced JsonObjectMapper (wapper) as Spring component. Issue-ID: CPS-751 Change-Id: I536b0771a3a263325e6907717baf6941d70c0d6c Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-01-07CPS-Core: Unable to parse JSON input with space for POST endpointsourabh_sourabh2-30/+31
Issue-ID: CPS-831 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: If2f5f7034f05763990001c9dd8ccd9d8dc0099cf
2021-12-02Adding examples in openapi for cps-coreputhuparambil.aditya3-48/+45
1. Added examples for all parameters, request body and response body 2. Changed the response/request type to Object from String for all json objects 3. Passed json format data in all tests 4. PUT and PATCH operations at present return empty response, hence examples are changed to be in sync Issue-ID: CPS-780 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: If6dd5bb48df4e1bbf1026eaadf315df8f972e282
2021-11-23CPS-314: Delete Dataspaceniamhcore3-1/+28
Issue-ID: CPS-314 Change-Id: I778e2b784c7b1ff3fecc1036425708dc4ec73227 Signed-off-by: niamhcore <niamh.core@est.tech>
2021-11-02Delete DataNode (xpath) for a given AnchorDylanB95EST2-0/+30
Delete Datanode within CPS. Deprecates delete functionality of /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes. New api is backwards compatible with this API Issue-ID: CPS-313 Change-Id: I110c4ab1446e8a1399a0d9bf89c0be614a9104df Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-11-02Clean Up Code around List NodesDylanB95EST2-33/+28
Make sure code refers clearly to List (whole) nodes or List elements incl. method names, parameter names, test descriptions etc. Issue-ID: CPS-756 Change-Id: Ic9dae6565c0e84c1ba4c2d6e891d3ea307f589da Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-09-01Add ncmp endpoints to swagger-uiRenu Kumari9-822/+2
- added ncmp-enpoints to swagger-ui - removed springfox dependencies - removed Docket configuration as we are loading ui from openapi.yml - removed endpoints which are not implemented - Fixed ncmp basepath as per CPS-616 Issue-ID: CPS-601 Issue-ID: CPS-616 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I03c7789f48a12d3ffd5fcb934d7ba6347d4044e4
2021-08-30Change the list-node rest interfaceRenu Kumari3-8/+8
- Changed the list-node interface to be consistent with datanode api Issue-ID: CPS-598 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Ic99828f1463e9a724244c05166e477581756f602
2021-08-25Add optional observed timestamp in the cps data apiaditya puthuparambil7-95/+275
- Added optional query parameter in cps data endpoints - Updated service layer and notification to use observedTimestamp Note: - NCMP REST endpoints are not updated as a part of this patch - NCMP does not sent observed timestamp when using cps data services Issue-ID: CPS-477 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I1f92da3da7b3a13c45405fdf44e5fef861991d9a Signed-off-by: Renu Kumari <renu.kumari@bell.ca>
2021-08-18Delete list-node p2 rest layerlukegleeson3-0/+42
Issue-ID: CPS-361 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I5fb8d202fc0a65679d10377cc2959a7f8f854ca7
2021-08-11Merge "Update response query format"aditya puthuparambil2-4/+15
2021-08-11Update response query formatniamhcore2-4/+15
Issue-ID: CPS-560 Change-Id: I1c71270a8cde7e940c5af80bc743d0f01ab6b9bb Signed-off-by: niamhcore <niamh.core@est.tech>