summaryrefslogtreecommitdiffstats
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2021-02-18Fix sonars in apex-pdpJim Hahn1-2/+7
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-18Replace GsonXxxAdaptersJim Hahn11-13/+15
The GsonXxxAdapters were removed from the models Serialization classes and replaced with type adapters from common. Modified the code to refer to the new adapters. Without this fix, examples-onap-vcpe will not compile. Could that be the cause of the apex-pdp standalone issue, POLICY-3066? Allow TypeAdapter in lieu of JsonSerializer/Deserializer adapters in config files. Note: examples-ona-bbs refers to the following, which were removed several releases ago (during the actor re-write?): - appclcm.util.Serialization$RequestAdapter & Serialization$ResponseAdapter Issue-ID: POLICY-2905 Change-Id: Ia57e0346343614cbd4a1cffd9c8393f207284244 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-11Changes related to multi policy handling improvement in APEXa.sreekumar1-6/+1
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.sreekumar1-1/+6
Change-Id: Ic4adf5bd8876dc31fc93993298e90389baaa2c39 Issue-ID: POLICY-2883 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-11-16Merge "Update vCPE example for JSON Stringify"Jim Hahn6-9/+30
2020-11-16Update vCPE example for JSON Stringifyliamfallon6-9/+30
The JSON.stringify() call in the Rhino Javascript interpreter is not working correctly. A previous patch introduced a method into the Apex execution context to provide an alternative method for stringifying JSON. This patch updates the vCPE example in apex to use that new method. Issue-ID: POLICY-2463 Change-Id: I85cc33dc4633b1b6f4c4db3d5ad8579c66d7c18c Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-11-16Update gRPC example for JSON Stringifyliamfallon2-5/+48
The JSON.stringify() call in the Rhino Javascript interpreter is not working correctly. A previous patch introduced a method into the Apex execution context to provide an alternative method for stringifying JSON. This patch updates the gRPC example in apex to use that new method. Issue-ID: POLICY-2463 Change-Id: I7f789c000d53dec60020fda2a6fccd71ef18edc3 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-11-11Add method to allow JSON conversion to execution context for logicliamfallon1-0/+39
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 Verma11-11/+11
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.sreekumar11-11/+11
Change-Id: I5e2cd92ee3620dea4070d9fa3aeb5ffd65f9412c Issue-ID: POLICY-2869 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-10-16Merge "Remove apex asciidoc documents"Jim Hahn76-12212/+0
2020-10-16Remove apex asciidoc documentsliamfallon76-12212/+0
Apex documentation has now all been ported to use the ONAP recommended rst format. This review removes the old asciidoc documents. Issue-ID: POLICY-2824 Change-Id: I562bd344cb7d6ff36e7d54bdb8f95e3b656468f8 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-10-08Bump apex-pdp to 2.4.3-SNAPSHOTRam Krishna Verma11-11/+11
Issue-ID: POLICY-2839 Change-Id: Ia7c847b3dafd28958d5df209af95cac19fa480a0 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-09-17Cleanup related to removal of legacy format support in APEXa.sreekumar33-33/+0
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-10Bump APEX version to 2.4.2-SNAPSHOTa.sreekumar11-11/+11
Change-Id: Idde5050b425eb1bebe312e80e795c21513367a1b Issue-ID: POLICY-2789 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-09-09APEX standalone support for ToscaPolicy formata.sreekumar6-44/+67
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-07-14Merge "Fix assertTrue SONAR issues in apex-pdp/examples and apex-pdp/model"Ram Krishna Verma6-38/+44
2020-07-13Remove old documentation from buildliamfallon96-2398/+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-13Fix assertTrue SONAR issues in apex-pdp/examples and apex-pdp/modelJvD_Ericsson6-38/+44
Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/examples and apex-pdp/model Issue-ID: POLICY-2690 Change-Id: Ie863dd95ccead62268689a4a8388f9b6e8821649 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
2020-07-10Bump apex-pdp to 2.4.1-SNAPSHOTRam Krishna Verma11-11/+11
Issue-ID: POLICY-2695 Change-Id: I15b489de9ca2614e3a6c94b450a3d6397d17d4ff Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-07-06Fix URL checking on REST pluginsliamfallon1-1/+3
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-06-30Merge "Removed CDS simulator from apex-pdp"Jim Hahn3-104/+10
2020-06-29Removed CDS simulator from apex-pdpJim Hahn3-104/+10
As the simulator now resides in policy-models, the code for it is no longer needed in apex-pdp. Deleted it. Issue-ID: POLICY-2676 Change-Id: I8ae6c8d860a47e5e7ba0509c99e4e2676109de25 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-29Fix SonarQube vulnerabilitiesToineSiebelink1-0/+4
Added logging to handle file io boolean returns Added security related settings to xml factories and builders Issue-ID: POLICY-2654 Change-Id: Ibc0a01f978bfc446e1dc1f8ad952d1305a7b7178 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2020-06-22Updating all Apex dependenciesRossC1-1/+1
Issue-ID: POLICY-2387 Change-Id: I6d9222cfe8841a4a4532d95dbc6f8b3f3d15ac87 Signed-off-by: RossC <ross.carter@est.tech>
2020-06-19Changes for checkstyle 8.32liamfallon18-39/+14
Issue-ID: POLICY-2188 Change-Id: I56bbf3aa3bd9e1ef433cc93ad2be0c54d141a2a5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-15Merge "Improve robustness of unit testing"Ram Krishna Verma1-7/+0
2020-06-12Remove logback.xml files bundled as part of jara.sreekumar1-63/+0
Change-Id: I0c15bb6bddb00f5d1fa00ea48e570bc7c270c43d Issue-ID: POLICY-2627 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-06-12Improve robustness of unit testinghuaxing1-7/+0
Issue-ID: POLICY-2630 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I6475f9272c1a770836af537c13b23e486b66ac3e
2020-05-21Bump apex master to 2.4.0RossC11-11/+11
Issue-ID: POLICY-2514 Change-Id: I764cfe41ed8cf8ffebd4ff076d0b76b79d61e142 Signed-off-by: RossC <ross.carter@est.tech>
2020-05-20Bump Apex to 2.3.3RossC11-11/+11
Issue-ID: POLICY-2514 Change-Id: I5b130b052150eb0e51759c751b83ab9d6f199759 Signed-off-by: RossC <ross.carter@est.tech>
2020-05-08Unit tests for various classesRossC1-0/+124
Issue-ID: POLICY-1916 Change-Id: Ie7cafa16ce12ca542a4e76307caddb36b7753990 Signed-off-by: RossC <ross.carter@est.tech>
2020-05-01Minor fixes in examples-vcpeRam Krishna Verma2-271/+5
Issue-ID: POLICY-1916 Change-Id: Ie3d1c33648e7996ac063bbaac6ea11f3df03564b Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-05-01Minor fixes in examples-grpcRam Krishna Verma2-264/+5
Issue-ID: POLICY-1916 Change-Id: I4bd93d72f234e1ce572b11bcb0621078480e061b Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-04-17Merge "Fix sonar issues"Pamela Dragosh1-24/+17
2020-04-15Bump policy-apex-pdp to 2.3.2-SNAPSHOTa.sreekumar11-11/+11
Change-Id: Ic668ab20498bdc41edc78f52c7ce9d89a1385f19 Issue-ID: POLICY-2378 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-04-15Fix sonar issueshuaxing1-24/+17
Issue-ID: POLICY-1913 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: Id1a9a6b6f7a9c8c74dd69bd0d30af05162a92cd1
2020-04-14SONAR issue fixaditya.puthuparambil2-8/+13
Issue-ID: POLICY-1913 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: Ie6dccc50ad63c5fdca1e79d7985aec2455041b56
2020-04-01My First Policy State Finalizer Exampleaditya.puthuparambil17-163/+875
Issue-ID: POLICY-1122 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: I552b58f39325982f1e26e59b352dfbe70cf35e7c
2020-03-30Fix timeout issues in gRPC testsliamfallon3-12/+29
When running the gRPC tests in a slow or overloaded environment, the timeupts must be set longer. Issue-ID: POLICY-2106 Change-Id: Id152f1f82ef47f646c7b0488b4486425c6816e31 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-25Bump policy-apex-pdp to 2.3.1-SNAPSHOTa.sreekumar11-20/+20
Change-Id: I59b93fccb0f3a41f8db753d1e8e2978bbb51e9a0 Issue-ID: POLICY-2378 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-03-24Launch separate threads for Javascript task executionliamfallon2-16/+16
When a policy is loaded, a separate thread is spawned for each Javascript script executor. This allows us to precompile the Javascript scripts and also to have a larger stack available for script execution. Issue-ID: POLICY-2106 Change-Id: I97323aafb623ba537ac1889b3c9504b345b4f67e Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-23Adding example for APEX gRPC plugin for CDS interactiona.sreekumar30-4/+1998
Change-Id: I8361eb0cbe74c3548ca98f3005bc37f5a1f91747 Issue-ID: POLICY-2436 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-03-19Apex-pdp tutorial documentation changesaditya.puthuparambil5-30/+39
Issue-ID: POLICY-2424 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: I92491c904b65a0db93c9e6eaba676c653c276175
2020-03-11Fix minor checkstyle/eclipse warningsliamfallon2-3/+4
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-03-11Convert examples to Rhino Javascript formatliamfallon48-3751/+364
All examples are converted to Rhino Javascript from Nashorn Javascript. Issue-ID: POLICY-2106 Change-Id: Ia6fec5b57b1e6131799b4b069968e4766ce54c96 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-11Merge "Sonar Security vulnerabilities fix"Ram Krishna Verma1-23/+33
2020-03-11Adapt vCPE example for Rhino Javascriptliamfallon26-104/+146
Minor changes to Javascript source for execution under the Rhino script engine. Issue-ID: POLICY-2106 Change-Id: Ib7e30ce0067a11ea1bb3ca8d197c796dba9ea091 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-11Sonar Security vulnerabilities fixaditya.puthuparambil1-23/+33
Issue-ID: POLICY-1913 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: Ic86e04776c9300e37134210cd9db5b6d7e6a5a9e
2020-03-09Use Rhino javascript executor in apex-pdpliamfallon12-103/+93
Integation unit tests resultd in StackOverflowException errors in the Graal Javascript interpreter. Following extensive testing and trouobleshooting, it proved very difficult to fix these issues in Graal as the stck overflow errors were occurring in native class instantiation methods being invoked by Grall on the JVM. The alternative Rhino Javascript engine is developed by mozilla, and was incorporated into the Java 6 JVM and evolved into Nashorn in the Java 8 JVM. Oracle dropped Nashorn in Java 11. However, in parallel, Rhino development has continued. This review brings in the Rhino javascript engine into apex-pdp as the replacement for Nashorn and instead of Graal. Graal seems to be pretty unstable as yet so we may bring it in in future releases but for now Rhino is a more stable and reliable alternative. Issue-ID: POLICY-2106 Change-Id: I0edeff3b0bee404b38e3ebe22001a6e3375a44dc Signed-off-by: liamfallon <liam.fallon@est.tech>