aboutsummaryrefslogtreecommitdiffstats
path: root/services/services-engine/src/main
AgeCommit message (Collapse)AuthorFilesLines
2022-02-23Add support for retrieving apex-policyModel from metadatarameshiyer271-2/+19
Apex policyModel had been provided under policy properties for apex-pdp. Additional support included to retrieve the policyModel from metadata if PAP supplied it as metadataSet. Issue-ID: POLICY-3834 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: Ic810d78cf01c507c5b4d167f28ae6f7729132238
2022-02-11Remove apex-pdp unused core modulesliamfallon1-3/+2
This is the final review in the refactoring of the model code in apex-pdp. The core-messaging and core-infrastructure modules are unused in apex-pdp except for websocket communication. Websocket communication is also not used in any deployment. This review: - removes the core-mesaging module, which had an apex-specific websocket implementation, except for the MessageException class, which is moved to the base core module - removes the core-infrastructure module, except for the ThreadUtils class, which is moved to the base core module - removes the websocket event protocol, which used core-messaging but is not used in any deployment - collapses all three "core" submodules into a single module - Updates dependencies where needed Issue-ID: POLICY-1820 Change-Id: Ieae30063e99570e61943372d3fa23b77a211462c Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-02-10Merge "rename metrics as per global constants for prometheus"Liam Fallon1-32/+21
2022-02-09rename metrics as per global constants for prometheusRashmi Pujar1-32/+21
Issue-ID: POLICY-3760 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I0fb59e8d9c95fd81a1754bb769705ef753b9022d
2022-02-09Merge "Remove JAXB and XML, use GSON for JSON"Jorge Hernandez2-19/+42
2022-02-08Remove JAXB and XML, use GSON for JSONliamfallon2-19/+42
This review converst apex-pdp to use GSON for JSON handling. In order to preserve backward compatibility with the JAXB format of JSON, custom handling of maps was required. Therefore, the policy-common StandardCoder could not be used. There are a lot of small changes, removing annotations from concepts and tweaking of test data. However, this cleans up the code base so it is worth doing. Issue-ID: POLICY-1820 Change-Id: I213fa64f6d7f3f1df8d10f111d9fbedbe80f9fe0 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-02-07Expose APEX policy execution metricsRashmi Pujar1-2/+42
Testing of these metrics will be covered in CSIT. Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I8aed49d113f071ab33691f8cf1df624f3358386a
2022-01-24Add TOSCA policy status header field to APEX event create CLIRashmi Pujar5-23/+72
In order to expose the processing status of a TOSCA policy to APEX-PDP, a new header field for APEX concept "event" has been introduced to track this within an APEX policy implementation. This field will be leveraged to extract the TOSCA policy execution metrics. Note, that the field is marked as optional for backward compatibility. Unit tests have been augmented to test for the field wherever applicable and the default empty value is retained for the others. "example-grpc" module has been updated to include this field. Exposing the TOSCA policy execution metrics is outside the scope of this patch since the current changes are already very large owing to the atomic nature of the change introduced. Issue-ID: POLICY-3845 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: Ief6d70f9abcfc8414e10aa51a27815ee9028e4c8
2021-11-30Prometheus metrics for policy deploy/undeploy requests for APEXRashmi Pujar1-83/+42
Added counters for: - Policy deploy/undeploy requests total - Policy deploy/undeploy successful requests total - Policy deploy/undeploy failed requests total Cleaned up unused method resetAllStatistics. Fixed some checkstyle warnings Update to latest snapshot for parent, and common modules Depends on https://gerrit.onap.org/r/c/policy/parent/+/125974 for build to pass. Issue-ID: POLICY-3760 Change-Id: I4a9447c9caea7a018dba86057b9dae3871910709 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca>
2021-09-01Fix sonars in apex-pdp #3Jim Hahn2-4/+4
Fixed: - use "var" - use assertEquals instead of assertTrue(xxx.equals()) - separate assertions Issue-ID: POLICY-3093 Change-Id: Id4db62626948681cd267e68a56dda65fa355c6f8 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-27Address more sonars in apex-pdpJim Hahn11-59/+59
Fixed services-engine thru utilities. Fixed: - use "var" - use Files.delete() - only one method call in assert() Issue-ID: POLICY-3093 Change-Id: I6f62108c770c15e8b84bc51746066fefa409e0fc Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-02Use lombok annotations in apex-pdpJim Hahn25-718/+131
Updated projects: services-engine through utilities Issue-ID: POLICY-3391 Change-Id: I35ebb40d86e9bda360f7819516290b3fea88335c Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-29Improve APEX logging for irrelevant eventsa.sreekumar1-0/+3
When multiple policies are expecting event on the same topic/endpoint, a lot of event parsing failure log messages are generated unnecessarily. With this change, only a 1 line message will be printed if an event cannot be parsed, and the detailed messages will be available at debug level. Change-Id: If1e7460ef5ed86fd470396f1e2ed8cc3c8af70c4 Issue-ID: POLICY-3499 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-07-12Update pdp statistics to count deploy/undeploy separately.adheli.tavares1-1/+32
Issue-ID: POLICY-3383 Change-Id: Ie9c5c7178c4c4302a0ba63ab42732f7157d302f8 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-06-24Update apex-pdp for checkstyle 8.43liamfallon4-7/+6
Issue-ID: POLICY-3206 Change-Id: I3873c85aab577e85a9ae6b610c3871ee4de6ea53 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-06-18Fix Sonar Issues in apex-pdp-services-enginelapentafd14-73/+75
Test refactoring and local-variable type inference replaced Issue-ID: POLICY-3093 Change-Id: I0c5506f27ea53da7740acce87a25060ba2bce7f4 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2021-05-03Remove GroupValidationResultJim Hahn13-508/+264
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Issue-ID: POLICY-2059 Change-Id: I2c0c01fac355e6cde4d8d6998dc42f8a2e2ebb65 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-04-22Refactor of command line classesadheli.tavares2-124/+63
ApexCommandLineArguments class to have parse() overriden to keep remainingArgs taking the tosca file without -p. Issue-ID: POLICY-3129 Change-Id: Ib067bf4c32992c4477cb6751f65269c103513d10 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-03-29Fix sonar issuesarkadiusz.adamski1-7/+6
- reduce methods Cognitive Complexity from 19 to the 15 allowed in CommandLineParser - iteration replaced with bulk 'Collection.addAll' call - remove redundant initializers - replace try with try-with-resources Issue-ID: POLICY-3093 Signed-off-by: arkadiusz.adamski <aadamski@est.tech> Change-Id: Ia727b3145ef8f63bcfc07723191c85e1ec8c923c
2021-03-19Fixing parallel event execution problem in APEX-PDP REST layera.sreekumar1-4/+4
Parallel event execution in APEX was resulting in incorrect dynamic REST url. This issue is fixed in this review. Change-Id: Id8a28c001a7fd7915df1f5909109bb369667ab40 Issue-ID: POLICY-3019 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-02-18Fix sonars in apex-pdpJim Hahn5-20/+24
Addressed the following issues: - initialize mocks before use - use parameterized queries - Random() is not secure - provide parameterized type for generics - unused imports - constructor visibility - use compute() instead of containsKey()/put() - make final fields static - rename constants to all upper case - no assert() in Thread.run() methods - nested try - nested if/else - too many break/continue - use try-with-resources - repeatable annotations - overlapping characters in reg ex - hashcode is not sufficient in compareTo() - need equals() with compareTo() - make class an interface - use parameterized test - multiple calls in assert() - log or re-throw - use different type of lambda - use parameterized logging - use StringBuilder instead of concatenation - use StandardCharsets.UTF_8 Issue-ID: POLICY-2906 Change-Id: I2cf8c885e3e22c2c6cbe6403a34906928afad022 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-11Changes related to multi policy handling improvement in APEXa.sreekumar1-9/+10
This review fixes an issue identified during testing the changes done for improving multiple policy handling in APEX. Changes done to a few test files in the previous review are reverted as well. Change-Id: I98324da708239d314aadd4c45dc377137fd552ba Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-01-28Improve handling of multiple policy in APEX PDPa.sreekumar4-288/+182
Change-Id: Ic4adf5bd8876dc31fc93993298e90389baaa2c39 Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-01-13Avoiding unwanted logging in APEX during event processinga.sreekumar3-26/+7
Change-Id: If0c93bfea08025c6c10e3f4572a14088990f415f Issue-ID: POLICY-2885 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-01-06Merge "Changed identifiers to concept identifiers"Liam Fallon2-20/+20
2021-01-04Changed identifiers to concept identifiersliamfallon2-20/+20
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: I5df89d023949cdf0f649951dbbd81a0b30f44ef6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-17Prune superfluous log and exception messagesgregory.hayes2-7/+3
Large volume exception messages should not be repeated in log messages or in rethrown exceptions. Jira-Link: https://jira.onap.org/browse/POLICY-2885 Issue-ID: POLICY-2885 Signed-off-by: gregory.hayes <gregory.hayes@est.tech> Change-Id: I345531d3a7640cc5ad9dbfc367052b9c8cc19387
2020-09-28Fixing APEX eventName handling to avoid duplicate requestsa.sreekumar1-26/+48
Change-Id: I6ee50fb455424ae1f241b7a12d1cdbf0e6ee4011 Issue-ID: POLICY-2815 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-09-17Cleanup related to removal of legacy format support in APEXa.sreekumar1-2/+1
This review basically just removes all "policyModelFileName" occurences which are not used anymore. Change-Id: Ibac8ec776dd989a5d677ff27a99eb7a36110773f Issue-ID: POLICY-2835 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-09-09APEX standalone support for ToscaPolicy formata.sreekumar4-320/+95
Legacy format support is removed, and Tosca format support is added. Change-Id: I3cfc181ccb5471a5d224c0162af18c1fa0fdbc70 Issue-ID: POLICY-2812 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-09-04Remove client code from apex-pdpliamfallon5-667/+39
Removal of the deployment and monitoring client from the apex-pdp as the functionality is replaced by the Policy Framework deployment using PAP and the Policy Framework monitoring GUI. Code in the engine proper that was used to administer apex-pdp over the Web Socket port is also removed, as this code was only used by the apex-pdp legacy GUIs. Issue-ID: POLICY-2621 Change-Id: Ib9fc4a667a4bc79377bb7b82fae6a2bd520a3e3d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-08-24Correct directory permission check in apexliamfallon1-19/+27
Apex checked if the current directory is writable when it starts, it is corrected to just check that the directory is readable and executable. Issue-ID: POLICY-2791 Change-Id: I794f836cabfde0f6f78392b3c9e1de364d76e5f6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-08-13SONAR fixes - log formattingwaynedunican1-6/+7
Fixed the sonar issues relating to Printf format being used for logging instead of String concatenation Issue-ID: POLICY-2773 Change-Id: I38db8d1df077fd7102f6c4f9b33685f2914bd624 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-08-10Merge "Handling apex-pdp multi policy deployment failure:"Pamela Dragosh1-7/+11
2020-08-07Handling apex-pdp multi policy deployment failure:puthuparambil.aditya1-7/+11
1.Include the list of duplicate parameters in the logs for easier troubleshooting 2.Also fix 4 Sonar blockers in ApexMainTest.java Issue-ID: POLICY-2712 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I145a7e03f76f880f8e3cbde97284748468b354a5
2020-08-07Sonar FixesJvD_Ericsson1-13/+14
Replace the type specification in this constructor call with the diamond operator and other small fixes Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Issue-ID: POLICY-2760 Change-Id: I83821859a4a1dbbffbaeae15281abac2de3b5712
2020-07-24APEX changes to support policy disable/enable and some improvementsa.sreekumar3-42/+74
1) Do not stop all the marshallers/unmarshallers while updating the engine. Stop and remove only those that are part of the policies that are undeployed. 2) Do not reinitilaize any marshaller/unmarshaller that is already initilaized as part of the policies which were already deployed. Initialize only the ones as part of any newly deployed policy. 3) EngineParameters could be different in different policies. Aggregate these parameters and make it available in the engine for any running policy. 4) Enable support for running policies with same model and different configurations. Change-Id: If74807a0515a741ef4e53bd0a93e43b05872f6b5 Issue-ID: POLICY-2536 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-07-06Fix URL checking on REST pluginsliamfallon1-17/+17
The URL parameter must always be provided on the REST client carrier plugin The URL parameter must always be provided on the REST requestor consumer The URL parameter is not required on the REST requestor producer This patch fixes the implementation to always checks the URL for existence on the REST Client plugin. The current checks on the REST Requestor are correct for the REST requestor plugin consumer and producer classes, so the checks are not required in the REST Requestor parameters. Issue-ID: POLICY-2692 Change-Id: I4e1534202002cf4a03bd159ac97b2a4f5b1746ab Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-07-01Fixing ConcurrentModificationException during multiple policy deployment in APEXa.sreekumar1-24/+34
Change-Id: Ib39e798d733727bdc676755b66adf2c499e618af Issue-ID: POLICY-2655 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-06-19Changes for checkstyle 8.32liamfallon32-61/+14
Issue-ID: POLICY-2188 Change-Id: I56bbf3aa3bd9e1ef433cc93ad2be0c54d141a2a5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-12Improve robustness of unit testinghuaxing1-2/+2
Issue-ID: POLICY-2630 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I6475f9272c1a770836af537c13b23e486b66ac3e
2020-04-05Fix intermittent unit test failures reseterquestorliamfallon1-32/+49
When consumers and producers are paired as in the case of the REST Rquestor, both sides must come up and be wired together in the initiation phase of apex-pdp before the consumers and producers start handling envents. In the ApexActivator class, the consumers were started immediately after they were initialized meaning that a consumer could return events to a producer that had not started yet. This change fixes the ApexActivator so that it waits until all consumers and producers are initialized before starting event handling. It also fixes the timings on RestRequestor tests and tidies up the unit tests. Issue-ID: POLICY-2469 Change-Id: Ib66d9531bf21f2a879ab33795aded4f48e7bfbc6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-02Fix hanging timeout on Executor testliamfallon1-15/+15
Issue-ID: POLICY-2106 Change-Id: I7bd44f8dfe349d73a4c8c4f978a30b455c45b2c7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-11Fix minor checkstyle/eclipse warningsliamfallon2-16/+10
Some minor checkstyle and eclipse warnings have crept into the code in the last few weeks. This review cleams them up. Issue-ID: POLICY-1913 Change-Id: Ib5f103bc28c71a6c4db05ea05719eff41bb38914 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-26Merge "Fix Java 11/Checkstyle/Sonar warnings"Jim Hahn7-116/+98
2020-02-26Fix Java 11/Checkstyle/Sonar warningsliamfallon7-116/+98
A number of Java 11, checkstyle, and SONAR warnings have crept into the Apex codebase over the last number of reviews. This change fixes those issues. Issue-ID: POLICY-1913 Change-Id: I2afd607e80f48323355380fb2fe5e048e18879f9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-25remove duplication code in plugins-event producerning.xi2-43/+81
Issue-ID: POLICY-1884 Change-Id: I7774dfdc7d7edcc0409a817bfd21ddacec21d085 Signed-off-by: ning.xi <ning.xi@est.tech>
2020-02-24Merge "remove code duplication in plugins"Ram Krishna Verma1-0/+76
2020-02-24Merge "remove code duplication in plugin-event-carrier"Ram Krishna Verma1-0/+277
2020-02-21remove code duplication in pluginsshaoqiu1-0/+76
Remove consumer code duplication in plugins-event-carrier Issue-ID: POLICY-1884 Signed-off-by: shaoqiu <tim.huang@est.tech> Change-Id: I2d222436a97224e54a03c2501f4dc14d3f5f6ac0