aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main/java
AgeCommit message (Collapse)AuthorFilesLines
2023-11-28Publish trust level notification eventJvD_Ericsson9-54/+256
- Add mapper that maps attribute value change event to cloud event - Add publisher that publish the cloud event from ncmp to client - Handle notifications for the uses cases below - Initial registration case - Device heart beat consumer case - Dmi status changes within dmi watchdog case - Added tests for mapper, publisher, and trustLevelManager - Added test for dmi watchdog Issue-ID: CPS-1910 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I7c0798346a221e703da58902b9d631115de8d91a Signed-off-by: halil.cakal <halil.cakal@est.tech> Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
2023-11-23Retry for yang module upgrade operationsourabh_sourabh6-57/+102
- Added retry code for yang module upgrade failed Issue-ID: CPS-1802 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ida68d45f926ed48b92f4b5a3b82e641d778303ce Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-11-23Merge "Onboard merge subscriptions model"Priyank Maheshwari2-17/+32
2023-11-21Onboard merge subscriptions modelemaclee2-17/+32
-Add new model in subscription -Update unit tests for uploading models using modelLoader -Modify abstract model loaders to handle more than one yangResource in creating schema set -Modifying use of the basic subscription model to the new model will be on a seperate commit Issue-ID: CPS-1928 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I5805ab8c721e8a63726fd210379e815b84b387a3
2023-11-14Trust level updates with dmi status changehalil.cakal8-171/+120
- Change dmi watchdog to store Trustlevel for each DMI - Corrected query algorithm for TrustLevel Queries Issue-ID: CPS-1907 Change-Id: I7ca25db8edfd25b72bcda48e4fde1d9be5c56dc0 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-11-13Add DMI trustlevel at registrationseanbeirne1-1/+13
-Re-introduce trustLevelPerDmiPlugin to registration process Issue-ID: CPS-1902 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: Ic3f154aca60c3e1244ff4fd9a4c4865964884b31
2023-11-08Merge "CPS-NCMP: No yang resources stored during cmhandle discovery however ↵Toine Siebelink1-1/+3
cmhandles are in READY state"
2023-11-08CPS-NCMP: No yang resources stored during cmhandle discovery however ↵sourabh_sourabh1-1/+3
cmhandles are in READY state - Applied blank check on modulesettag while pushing module list into cache. Issue-ID: CPS-1956 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ia0d0b531a9750ef2ea011d6fc13e4d1b4c99fb64
2023-11-08Fix Code Smellsseanbeirne1-3/+2
Issue-ID: CPS-1957 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I901fd568752dbb42d95fa330f8d6d7dd0128b95f
2023-11-02Handling Yang module upgrade error scenariossourabh_sourabh5-49/+72
- cm handle not ready, not found , invalid id Issue-ID: CPS-1802 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I2039faa44abbda17237e7c2dc085b4ac775c2039 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-11-02Initial Registration with trustLevel on NCMPseanbeirne2-8/+18
- Updated NcmpServiceCmHandle class to include registration trustLevel Issue-ID: CPS-1902 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I7c97928f5cdd82f3036a57ea5f0c149e2872f4f1
2023-10-26[BUG] CPS NCMP Change extension in health check URLhalil.cakal1-2/+3
- Align URL extension to default actuator URL Issue-ID: CPS-1922 Change-Id: Ifaa1eb32f3c6be5c48a63c4e360c27353d0e5e0f Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-10-23Introduce and use new Hazelcast map pt. 2sourabh_sourabh7-63/+113
- modified ModuleSyncService - created ModuleSetTagCacheConfig and tests - ensure both Create and Upgrade cm Handle use cases work - Moved inventory pkg to its right patha as production code. Issue-ID: CPS-1859 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I173dcd81fe2e74d86d85365b2ead461302cad974 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-19Code coverage: Update YANG schema set using moduleSetTagsourabh_sourabh1-5/+11
- Code coverage is increased to 98. - New groovy test is added to cover new code. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ia979be3f43ec8e4bbf6f8cb66a8a5e748118f19b Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-18Fix Sonar code smellsemaclee1-6/+3
- Update deprecated methods in webSecurityCOnfig - Remove 'deprecated' tag on methods that are to be removed in EventsPublisher as they are still being used, methods with deprecated tag (for removal) must not be used Issue-ID: CPS-89 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I104d4b3e362d22bb7fc020580de6cb4f390e54c9
2023-10-16Merge "Add withTrustLevel condition to CmHandle Query API"Toine Siebelink13-88/+145
2023-10-12Add withTrustLevel condition to CmHandle Query APIhalil.cakal13-88/+145
- Change untrustworthyCmHandleSet with trustLevelPerCmHandleMap - Change trust level cache config accordingly - Change device heartbet consumer accordingly - Add json schema for device trust level - Add with_trust_level enum into cm handle query conditions - Add query cm handle by trustlevel function to cm handle queries - Add query cm handle by trustlevel service to network cm proxy cm handle service - Add unit tests and fix code smells Issue-ID: CPS-1864 Change-Id: Ie214f0713cef779307d3379df81e2b95115b6d6d Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-10-11Expose REST endpoint to update YANG schema set using moduleSetTagsourabh_sourabh17-74/+288
- Added new schema to upgrade model into component. - Modified Ncmp rest input mapper to add upgradedCmHandles attributes. - Modified cm handle state mapper to add new lock reason. - Added new method to parse and upgrade Cm handles in DmiRegistration. - YANG data converter is modified to add "module-set-tag" atribute. - Cm handle new query method is added for cps path without appending ancestor. - Modified setCompositeStateForRetry to add lock reason. - New lock reason category is added. - Existing module sync service is modified to upgrade the model "syncAndCreateOrUpgradeSchemaSetAndAnchor". - Sync util method "getModuleSyncFailedCmHandles" to modified to add another lock reason "LOCKED_MISBEHAVING". - Added new attribute "UpgradedCmHandles" into DmiPluginRegistration and DmiPluginRegistrationResponse. - New attribute "moduleSetTag" is added into NcmpServiceCmHandle. - New model "UpgradedCmHandles" is added. - New method "updateSchemaSetWithExistingModules" is added into cps module service to update cm handle with exsting model. - Code coverage is reducced to 96 percentage that would be addressed and pushed into new patch. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I540acb404e38fc434de87a0d959bfde710a18b03 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-10Conflicting Error codesourabh_sourabh8-95/+87
-Used common error codes for NCMP responses Issue-ID: CPS-1904 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id2beaa9f3d49dffd0a193b05fbaa7a6dd801e34a Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-09-29Fix Sonar Code Smellsmpriyank2-21/+18
- convert normal java strings to text block - feature from java 15 - handling callback for legacy events. Once the deprecated methods are removed then this would not be needed. Issue-ID: CPS-89 Change-Id: I9b537ebee2c284c8109e6cc6c8961a430ee9599d Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-09-26Introduce and use new Hazelcast map for module set tagleventecsanyi2-0/+16
- added new IMap for moduleSetTags, updated SynchronizationCacheConfigSpec - updated deployment.rst Issue-ID: CPS-1859 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I5233c5150fd784974d7c1e5ba387119c1eaba194
2023-09-25Refactoring persistence classessourabh_sourabh42-350/+404
- Created a common ncmppersistence pkg inside ncmp service "api/impl" pkg". - Move "inventery" into "api/impl" pkg. - Created common class named as "NcmpPersistence" inside "ncmppersistence" pkg. - Move all the commin constants and methods into "NcmpPersistence". - SubscriptionPersistence and InventoryPersistence extends "NcmpPersistence". - Find and replace all the constants of NCMP. Issue-ID: CPS-1883 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id3e678109766d680589fa7aab965ea251a55f075 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-09-25Merge "Reinstate Spring Boot 3.0 after revert"Toine Siebelink10-35/+42
2023-09-25Merge "Add DMI to TrustLevel Cache During Registration"Priyank Maheshwari2-2/+15
2023-09-22Reinstate Spring Boot 3.0 after revertegernug10-35/+42
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b
2023-09-21Add DMI to TrustLevel Cache During Registrationseanbeirne2-2/+15
Issue-ID: CPS-1861 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I1e71b78eec9e2a9f536f82ef1ba5a9933ca2bf6b
2023-09-21Merge "Set lock state and reason upon request"Toine Siebelink3-11/+20
2023-09-20Revert "Migrate CPS to Spring-boot 3.0"Toine Siebelink10-42/+34
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-18Set lock state and reason upon requestleventecsanyi3-11/+20
- added new LockReasonCategories and improved SyncUtils.isReadyForRetry - refactored logic aroudn retry times - refactored unit tests Issue-ID: CPS-1860 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I4382d6ad1fa0a7d9dacb8c8281b0458a5afc0375
2023-09-18Merge "Migrate CPS to Spring-boot 3.0"Toine Siebelink10-34/+42
2023-09-14Migrate CPS to Spring-boot 3.0egernug10-34/+42
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I932fca8a50cedf2ae0604401c5e2b27896e4d449
2023-09-04Dmi plugin watchdog cheking alivenesshalil.cakal4-9/+121
- Add capability of GET request into DmiRestClient - Add watchdog job to check aliveness of dmi plugins - DmiPluginStatus enum as UP or DOWN - Add unit tests for the new function in dmi rest client - Add unit tests for dmi watchdog Issue-ID: CPS-1856 Change-Id: Ic38a96f0485a0bfe1b6af5bb2f57f6119d8fa563 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-31Merge "Hazelcast cache config stroring trust level per dmi plugin"Priyank Maheshwari1-0/+16
2023-08-31Hazelcast cache config stroring trust level per dmi pluginhalil.cakal1-0/+16
- Add Hazelcast cache config to store trust level per dmi plugin Issue-ID: CPS-1855 Change-Id: Ibe7f8393008ca7352aacddba99ecd19d6e1eb326 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-29Extend model loader to support model-upgrade (part 2)ToineSiebelink3-18/+98
- add upgrade related methods to common abstract class - add new (agreed) inventory model - add InventoryModelLoader - add more logging for success cases - simplified constant names considering the context (class name) Issue-ID: CPS-1804 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I61a5c6d320d340a5c469ce20140f984439ba71a2
2023-08-25Merge "Extend model loader to support model-upgrade (part 1)"Priyank Maheshwari3-150/+156
2023-08-25Merge "Subscription Forwarding Fix"Priyank Maheshwari1-22/+2
2023-08-24Extend model loader to support model-upgrade (part 1)ToineSiebelink3-150/+156
- refactor existign code for easier extension (no code changes yet, just want to review refactor in this first patch...) - changed log level of some (error) logging Issue-ID: CPS-1804 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I234ad6c4057e9447cd39a83b8f48799918ca6b7f
2023-08-24Subscription Forwarding Fixlukegleeson1-22/+2
Issue-ID: CPS-1853 Change-Id: Ic3f2bf28e18d3cadafb57e9dd4bfce8ab06cdb49 Signed-off-by: lukegleeson <luke.gleeson@est.tech>
2023-08-21Replace event-id with correlation-id for data read operation cloud eventsourabh_sourabh1-3/+3
- Modified data operation event consumer to send correlation-id instead if event-id while publishing cloud event to client topic. Issue-ID: CPS-1842 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I30738b90d2ff0d14b5ee0bac680eff834aa968bf
2023-08-21Merge "Cm Subscription: PENDING logic handling in NCMP"Luke Gleeson7-77/+171
2023-08-18Merge "Device heartbeat listener"Luke Gleeson4-0/+179
2023-08-18Device heartbeat listenermpriyank4-0/+179
- Infrastructure code to have the kafka listener and distributed set in place - performance tested locally - testware added Issue-ID: CPS-1642 Change-Id: I775dbe6e6b520b8777faa08610db439877757572 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-18Modify data operation schema to accommodate additional informationsourabh_sourabh3-44/+44
- Code is modify to add resourceIdentifier and option to data operation kafka response for status code 100, 101, 102 and 103. Issue-ID: CPS-1837 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I1f7870d9d373f69de03240700b9d74be46fbfb6c Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-08-17Cm Subscription: PENDING logic handling in NCMPmpriyank7-77/+171
- Remove PENDING state from dmi schema - Modify ncmp out event mapper to categorize response per details - Rename class and method names as well as in unit tests - resolved the merge conflicts Issue-ID: CPS-1830 Change-Id: I5b7f523f546ec9940c246bd286586fdeba2f892e Signed-off-by: halil.cakal <halil.cakal@est.tech> Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-11Generic Cloud Event Mappermpriyank5-88/+68
- Introduced a generic event cloud mapper to be used all over the codebase - Added as a utility so we dont have to inject it as spring bean - Refactored code and added tests - Incorporated review comments Issue-ID: CPS-1827 Change-Id: I8dab914791e01bbf6492ce96e7ba6eaa8f75a6cb Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-09Refactoring Subscription Create LCM use casempriyank12-199/+200
- Client to NCMP: CmSubscriptionNcmpInEvent - NCMP to DMI: CmSubscriptionDmiInEvent - DMI to NCMP: CmSubscriptionDmiOutEvent - NCMP to Client: CmSubscriptionNcmpOutEvent - code package changed from avcsubscription to cmsubscription - Other classes name as per the events naming above - Test classes refactored - NO LOGIC changes incorporated in this patch Issue-ID: CPS-1831 Change-Id: Id5ad5f799007deaaf6d6fc0f402c130339263d09 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-09Modify DmiDataOperationRequest to make it identical as DataOperationRequestsourabh_sourabh3-7/+42
- Modified DmiDataOperationRequest attribute from operationType to operation. - Wrapped operation details to parent attribute operationd array. Issue-ID: CPS-1833 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I79aa943e10e1c32c3252a6eb4375c14496476f8b Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-08-04Subscription Creation: Fixes for code review after demohalil.cakal9-84/+46
- Change missleading subscription details in testware - Change datastore check to comply with CPS enum - Remove redundant CloudConstructionException - Change exception handling in cloud event mappers to avoid loss of information - Remove exception handling from scheduler service as discussed in the meeting Issue-ID: CPS-1732 Change-Id: I9fee2eafd4db97a0eed80e39219463c904f5a980 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-04Ability to disable sending auth headermpriyank2-1/+5
- introduced configurable parameter to disable sending auth header in the request to dmi-plugin - default is to include the auth header - DMI_AUTH_ENABLED flag can be set to true/false to control the behaviour - Also added the env variables to the CSITs - updated release-notes Issue-ID: CPS-1819 Change-Id: If97c06e33f06e391d2190b7300d73210ed2f4e27 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>