aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/main
AgeCommit message (Collapse)AuthorFilesLines
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)ToineSiebelink4-18/+229
- 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 Maheshwari4-150/+156
2023-08-25Merge "Subscription Forwarding Fix"Priyank Maheshwari1-22/+2
2023-08-24Extend model loader to support model-upgrade (part 1)ToineSiebelink4-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>
2023-07-31Add 'direct' keyword to descendants option to query direct children (ep1)Rudrangi Anupriya1-3/+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-31Increase code coverage in cps-service moduleToineSiebelink5-8/+45
- After last rebase I had to remove 3 unused recent cloud eventd specific exceptions/constructors - Moved the only used new exception from SPI to the relevant util package (please NOTE not all exceptions belong in SPI and always question need for new exception when there is no specific handling, try to use standard or existign CPS exception instead!) - Increased cps-service module (line) coverage from 95 to 100% - Added tests for missing exceptions (handling i.e. thrown up) - Removed incorrect SPI defined OperationNotYetSupportedException (replaced with standard java exception instead) - Fixed some legacy issues with existign test classes I modified (unnecessary setup, conventions etc) - Increased coverage for DataNodeBuilder - Added or modified test to include more spi models - Added tests for Hazelcast Configs - Added more tests for json object mapper - Added test and fixed error handling in YangUtils/XmlFileUtils (it was incorrectly converting a config exception to a data validation exception) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I5852ba01bc5b33ae361b8f29daae9868f05baa35
2023-07-28Add '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: Iab7f59fbeebb03703626132c6d5c2afde0e5ab4d Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-26Subscription Creation: NCMP to Client CloudEvent transformationhalil.cakal17-255/+465
- Delete legacy avc subscription event and event outcome schemas - Change subscription response and outcome sample json file contents - Change ncmp event response code to support avc subscriptions - Add mapper that maps cloud event to subscription event response - Add mapper that maps subscription event outcome to cloud event - Change subscription event response consumer to consume CloudEvents - Change time out task to support response event instead client id and name - Change subscription event response mapper to support Cloud Event - Change subscription outcome mapper to group subscription responses as per details and status - Change subscription status to have fromString functionality - Change all unit tests to support new functionalities - Add cps exceptions for cloud event and outcome type - Add details field in yang model - Change data node helper to supoort details field - Consolidate final subscription response codes - Fix code smells reported by SonarLint Issue-ID: CPS-1739 Change-Id: I5eadeb8ef40d3d7befb762b5a8d2139fe3c85d7e Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-07-13Improved code coverage for NetworkCmProxyDataServiceImplToineSiebelink1-19/+10
- Production code had catch block that is no longer needed - Cleaned up some test somewhat (close to the new tests) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iaa409e752a496bf088a58ccd422fe3d850442b59
2023-07-13Introduced a dmi rest demo csit stubsourabh_sourabh1-0/+1
- Introduced a new response code 0 for data operational success response. - Created a new dmi plugin rest stub for demo and performance testing. - Removed dmi plugin stub of wiremocked. - Updated parent pom to add newely created demo stub. - updated docker compose to add neww demo stub with profile for CSIT, demo and performance testing. - Removed target id list from unsupported operation/datastore from REST response. Issue-ID: CPS-1560 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ie8198366df820e7d4b8b6e8a85ff9cdb0fce7435 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-07-12Improved code coverage (branches) for sync watchdogToineSiebelink1-6/+7
- had to refactor prod. code slightly to make it testable - added a batch size check although the task is a simple iteration there is overhead in creating a paralel task Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I0db7ba3a15f4edc469a5af1ddc6fd76922b16809
2023-07-11Combine alreadyDefinedException classesdanielhanrahan2-5/+4
Issue-ID: CPS-1774 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10
2023-07-10NCMP fails to start if /subscription-registry already existsdanielhanrahan1-1/+2
cpsDataService only throws AlreadyDefinedException, not AlreadyDefinedExceptionBatch. This causes NcmpStartupException to be thrown during startup, if /subscription-registry exists. Issue-ID: CPS-1783 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I5667d891f855ef47ca2475891f9216be102932ed
2023-07-07Subscription Creation: NCMP to DMI CloudEvent transformationhalil.cakal5-54/+174
- Add mapper to convert client event into ncmp event - Add sample json object of ncmp version - Change subscription event consumer to consume CloudEvents - Change subscription event forwarder to publish CloudEvents - Change test producer config to support CloudEvents - Change sample subscription event json to comply with new schema - Add more test for missing branches - Change packages of the mappers into relevant directory Issue-ID: CPS-1737 Change-Id: I8c9e6e7bf713a8fb530a0586dfb2bce796a462f5 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-29Merge "Clearing code smells"Toine Siebelink1-3/+6
2023-06-29Clearing code smellsToineSiebelink1-3/+6
- added/updated @deprecated javadoc in EventPublisher Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ic0fa3efbc7dc580368bed6782db683b3c7a4d918
2023-06-29Merge "Updating the Kafka listener compliance to could events and legacy"Toine Siebelink4-62/+86
2023-06-29Updating the Kafka listener compliance to could events and legacyraviteja.karumuri4-62/+86
# Added filter property to the legay(DMIAsync) Consumer # Added containerFactory property to the CloudEvent(DataOperation) consumer to use 'cloudEventDeserializtion' Issue-ID: CPS-1746 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: I73315b816eb6446b7e163fd8779bc35fd6cbef63
2023-06-29NCMP : NCMP : Handle non responding DMI-Pluginsourabh_sourabh3-20/+58
- Added new response code for non-responding dmi and non-success. - Captured any exception after sending request to dmi service and then create a cloud event with error code and publish it to client topic. - Minor modificarion into resource data operation util class. Issue-ID: CPS-1558 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I39d409fb42856b816bf9833c2a23f7fa250a1e62 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-28Improved code covage (branches) around cm handle state changesToineSiebelink1-6/+5
- added test - removed redundant (unreachable) check in production code Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ia39ac7a1473a248710c2a52f65715fb6b6a85fca
2023-06-28Merge "Streamline outcome response for subscription creation"Priyank Maheshwari5-21/+90
2023-06-27NCMP : Handle non-existing and non-ready cm handlessourabh_sourabh9-150/+449
- Modified data operation schema to contains cm handle as steing and response content field name as result. - Added a new common cloud event builder for NCMP to create an event. - Added data operation event creater that uses cloud event builder to create a cloud event. - Introduced a new method onto json object mapper to convert json object to bytes. - Modified EventDateTimeFormatter and added a new method to convert date timestamp into offsetdateTime. - Added a new code into ResourceRequestUtil to identify non-ready cm handle and non-existing cm handle and later publish it as cloud event to tha client given topic. - Introduced CpsApplicationContext to get spring mannaged bean into non spring managed java object. Issue-ID: CPS-1583, CPS-1614 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I24a39d2cb2c54dea25cd2f17e7748e21cd83a088 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-26Streamline outcome response for subscription creationhalil.cakal5-21/+90
- Pivot to outcome response generated from db for the corresponding subscription - Fine tuning to wait till the cutoff time for all cm handles that subject to subscription - Update cm handles as rejected if dmi plugin or cm handles does not exist in db - Add more test for missed branches in mappers and response outcome Issue-ID: CPS-1741 Change-Id: I82ab6958e673059977abc7708974d5a2cb13e339 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-26KafkaListener config for CloudEventsmpriyank2-14/+44
- Introduced kafkalistener factory configs to correctly use the configs and convert the incoming events to CloudEvents - Also legacy events to use a separate listener factory - Increased the wait time from 100ms to 300ms to listen to the message in the test Issue-ID: CPS-1764 Change-Id: I8b9fe0ba82ef87d52b7731941ccd3af8ae980109 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-06-23#2 NCMP : Replacing the word 'Batch' as 'DataOperation'.raviteja.karumuri5-69/+71
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ib04e9d8a909e8868bf094e2625412996409b3a67
2023-06-22NCMP : Replacing the word 'Batch' as 'DataOperation'.raviteja.karumuri7-49/+49
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ie9f56effb160582ba7177331fb6260b2bde2342b
2023-06-21Improve handling of legacy eventsToineSiebelink1-2/+7
Legacy (non-cloud) events would cause a NPE in the event filter Although the event woudl still be ignored it would lead to uncessary error logging This fix addressed this issue using a trace level message instead (also some improvements in the associated test) Issue-ID: CPS-1724 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ibf71b13e4a47aaf705e32df5fe50cf41de5f558f
2023-06-21Merge "Patch # 3: Data operation response event (NCMP → Client App) to ↵Toine Siebelink3-23/+16
comply with CloudEvents"
2023-06-21Patch # 3: Data operation response event (NCMP → Client App) to comply ↵sourabh_sourabh3-23/+16
with CloudEvents - Modified data operation record strategy to consume cloud event. - Modified NCMP data operation event consumer to read cloud event header. (prefixed with ce_) - Modified event publisher to support legacy and cloud event based on event type (if legacy event use legacy kafka template else cloud kafka template). - Introduced a new method onto json object mapper to convert json object to bytes. - Modified data operation consumer spec to produce a cloud event and validate it. - Added Kafka Integration Test (for filtering) Issue-ID: CPS-1724 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ide701b1ff952f57413cb4e4aa0d55c08753f0298 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-21publishLcmEventBatchAsynchronously is not asyncdanielhanrahan3-47/+83
Spring @Async has a limitation where calling the async method from within the same class won't work, as the method needs to be proxied, and calling from the same class bypasses the proxy and calls the underlying method directly, thus running synchronously. Issue-ID: CPS-1749 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I7f198487dc18b359654dc38b5cf8fd600d33e189
2023-06-20Merge "DMI Data AVC to cloud events"Luke Gleeson3-63/+24
2023-06-20Merge "Patch # 1: Data operation response event (NCMP → Client App) to ↵Toine Siebelink2-20/+21
comply with CloudEvents"
2023-06-19Patch # 1: Data operation response event (NCMP → Client App) to comply ↵sourabh_sourabh2-20/+21
with CloudEvents - Removed header definitions (since we now use CloudEvents) - Used 'dataOperation' instead of batch where appropriate. - Modified test json Issue-ID: CPS-1724 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ic0f65297b944adf9cf5f3c2cbec679a031a675ec Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>