aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service
AgeCommit message (Collapse)AuthorFilesLines
20 hoursMerge "Efficient implementation of Attribute Axis in SQL"HEADmasterLee Anjella Macabuhay1-1/+1
21 hoursEfficient implementation of Attribute Axis in SQLdanielhanrahan1-1/+1
Attribute Axis is the feature which allows fetching only a single attribute, e.g. //books[@title='Matilda']/@price -> [15] This implements the attribute axis feature directly in SQL, giving much higher performance e.g. for CM-handle ID searches in NCMP. The native SQL implementation directly returns data leaves from DB, not requiring conversions to FragmentEntity, DataNode, etc. Issue-ID: CPS-2623 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I54f517e47ca6bcddfae356f98857b05fd2e1229e
3 daysRefactor Consumers/Producers based on agreed formatemaclee6-21/+21
- agreed: consumer over producer - agreed: 'Consumer' is named based on what it consumes - agreed: no 'Publisher' in names, use producer instead - AsyncRestRequestResponseEventConsumer to DmiAsyncRequestResponseEventConsumer - LcmEventsService to LcmEventsProducer - CmAvcEventPublisher to InventoryEventProducer - CpsDataUpdateEventsService to CpsDataUpdateEventsProducer - see https://lf-onap.atlassian.net/wiki/spaces/DW/pages/16514237/CPS+Data+Notifications+Overview?force_transition=43836314-5d80-4b83-b9f4-7880332d79a4 for more info Issue-ID: CPS-2597 Change-Id: Iaafb435fcf985372d4858bcbbcd98901ac778b52 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
8 daysUse attribute-axis in NCMP [#3]emaclee2-5/+5
- uses queryleaf API on the methods 'getCmHandleReferences' Issue-ID: CPS-2664 Change-Id: I7552b4cdfcfa5eb285b94c1dcebfa5ba8327508c Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
2025-03-13Add attribute-axis to CPS query nodes rest APIdanielhanrahan3-2/+34
Support attribute-axis in query nodes api for both JSON and XML: /cps/v2/dataspaces/{dataspace}/anchors/{anchor}/nodes/query It allows such queries as: //books/@title which returns a JSON response like: [{"title":"Matilda"},{"title":"Dune"}] and an XML response like: <title>Matilda</title><title>Dune</title> Issue-ID: CPS-2620 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Iab51fbe76281740b8dbde373e11864d3509696ef
2025-03-13Move CPS REST business logic to CPS-Service LayerToineSiebelink13-160/+583
(scope limited to methods using PrefixResolver) - Introduced CPSFacade (for methods invoking multiple CPS Services related to Prefix insertion) - Introduced DataMapper to combine PrefixResolver & DataMapUtils - Moved includeDecendants boolean to Enum conversion to Enum class - Removed redundant tests from DataRestControllerSpec - Removed redundant tests from QueryRestControllerSpec - Cleaned up some legacy testware (adding assert etc) Issue-ID: CPS-2428 Change-Id: Ib3b4dae941ada441be0dc76aaa5cd14e48685cf7 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-03-12Merge "Allow limiting results in queryDataLeaf"Toine Siebelink4-6/+28
2025-03-12Merge "Refactor buildDataNodes to a separate service"Priyank Maheshwari6-145/+441
2025-03-12Refactor buildDataNodes to a separate serviceArpit Singh6-145/+441
- Moved the code for buildDataNodes from CpsDataServiceImpl.java to a separate service named DataNodeBuilderService.java - Renamed the methods to be clear and in-line with their intended use in DataNodeBuilderService class - Moved ROOT_NODE_XPATH and NO_PARENT_PATH to CpsPathUtils Issue-ID: CPS-2487 Change-Id: I46cf843ab79b1e2547d968fbd30528270b95cc16 Signed-off-by: Arpit Singh <AS00745003@techmahindra.com>
2025-03-11Allow limiting results in queryDataLeafdanielhanrahan4-6/+28
This exposes queryResultLimit parameter in queryDataLeaf, same as was implemented for queryDataNodes API. Issue-ID: CPS-2680 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ieb922ac1acc91dbfd67fb5ade7856213a2f93ce8
2025-03-06Fix degradation in (de)registration performanceToineSiebelink4-64/+80
- Disabled CPS notifications by default (in yaml and java) - minor refactoring of related production code - Improved unit test regarding notifications being enabled/disabled to get 100% coverage - Removed now redundant test for enable/disable scenarios (2 replaced by 1 better test) Issue-ID: CPS-2684 Change-Id: If43cd9c06c1655e1d49c70c55830c4e3a579a6d4 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-03-05Merge "Add APIs to control notification subscription"Daniel Hanrahan8-12/+408
2025-03-05Add APIs to control notification subscriptionrajesh.kumar8-12/+408
- Add API for notification subscription - Add API for notification unsubscription - Add API for getting notification subscription information Issue-ID: CPS-2428 Change-Id: I56c34400dc73c71b936a51260efd241224dccdba Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2025-03-03Bump CPS to 3.6.2-SNAPSHOTegernug1-1/+1
Issue-ID: CPS-2670 Change-Id: Ida5b74651cca38749c43bd21f410ba539539d914 Signed-off-by: egernug <gerard.nugent@est.tech>
2025-02-28Merge "Change order of CM Handle Reference lookup depending on special ↵Sourabh Sourabh3-3/+188
character"
2025-02-27Change 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>
2025-02-20Handle 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>