aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-engine
AgeCommit message (Collapse)AuthorFilesLines
2022-02-11Remove apex-pdp unused core modulesliamfallon72-9235/+0
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-10Collapse apex-pdp maven model submodulesliamfallon1-1/+1
This review collapses all the code in six podel submodules into a single model module. There are no code changes, just files moved around. This change reduces the complexity of the code structure and speeds up the build. Issue-ID: POLICY-1820 Change-Id: Ifb644e8ec85ae6d0987378f4616fbc8a8858a9a8 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-02-10Merge "rename metrics as per global constants for prometheus"Liam Fallon2-5/+6
2022-02-09rename metrics as per global constants for prometheusRashmi Pujar2-5/+6
Issue-ID: POLICY-3760 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I0fb59e8d9c95fd81a1754bb769705ef753b9022d
2022-02-08Remove JAXB and XML, use GSON for JSONliamfallon1-3/+3
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-01-24Add TOSCA policy status header field to APEX event create CLIRashmi Pujar1-2/+3
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
2022-01-10Prometheues metrics for APEX engine statsRashmi Pujar2-9/+82
Issue-ID: POLICY-3846 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I385446683372548f3fed6d609a9e85633ec2916d
2021-11-29Update snapshot of policy/apex-pdp to 2.7.1-SNAPSHOTliamfallon1-1/+1
*** This commit is generated by a PF release script *** policy/apex-pdp is update from 2.7.0-SNAPSHOT to 2.7.1-SNAPSHOT Issue-ID: POLICY-3827 Signed-off-by: liamfallon <liam.fallon@est.tech> Change-Id: I334dda447490f6c3e848be7b58f4a5119ae70ead
2021-10-14Bump policy/apex-pdp to Jakarta 2.7.0-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I8ead26be4968b94980dcafd269c7ab32022b34d0 Issue-ID: POLICY-3696 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-10-14Bump policy/apex-pdp to 2.6.2-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I0db6ab5efb0595cba86ce9cbaaafab88349818ff Issue-ID: POLICY-3696 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-09-15Bump apex-pdp to 2.6.1-SNAPSHOTa.sreekumar1-1/+1
Change-Id: Ie39d324e02a302b882318d46735a727322ce409d Issue-ID: POLICY-3587 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-08-31Fix sonar issues in apex-pdpRam Krishna Verma5-11/+15
Issue-ID: POLICY-3077 Change-Id: Id5e7c2ddada2bac3b73fe543f9adade6f9b83e6c Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-08-24Use CompareToBuilderJim Hahn5-46/+32
Also added lombok to test classes. Issue-ID: POLICY-3391 Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-06Use lombok for apex-pdp #7Jim Hahn16-295/+76
Updated thru core-protocols. Issue-ID: POLICY-3391 Change-Id: I2226fee16b276eba5c7f3fd1921a6cef36654f07 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-02Cleanup input & outputFields from Task definitiona.sreekumar3-23/+27
1) Remove the usage of inputField and outputField from Task definition. 2) Fix issues around populating events to task in case of State Finalizer Logic. Change-Id: Ief17f400729410b83c6b7c665980d443e0cf6f28 Issue-ID: POLICY-3336 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-06-28Changes to support multiple outputs from a statea.sreekumar14-227/+434
This review addresses two main changes: 1) inputFields and outputFields are not tied to task definition anymore. Instead inputEvent and outputEvents associated to a task is populated as part of the policy state definition, as the state definition have the information anyway. - Clean up of the usage of inputFields and outputFields in task definition will happen in a future review - inputFields and outputFields defined in task definition in policies until honolulu will not make the policy invalid as the changes are done in backward compatible way. 2) Multiple output events can come out of a final state now. - Define another policy state output with the relevant eventName in the command file - In the task logic, create a map to store the fields of the relevant outputEvent, and then just call "executor.addFieldsToOutput(<the_map_of_fields>)" These 2 steps are enough to send multiple events to relevant components as per the apex configuration. Change-Id: Id88ca402704106404f529e595e1a76f6bf167876 Issue-ID: POLICY-3336 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-05-31Fix Sonar Issues on Apex-pdplapentafd3-7/+31
Changes made into cli-codegen, cli-editor, and core-engine Renamed one test class to match other test classes Issue-ID: POLICY-3093 Change-Id: Ib2d947782021590ffc08d426e7a1607a8c33f98a Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2021-05-03Remove GroupValidationResultJim Hahn4-65/+28
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-03-12Bump apex-pdp to 2.6.0-SNAPSHOTliamfallon1-1/+1
Issue-ID: POLICY-3105 Change-Id: I53abd7e9cf8c1425d115b0bb917db6389e9ded92 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-03-10Bump apex-pdp to 2.5.2-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I291f968367b1f864bb417a72fd0bdb22a07ba0f7 Issue-ID: POLICY-3127 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-02-24Bump apex-pdp to 2.5.1-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I761ded255a97128f858d3a7ce95f2479b6208a4e Issue-ID: POLICY-3088 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-02-18Fix sonars in apex-pdpJim Hahn5-13/+13
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-10Remove URL and useerid from JMS pluginliamfallon1-2/+1
This review makes the default URL and userid for JMS null, the actual values must be specified as parameters. Issue-ID: POLICY-3035 Change-Id: I9c06d94d8816092425e2df58b849d837ad953fb2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-11-11Add method to allow JSON conversion to execution context for logicliamfallon4-63/+108
The Rhino JSON.Stringify() method does not work well. This patch allows the user to call schema specific or generic JSON conversion using the schema handling in Apex or not as the developer chooses. Added a single argument stringify2Json() method. Issue-ID: POLICY-2463 Change-Id: I9ec1e0dea2f6cd153b73b2eace63d8806674884d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-10-27Bump apex-pdp master to 2.5.0-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2875 Change-Id: Ibb0e9a243bf92f0255cb5c145d31ccddb988fdf5 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-10-20Bump apex-pdp to 2.4.4-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I5e2cd92ee3620dea4070d9fa3aeb5ffd65f9412c Issue-ID: POLICY-2869 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-10-08Bump apex-pdp to 2.4.3-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2839 Change-Id: Ia7c847b3dafd28958d5df209af95cac19fa480a0 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-09-10Bump APEX version to 2.4.2-SNAPSHOTa.sreekumar1-1/+1
Change-Id: Idde5050b425eb1bebe312e80e795c21513367a1b Issue-ID: POLICY-2789 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-09-03Clean up warnings and SONAR issuesliamfallon1-5/+4
Issue-ID: POLICY-2654 Change-Id: Ifd391ea9141d37cfd3ca4110d66c667962230ae1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-08-10SONAR assertion cleanupwaynedunican1-2/+2
Replaced assertions to not have the same actual and expected expression in apex-pdp Issue-ID: POLICY-2761 Change-Id: I2bf45a3cc4411bd39f93f9d0b8c8e56dd318281e Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-07-20Replace try/catch with assertj - apex-pdpwaynedunican12-722/+264
Replaced try/catch blocks apex-pdp with assertj assertions. Part III of changes. Issue-ID: POLICY-2451 Change-Id: I77ee4140cdfc2066f463459f92163677c3e34ef2 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-07-17Fix double initiation error on EngineServiceFacadeliamfallon1-6/+0
The engineServiceFacade allows it's init() method to be called twice, the second call should return that the facade is already initialized. Issue-ID: POLICY-2720 Change-Id: Id241e232163a8812a72f92841ce7b11f59358d45 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-07-13Merge "Remove old documentation from build"Jim Hahn4-145/+0
2020-07-13Merge "Fix assertTrue SONAR issues in apex-pdp/contex and apex-pdp/core"Pamela Dragosh1-9/+11
2020-07-13Remove old documentation from buildliamfallon4-145/+0
apex-pdp had an in-line docuemntation build system built on asciidoc. It has proven to be very difficult to maintain and keep up to date and it is incompatible with the ONAP official RST/ReadTheDocs docuementation system. In the Dublin release, we converted the asciidoc documentation to RST format, and hae been updating the RST documentation since. The asciidoc docuemntation system is now so out of date that it is being removed. In this change, the "site" directory is removed from all modules in apex-pdp and a profile called "apexSite" is removed from the pom.xml file in all modules. Issue-ID: POLICY-2686 Change-Id: I645f3ed101159d356cd90e619cef791067ad5eb5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-07-10Bump apex-pdp to 2.4.1-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-2695 Change-Id: I15b489de9ca2614e3a6c94b450a3d6397d17d4ff Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-07-10Fix assertTrue SONAR issues in apex-pdp/contex and apex-pdp/coreJvD_Ericsson1-9/+11
Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/client apex-pdp/context and apex-pdp/core Issue-ID: POLICY-2690 Change-Id: Ic1e69c75e5f8f887cac135b6728b007faf4b19a6 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
2020-06-19Changes for checkstyle 8.32liamfallon33-44/+3
Issue-ID: POLICY-2188 Change-Id: I56bbf3aa3bd9e1ef433cc93ad2be0c54d141a2a5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-05-21Bump apex master to 2.4.0RossC1-1/+1
Issue-ID: POLICY-2514 Change-Id: I764cfe41ed8cf8ffebd4ff076d0b76b79d61e142 Signed-off-by: RossC <ross.carter@est.tech>
2020-05-20Bump Apex to 2.3.3RossC1-1/+1
Issue-ID: POLICY-2514 Change-Id: I5b130b052150eb0e51759c751b83ab9d6f199759 Signed-off-by: RossC <ross.carter@est.tech>
2020-04-15Bump policy-apex-pdp to 2.3.2-SNAPSHOTa.sreekumar1-1/+1
Change-Id: Ic668ab20498bdc41edc78f52c7ce9d89a1385f19 Issue-ID: POLICY-2378 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-03-31Fix State Finalizer Prepare and Cleanupliamfallon5-65/+75
The prepare() and cleanup() method were not called on state finalizers for states. This review adds calls for them. Issue-ID: POLICY-2450 Change-Id: I27aec4dea51f3e22b5922c04c7b7b974fca24292 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-25Bump policy-apex-pdp to 2.3.1-SNAPSHOTa.sreekumar1-2/+2
Change-Id: I59b93fccb0f3a41f8db753d1e8e2978bbb51e9a0 Issue-ID: POLICY-2378 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-03-09Sonar Bug fixaditya.puthuparambil1-56/+55
Change-Id: Icb465fdcf5a580f599a111ed3c5d3510f5346f64 Issue-ID: POLICY-1913 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech>
2020-03-04Merge "replace test sleep() with awaitality package"Liam Fallon2-5/+8
2020-03-04replace test sleep() with awaitality packageHenry.Sun2-5/+8
Signed-off-by: Henry.Sun <henry.a.sun@est.tech> Change-Id: I305771ddef42bd3032ad52f4c5ecd55b01ed5a1a Issue-ID: POLICY-1914 Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
2020-03-01Switch apex to Graal javascript engineliamfallon3-15/+18
This is the main review to switch out the Nashorn Javascript interpreter and switch in the Graal javascript interpreter for apex Javascript tasks. The Graal Javascript dialect differs slightly from Nashorn in the way it accesses information passed over from the Java world so Javascript tasks need to be converted. Subsequent reviews will convert the JUnit tests marked @Ignore in previous reviews to this one and will convert the Javascript tasks into a format Graal can handle. Subsequent reviews will also convert the examples over to Graal format. Issue-ID: POLICY-2106 Change-Id: Ief582a36539e8a87724c17fb7e56864d5e471c07 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-26Fix Java 11/Checkstyle/Sonar warningsliamfallon2-26/+34
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-20Passing taskParameters from ApexConfig to policy logica.sreekumar9-194/+271
TaskParameters can be used to pass parameters from ApexConfig to the policy logic. In the config, these are optional. Usage as below: { "engineParameters": { "taskParameters": [ { "key": "ParameterKey1", "value": "ParameterValue1" }, { "taskId": "TaskIdVal", "key": "ParameterKey2", "value": "ParameterValue2" } ] } } In the taskLogic, taskParameters can be accessed as below: eg: executor.parameters.get("ParameterKey1")) If taskId is provided in ApexConfig for an entry, then that parameter is updated only for that particular task. Otherwise, the task parameter is added to all tasks. Change-Id: I9e1b3d3697428309e7d86db40b63ffe822935b69 Issue-ID: POLICY-2364 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-12-04Minor changes for new Eclipse checkstyle checksliamfallon3-5/+11
The laest Eclipse checkstyle version 8.26.0 does more thorough checking and identified a number of small issues in the apex-pdp codebase. This review fixes those issues. Issue-ID: POLICY-1913 Change-Id: I30ba25e3e425c6d54c77f925e8da3ab841a8357c Signed-off-by: liamfallon <liam.fallon@est.tech>