aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service
AgeCommit message (Collapse)AuthorFilesLines
6 daysMerge "Change order of CM Handle Reference lookup depending on special ↵Sourabh Sourabh3-3/+188
character"
7 daysChange order of CM Handle Reference lookup depending on special characterseanbeirne3-3/+188
- implemented new algorithm using validator to rule out standard id / prefer alternate id - moved validator imp to cps-service (not in RI) TBC!!! - changed order of characters tested in validator to fail fast (on '=') - added Boolean variation validator method to reduce overhead and prevent logic based on exceptions - improved integration test to cover all scenarios - add performance test for alternate id look up (report only) - ensured all performance test use alternate ids it '=' - added small groovy tests to restore cps-ri code coverage to 0.31 Issue-ID: CPS-2605 Change-Id: Id9c22bb69904b7f5d376b7f8319332428435333e Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: seanbeirne <sean.beirne@est.tech>
13 daysHandle duplicated yang resource exception when creating schema sethalil.cakal2-4/+22
- catch and log duplicated yang resource during schema set creation - there may be other exception when the app started however there will be a tech. dept ticket for them thus please review this commit for only duplicated yang resource exception Issue-ID: CPS-2647 Change-Id: Idf6063cb8328efc667516f09d25ad6c4c6fd8186 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2025-02-12Store yang resources with recommended RFC-6020 file-nameToineSiebelink3-13/+11
- Ignore input filename and create filename from module name and revision - added integration test to verify names and edge cases (before and after change) - Some code cleanup (vars etc) - Implemented NB comments from last merge(https://gerrit.onap.org/r/c/cps/+/140180) - fixed SQ warning Out of scope: - BLANK revision, test it but failed in ODL Yang Parser and many other places: not supported! Issue-ID: CPS-138 Change-Id: I6fe6d0f8f3683196b183c6e6582ad8eefdfbb7d7 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-02-11Merge "Query data nodes with limit"Toine Siebelink4-4/+66
2025-02-11Query data nodes with limitleventecsanyi4-4/+66
- added new methods to java interfaces - added integration test - removed unused methods Issue-ID: CPS-2394 Change-Id: Iac4094a5daedbf593d17f55928136a80391c6d23 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-02-06Merge "Fix duplicated yang resource references V2"Daniel Hanrahan13-103/+105
2025-02-06Fix duplicated yang resource references V2ToineSiebelink13-103/+105
- Store Yang module references using SchemaSetEntity instead of SQL - Added integration test to check number of references - Update dispatcher for integration test to only return yang resources requested modules - refactor schema set create & upgrade methods for better re-uses and readability - consistent naming in related methods like(new)yangResourceContentPerName (the name can be filename, module name or schema set name) depending on the context - replaced 'var' with actual class names in affected classes Issue-ID: CPS-2605 Change-Id: I8870c70832ac533bd17ce8af409a071f659e4acf Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-02-04Simple implementation of attribute-axisdanielhanrahan3-6/+17
This minimally implements attribute-axis using existing queryDataNodes API. Acceptance tests are un-ignored now. Issue-ID: CPS-2416 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ia06be3dd85dfce261d9d78529784d54d84b71bcd
2025-01-29Bump CPS-NCMP to 3.6.1-SNAPSHOTmpriyank1-1/+1
Issue-ID: CPS-2610 Change-Id: I289fcbdc2df1de6d369cc6e01bdad26ec174b08f Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2025-01-29Address sonar violations related to hazelcastmpriyank2-4/+4
- Supressing warning caused by deprecation of RestApiConfig in hazelcast 5.5 community version , which will be removed in 6.0 so created https://lf-onap.atlassian.net/browse/CPS-2599 to address the issues - Other sonar fixes Issue-ID: CPS-2594 Change-Id: I2e95cd851eae74d8bbb4535cfbaed1dc1ef89543 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2025-01-27Moved CpsValidator under the utils packageleventecsanyi14-14/+14
Issue-ID: CPS-2515 Change-Id: I57f6c10c8596281aed686552ad16e1dd6c15ff98 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-23Merge "Add DB Clean-up to CPS Rest Interface"Daniel Hanrahan4-10/+16
2025-01-23Add DB Clean-up to CPS Rest InterfaceToineSiebelink4-10/+16
- add dataspace filter to module cleanup impl - updated integration test to only delete orphaned modules in relevant dataspaces (this also fixes CPS-2571) - improved labels on admin controller test - add dataspaces/../clean rest endpoint for cps core - added 'Regular Maintenance' section to RTD Admin Guide - consistent spelling of 'CM Handle' in RTD Docs Issue-ID: CPS-2554 Change-Id: Ica70c3495758f073eaac9eeeadcc0e1be2c8cc1c Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-01-20Moved builders under impl in CPS Serviceleventecsanyi10-14/+12
- moved builders and fixed the Arch test Issue-ID: CPS-2542 Change-Id: Iac9d47f20fff2e6fa415ada8bc17880b0b032591 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-17Moved impl package out from api packageleventecsanyi19-194/+197
- refactored cps service packages and the architecture test Issue-ID: CPS-2543 Change-Id: I0fab54cebd157b19ff6105b7d4b6d8265a1af485 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-16One SchemaSet per moduleSetTagToineSiebelink10-236/+95
- Registration: create and upgrade cases. - Handle moduleSetTag deletion (all orphans) for testware - Unit tests updated - additional logging of details for upgrade scenarios - Integration Tests updated - Remove cache for module sets being processed - Removed DbCleaner (startup) - Removed redundant methods in NCMP Inventory for deleting schema set(s) - Removed validation check for all schema set interactions - Updated some schema set tests to use special characters previously not allowed - Checked integration test scenarios for upgrades with and without tags: all scenarios covered! TODO - REST endpoint to remove orphaned schema set data, separate story: CPS-2554 - Investigate exception handling regarding DuplicateYangResourceException: CPS-2555 Issue-ID: CPS-2540 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iaa59cbdb86b7a4a8044624829bc002506ff40cc7
2024-12-20Add schema to persist notification subscription informationrajesh.kumar7-0/+691
Add required schema to persist notification subscription information. It should contain - Schema yang file - New Dataspace, Anchors or any other database entity - Refactore duplicate code in NCMP Issue-ID:CPS-2427 Change-Id: I56c34400dc73c71b936a51260efd300924ababdc Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2024-12-05Moved common classes under the api package under apileventecsanyi80-173/+178
- moved common classes under the api package - moved Spec files Issue-ID: CPS-2512 Change-Id: I88046280ce359ce8cc488ad37d4e6f85406b0dbf Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2024-12-03Add tests of attribute-axis featuredanielhanrahan3-6/+36
Following TDD, functional acceptance tests are added for attribute-axis feature. This covers xpaths such as '//books/@title' - Add stub to CpsQueryService throwing UnsupportedOperationException - Add tests showing expected behaviour (tests currently ignored) - Implementation will be provided in following commmit for CPS-2416 Issue-ID: CPS-2416 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I71817e66b28dfc21e7b75243fd0135f3cceddb8e
2024-12-02Update the minor version of CPSmpriyank1-1/+1
- Update the minor version of cps. - New version being 3.6.0-SNAPSHOT now. Issue-ID: CPS-2488 Change-Id: I87fb29fe45dc942b258bc1d45e09a3351739539b Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-11-29Bump CPS to 3.5.6-SNAPSHOTegernug1-1/+1
Issue-ID: CPS-2488 Change-Id: Ib17e4283de959ec4aab3c68bb3ba8018a10a10b2 Signed-off-by: egernug <gerard.nugent@est.tech>
2024-11-29Merge "XML content support on Replace list content"Priyank Maheshwari3-8/+39
2024-11-28De-Registration without Orphaned Module CheckToineSiebelink5-8/+103
- Testware updates to measure time spent for de-registration - Removed orphan check from module delete methods - Using @scheduled to run Db Cleaner method once (see https://lf-onap.atlassian.net/wiki/spaces/DW/pages/52494359/CPS-2478+Module+Sync+Inefficiencies#De-Registration:-Test-Measurements-With-and-Without-Orphanage-removal for reasoning) - Updated integration tests to call orphan check where need (after schema set deletion) Issue-ID: CPS-2478 Change-Id: I513af9d8bb88486a242284b58e0363a527346dd4 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-11-28XML content support on Replace list contentRudrangi Anupriya3-8/+39
Here to bring Support for XML Response Entity in Replace List content - Add ContentTypeInheadr in cpsData.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in DataRestController.java - Modify the code return xml Data - written testcase for above changes made Issue-ID: CPS-2411 Change-Id: Ibb7ffb66ccdd03703266123c6d5c2eade0e7cb4a Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-11-19Merge "Test to highlight ModuleSetTag Inefficiencies"Sourabh Sourabh1-2/+2
2024-11-18Test to highlight ModuleSetTag InefficienciesToineSiebelink1-2/+2
- Add (micrometer) instrumentation to expose inefficiencies - Add test config for micrometer - Add setup methods in base to create many cm handles - Set module sync parallelism to 2 for testing - Add clean up methods for hazelcast related tests - added test to show inefficiencies - POC 1 use hazelcast set to prevent multiple threads working on same ModuleSetTag - POC 2 'cache' module set tags per thread to prevent DB looks ups - Main inefficiency left: create schemaset for EACH cm Handled even if same tag. No easy PoC... Change-Id: Idf46b44c475a24727dd7084bb613459f4c29be55 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-11-17XML content support for only cps Query v2Rudrangi Anupriya2-38/+42
Here to bring Support for XML Response Entity in query data nodes - Add ContentTypeInheadr in cpsQueryV2.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in QueryRestController.java - Implement logic to convert data to xml - written testcase for above changes made Issue-ID: CPS-2359 Change-Id: Ieb7eeb66ccbb03703626132c6d5c2eade0e7cb4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-11-07Merge "Removing ONAP O-Parent as parent from CPS"Toine Siebelink1-2/+2
2024-11-05Removing ONAP O-Parent as parent from CPSsourabh_sourabh1-2/+2
- Fixed checkstyle and license validation. - Updated checkstyle configuration (`onap-java-style.xml` and `check-license.xml`) to ensure compatibility with Maven Checkstyle Plugin version 3.3.1 - Removed obsolete properties causing build failures. - Improved code style rules to meet ONAP Java guidelines. - Vulnerabilities scan are now configured on parent pom.xml - Fixed all code style. Issue-ID: CPS-2470 Change-Id: I1e72af604415aa7587cbe1dff471ed0323e29aa3 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-11-05XML content support on get a nodeRudrangi Anupriya5-1/+195
Here to bring Support for XML Response Entity In GET A NODE - Made changes in components.yml to support contentType as application/xml - Add ContentTypeInheadr in cpsDataV2.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in DataRestController.java - Implemented Logic to convert DataMaps To XML Data - written testcase for above changes made Issue-ID: CPS-2280 Change-Id: Ibe7ffb66ccbb03703626132c6d5c2eade0e7ab4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-10-24Refactor: Improve code quality and compliance with SonarQube standardssourabh_sourabh1-13/+12
- Consolidated multiple `if` statements to enhance readability and maintainability. - Replaced traditional `instanceof` checks followed by casting with the new pattern matching syntax for improved type safety and clarity. - Removed unnecessary casts and streamlined code in `addYangLeafList` and `addDataNodeFromNormalizedNode` methods. Issue-ID: CPS-1957 Change-Id: I46696dc184b6b3c3d0fe3a6bd12267a4e0d76193 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-10-17Release Stage 7 for 3.5.4seanbeirne1-1/+1
Issue-ID: CPS-2457 Change-Id: Id9a267c587f16f3fb5edb558b33cd0003864ed93 Signed-off-by: seanbeirne <sean.beirne@est.tech>
2024-10-09Implementation of Data validation feature in Create a Node APIArpit Singh11-32/+236
Added support to validate JSON/XML data without the need of persisting it in the databse. - added "dryRunInQuery" flag as a new query parameter - added new method as part of CpsDataService layer to perform data validation - added new method in yang parser "validateData" to validate data without persisting it Issue-ID: CPS-2361 Change-Id: I43dd33cc6120576d0fac606d5c4b0168d107311d Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-10-08Merge "Policy Executor: handle errors, part 2 (fighting between IntelliJ and ↵Sourabh Sourabh2-0/+8
Checkstyle best practices)"
2024-10-04Bump CPS to 3.5.4-SNAPSHOTmpriyank1-1/+1
- bump cps to 3.5.4-SNAPSHOT - updated release notes Issue-ID: CPS-2434 Change-Id: I3d5e6f37711bb29b61b598cc5af57ecfdc35cbba Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-10-03[BUG] Fix memory leak related to using arrays in Hibernatedanielhanrahan1-12/+10
The use of arrays like String[] instead of Collection<String> in JpaRepository methods is causing a memory leak, most likely due to a bug in the hypersistence-utils dependency which provides the feature. Note code using arrays in JDBC (via jdbcTemplate) is not affected. This patch removes most uses of arrays in Java, except one needed for FragmentPrefetchRepository using JDBC setArray(), which is safe. Issue-ID: CPS-2430 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I94f8c3d4c8c32ebe0978c08d3226a196a95bf3b9
2024-10-03Policy Executor: handle errors, part 2ToineSiebelink2-0/+8
(fighting between IntelliJ and Checkstyle best practices) - non-2xx responses are processed using web client exceptions - handle unknown host exception - upgraded spotbugs (checkstyle and related mvn plugin) - fixed some small spotbugs due to upgrade - added commented instructions in docker compose to enable debugging - added some environment variables for policy executor configuration - extract out Sleeper in stub service to achieve 100% coverage - added cause to Policy Executor exceptions where applicable - ignored (new) spotbug rule about catch NPE because of issue in 3pp - ignored (new) spotbug rule about \n in string due to multiline string block Issue-ID: CPS-2412 Change-Id: I6835a73320c436cbeea12cc7a06f15899eec7bf1 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-10-03Update JIRA and Wiki links host name from wiki.onap.org to lf-onap.atlassian.netsourabh_sourabh5-7/+7
Issue-ID: CPS-2432 Change-Id: I53f380a4fe0968d1ec9f1393651c7c43f03d0d95 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-09-24Remove Hazelcast cache for prefix resolver (CPS-2417 #2)danielhanrahan10-524/+22
This patch removes the AnchorDataCache from CPS, which is used for prefix resolution in get/query operations. As such, Hazelcast is no longer a dependency of CPS, only NCMP. - Changed PrefixResolver to be more efficient. - Removed AnchorDataCache and associated classes. - Moved HazelcastCacheConfig to NCMP. - Removed Hazelcast dependency from cps-service/pom.xml This shows good performance improvements in some APIs such as v2 GET which is nearly 2x faster (also 5x faster including base patch). Issue-ID: CPS-2417 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I24768469f24e90b70f7a6187faa4f5b3d75777d2
2024-09-24Reduce anchor lookups related to PrefixResolver (CPS-2417 #1)danielhanrahan3-21/+7
Instead of looking up same Anchor many times inside a for-loop, do it once outside the loop. This greatly improves performance in some cases, such as v2 GET API: - /cps/api/v2/dataspaces/{dataspace}/anchors/{anchor}/node Testing shows 3x faster response time. Issue-ID: CPS-2417 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I80d97d8cc24372eed70626ed840cad985cbe0a4b
2024-09-17Refactored cps-ri package structureleventecsanyi15-26/+24
- fixed import order and moved package structure Issue-ID: CPS-2293 Change-Id: Ie2f9f057f261577054530feee7480850ba4b41e1 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2024-09-11Merge "Renaming Delta Operations as per RFC 9144"Priyank Maheshwari5-20/+20
2024-09-10Renaming Delta Operations as per RFC 9144Arpit Singh5-20/+20
RFC 9144 recommends naming convention for operations that can be performed on any datastore. The recommended names are: - create - remove - replace Whereas in CPS Delta feature these operaitions were named: - add - remove - update So, "add" and "update" operations have been changed to "create" and "replace" respectively. Issue-ID: CPS-2393 Change-Id: Ie39f5f8ccc91e96cf484ca7fbc833a6be8758054 Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-09-02Remove unused and duplicate dependencies in pomsdanielhanrahan1-12/+0
- remove duplicate dependencies from cps-service pom - remove unused spring security dependency from cps-application pom Issue-ID: CPS-2390 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Id49705e8790df7d7e98d80fa0ccb639eb4f1995f
2024-08-21Bump CPS to 3.5.3-SNAPSHOTdanielhanrahan1-1/+1
- bump CPS to 3.5.3-SNAPSHOT - updated the release notes and prepared for the next release Issue-ID: CPS-2374 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I60ea5f5864f5818d1ed5078e375cf07b8d713dde
2024-08-13CPS-NCMP: Slow cmHandle registration when we use moduleSetTag, alternateId ↵sourabh_sourabh4-0/+77
and dataProducerIdentifier - Created a new repo. service for fragment table that executes a native sql query to find first ready cm handle id based on moduleset tag and then returns list of module references. - Exposed a new interface into module service that is used by module sync service to get list of midule refs by module set tag. Issue-ID: CPS-2353 Change-Id: I438dbd1ed37c1ff4e15f792e93a095aa604120bc Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-08-01XML content support on add list elementRudrangi Anupriya3-14/+22
Issue-ID: CPS-2287 Change-Id: Ibb7ffb66ccbb03703266132c6d5c2eade0e7cb4a Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-07-24Update response message for data validation failureArpit Singh2-9/+5
- Make the response message more informative and cleaner in case of data validation failure. - Updated message body will not contain the entire jsonData as part of response sent back to the user Issue-ID: CPS-2306 Change-Id: I28aab1450779af98ccdd11701e78bdfcdbc18cf0 Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-07-18Integration test to validate DMI service URLsourabh_sourabh1-1/+1
- New groovy test is written to validate if dmi service url is encoded correctly. Issue-ID: CPS-2317 Change-Id: I048bf37dd3ba4f37df7dace927f55bf8dd899922 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>