policy/drools-pdp.git
4 years agoUpdate package before installing 69/101569/1
Bruno Sakoto [Tue, 11 Feb 2020 23:19:10 +0000 (18:19 -0500)]
Update package before installing

Issue-ID: POLICY-2362
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: I14326db9db4f9adb4d19fb1aa6ee5b682e892d51

4 years agoMove model base classes outside feature-lifecycle 35/101535/1
jhh [Tue, 11 Feb 2020 13:59:26 +0000 (07:59 -0600)]
Move model base classes outside feature-lifecycle

So, it can be used in drools-application without
a feature dependency.

Issue-ID: POLICY-2360
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I1cf75bdd8739c35ea9b590896b177a519363e3d5

4 years agoMinor changes in Operational schemas 85/101285/1
jhh [Thu, 6 Feb 2020 21:17:20 +0000 (15:17 -0600)]
Minor changes in Operational schemas

Moved as test resources, these schemas will go together with
its control loop application in the drools-applications
repo, to keep separation between control loop apps and core
drools.

Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I4d78474eedd2f2981907388936312c436e1cb70b

4 years agoMerge "Store DomainMaker in PolicyEngine."
Jorge Hernandez [Thu, 6 Feb 2020 21:05:24 +0000 (21:05 +0000)]
Merge "Store DomainMaker in PolicyEngine."

4 years agoMerge "Updating module names to resolve conflicts"
Pamela Dragosh [Thu, 6 Feb 2020 20:38:28 +0000 (20:38 +0000)]
Merge "Updating module names to resolve conflicts"

4 years agoStore DomainMaker in PolicyEngine. 79/101279/1
jhh [Thu, 6 Feb 2020 20:10:52 +0000 (14:10 -0600)]
Store DomainMaker in PolicyEngine.

Since this is going to be used in drools-applications, better
to have it globally, reusing underlying "schema resources"  rather
than maintaining one or more instances in drools-applications.

Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I0e339e77ea6281308be00381c7eda2cc9f4d6ac1

4 years agoUpdating module names to resolve conflicts 04/101204/2
Ram Krishna Verma [Wed, 5 Feb 2020 21:51:06 +0000 (16:51 -0500)]
Updating module names to resolve conflicts

Issue-ID: POLICY-2355
Change-Id: I64b6cd06186152a08df9b8bd11c21c154067fab1
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agolifecycle routing policy types to controllers. 05/101205/1
jhh [Wed, 5 Feb 2020 22:33:53 +0000 (16:33 -0600)]
lifecycle routing policy types to controllers.

Issue-ID: POLICY-2356
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I49585507542f41a75e4c7bde2c7be343e19038f3

4 years agotackle few comments from DomainMaker review 46/101146/1
jhh [Wed, 5 Feb 2020 01:24:26 +0000 (19:24 -0600)]
tackle few comments from DomainMaker review

Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I325d0c4892d46dad72303e3dcbc38238a029a725

4 years agoMerge "domain native and operational policies support"
Jorge Hernandez [Tue, 4 Feb 2020 16:08:43 +0000 (16:08 +0000)]
Merge "domain native and operational policies support"

4 years agodomain native and operational policies support 68/100968/4
jhh [Fri, 31 Jan 2020 00:57:13 +0000 (18:57 -0600)]
domain native and operational policies support

- moved DomainMaker to policy-utils/ project.
- support for native drools and controller drools policy types.

Issue-ID: POLICY-2345
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I46b9816eadceb7ef280e0e6789f07b4d4ca51519
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoDouble quote local variables in drools tooling script 84/100984/1
Rashmi Pujar [Fri, 31 Jan 2020 15:33:13 +0000 (10:33 -0500)]
Double quote local variables in drools tooling script

Addressing the last minor comment from Jorge on
https://gerrit.onap.org/r/#/c/policy/drools-pdp/+/100774/.
Tested OK with and without proxy settings.

Issue-ID: POLICY-2330
Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
Change-Id: Ied9e0324b0f64684ccdefd20d8bed958f468bb72

4 years agoParameterize mvn repo urls and proxy settings 74/100774/5
Rashmi Pujar [Fri, 24 Jan 2020 20:34:04 +0000 (15:34 -0500)]
Parameterize mvn repo urls and proxy settings

This allows the users to build the docker images for drools-pdp
and drools-application using their own CI pipelines if needed.

Issue-ID: POLICY-2330
Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
Change-Id: I9ea0161b45d504be4e65a21c95e48dee4a78de3a

4 years agoComment from 100393 review 35/100435/2
jhh [Fri, 17 Jan 2020 21:43:58 +0000 (15:43 -0600)]
Comment from 100393 review

Missed 2020 year update in license of docker-install.sh:
https://gerrit.onap.org/r/#/c/policy/drools-pdp/+/100393

Issue-ID: POLICY-1586
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I1b2e67a5444597a71f2402638dd5784e72b64137
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoRemove java 1.8 check 93/100393/1
jhh [Thu, 16 Jan 2020 20:43:34 +0000 (14:43 -0600)]
Remove java 1.8 check

Issue-ID: POLICY-1586
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I19be48676da8bfd56122ea410539147f5a5f1746

4 years agoMerge "Update sonar config"
Ram Krishna Verma [Thu, 16 Jan 2020 12:42:26 +0000 (12:42 +0000)]
Merge "Update sonar config"

4 years agoUpdate drools-pdp for java11 docker 55/100355/1
Jim Hahn [Wed, 15 Jan 2020 22:58:19 +0000 (17:58 -0500)]
Update drools-pdp for java11 docker

Issue-ID: POLICY-1586
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I8a69268bf240e267a0a693992112707a4d503b73

4 years agoUpdate sonar config 23/100323/1
Pamela Dragosh [Wed, 15 Jan 2020 15:07:10 +0000 (10:07 -0500)]
Update sonar config

Use parent configuration - exclude non-code sub-modules.

Issue-ID: POLICY-2321
Change-Id: If0219d492761f34341d41815684ff91b81064263
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agopolicy/drools-pdp jdk11 upgrades 64/100264/1
Hockla, Ali (ah999m) [Mon, 13 Jan 2020 20:11:46 +0000 (14:11 -0600)]
policy/drools-pdp jdk11 upgrades

Issue-ID: POLICY-1589
Change-Id: I0ed05c6e471a7da6658e02a4ba3115d3a117cedd
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
4 years agoPoint to policy/models release version 19/100219/1
Hockla, Ali (ah999m) [Fri, 10 Jan 2020 21:31:03 +0000 (15:31 -0600)]
Point to policy/models release version

Issue-ID: POLICY-1592
Change-Id: Ic38a7a8b29caefcdc162bd595e866cf91692101a
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
4 years agoPrepare drools-pdp for java 11 95/100195/3
Jim Hahn [Fri, 10 Jan 2020 15:32:17 +0000 (10:32 -0500)]
Prepare drools-pdp for java 11

The Observer class has been deprecated.  Changed the code to use
StateChangeNotifier, instead, in anticipation of a corresponding
change in policy/common.
Also fixed new issue with missing getSupportedPolicyTypes() method.

Issue-ID: POLICY-1406
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I2d3ee29f13bd12a2e16644a1746f066c91c05475

4 years agofeature-lifecycle sonar cleanup 51/100151/1
jhh [Thu, 9 Jan 2020 20:13:47 +0000 (14:13 -0600)]
feature-lifecycle sonar cleanup

Issue-ID: POLICY-2322
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ief23b331390b1721f67dd81b47519f629f427519

4 years agoMerge "Enabling logback file to be loaded using oom configmap"
Jim Hahn [Thu, 9 Jan 2020 13:43:45 +0000 (13:43 +0000)]
Merge "Enabling logback file to be loaded using oom configmap"

4 years agoEnabling logback file to be loaded using oom configmap 86/100086/2
a.sreekumar [Wed, 8 Jan 2020 13:00:13 +0000 (13:00 +0000)]
Enabling logback file to be loaded using oom configmap

Change-Id: I4828559ff62ffc3ee41f89448a6f7e9914a2a0ba
Issue-ID: POLICY-2308
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
4 years agoRemove supported policy types from status message 62/100062/3
jhh [Tue, 7 Jan 2020 18:09:47 +0000 (12:09 -0600)]
Remove supported policy types from status message

Issue-ID: POLICY-2233
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I2168b9616d35ee3b9aa491aaa5d363b8609adb84
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agobase changes to support offline pdpd 69/99369/2
jhh [Tue, 10 Dec 2019 00:11:13 +0000 (18:11 -0600)]
base changes to support offline pdpd

Issue-ID: POLICY-2191
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I6f8029c1c771905357971331988a9b8408a93f10
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoPoint release versions of policy/parent and policy/common 23/99223/4
Hockla, Ali (ah999m) [Thu, 5 Dec 2019 18:21:48 +0000 (12:21 -0600)]
Point release versions of policy/parent and policy/common

Issue-ID: POLICY-1583
Change-Id: I7d621b33fd78a5277592e0129c3a13c7108d235a
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
4 years agoAdd PdpGroup to drools sample base.conf 67/99167/1
Jim Hahn [Wed, 4 Dec 2019 18:36:53 +0000 (13:36 -0500)]
Add PdpGroup to drools sample base.conf

When PDPs register with PAP, they now have to specify their PDP
group.  Added the default group to the config file.

Issue-ID: POLICY-2232
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I8c838012b6c46ad59ca4dde502ec1d61c974ac41

4 years agoOcasional race condition in upgrade junits 60/98760/1
jhh [Fri, 22 Nov 2019 15:08:30 +0000 (09:08 -0600)]
Ocasional race condition in upgrade junits

Issue-ID: POLICY-2158
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I5b1295508a291338d0ea668f598ce038304a35bc

4 years agoBuild tar.gz without requiring docker image build 27/98627/1
jhh [Tue, 19 Nov 2019 19:29:41 +0000 (13:29 -0600)]
Build tar.gz without requiring docker image build

This allows the tar.gz to be released by LF jobs.

Issue-ID: POLICY-2250
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I141921a78a55961ce9ee9b16a71c2cc0b6bddc26

4 years agoSet drools-pdp Pdp Group from the property file 55/98455/2
Jim Hahn [Fri, 15 Nov 2019 15:58:03 +0000 (10:58 -0500)]
Set drools-pdp Pdp Group from the property file

Modified drools-pdp to get its Pdp Group from a property file instead
of getting it from the PDP-UPDATE or PDP-STATE-CHANGE requests.
Modified property files to use envd, per review comment.

Issue-ID: POLICY-2232
Change-Id: Ibf024a476b2216074819dda7a66dcbfba811e278
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoInvoke lock callback in session thread 30/98430/2
Jim Hahn [Thu, 14 Nov 2019 20:16:13 +0000 (15:16 -0500)]
Invoke lock callback in session thread

Injects the callback as a DroolsRunnable into the session, if
there is one.  Otherwise, it invokes it via the engine's
thread pool.

Issue-ID: POLICY-2246
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I214480ae675d89e7335dde4eb4abe2684f7ef8ab
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Add 'DroolsRunnable' class"
Jorge Hernandez [Thu, 14 Nov 2019 16:22:15 +0000 (16:22 +0000)]
Merge "Add 'DroolsRunnable' class"

4 years agoAdd 'DroolsRunnable' class 53/98253/5
Straubs, Ralph (rs8887) [Mon, 11 Nov 2019 17:28:47 +0000 (11:28 -0600)]
Add 'DroolsRunnable' class

This provides a simple way to run arbitrary Java code within the
Drools thread. This change also includes a general way to specify
Drools rules that are automatically added to every Drools session.

Change-Id: I5ddcca4c807dc552fbcbd4a19dce311a4d358279
Issue-ID: POLICY-1948
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
4 years agoDispose drools controllers in junit tests 33/98333/1
jhh [Tue, 12 Nov 2019 20:36:19 +0000 (14:36 -0600)]
Dispose drools controllers in junit tests

Issue-ID: POLICY-1407
Change-Id: I4db3489c242a6cdd39444de19c9c8da83559bee4
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoAdd drools factory clean up statements to junits 65/98265/3
jhh [Mon, 11 Nov 2019 22:18:27 +0000 (16:18 -0600)]
Add drools factory clean up statements to junits

An attempt to tackle some intermittent junit errors
experienced by team mates.

Issue-ID: POLICY-1407
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I68a90dc50fe2fa5bfc7214aa26e2e5f78f1e6c23
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Miscellaneous code clean up"
Jim Hahn [Mon, 11 Nov 2019 20:03:18 +0000 (20:03 +0000)]
Merge "Miscellaneous code clean up"

4 years agoMerge "Do not hardcode io.fabric8 plugin"
Pamela Dragosh [Mon, 11 Nov 2019 16:21:41 +0000 (16:21 +0000)]
Merge "Do not hardcode io.fabric8 plugin"

4 years agoMerge "Detemine number of nexus repos to support"
Jorge Hernandez [Mon, 11 Nov 2019 14:58:06 +0000 (14:58 +0000)]
Merge "Detemine number of nexus repos to support"

4 years agoMiscellaneous code clean up 86/98186/5
jhh [Fri, 8 Nov 2019 14:42:55 +0000 (08:42 -0600)]
Miscellaneous code clean up

Issue-ID: POLICY-2203
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I5731d4636bd2aaecbc486406298bcba1b19e8f4d
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoDo not hardcode io.fabric8 plugin 04/98204/1
Pamela Dragosh [Fri, 8 Nov 2019 19:51:59 +0000 (14:51 -0500)]
Do not hardcode io.fabric8 plugin

policy/parent now has this plugin defined

Issue-ID: POLICY-2222
Change-Id: I35942b21ff4863c844023400d55be1a6177acb76
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoDetemine number of nexus repos to support 68/98068/7
Peyton Puckett [Wed, 6 Nov 2019 17:47:31 +0000 (11:47 -0600)]
Detemine number of nexus repos to support

Modify RepositoryAudit.java to determine number of
additional reposities to support as defined in the
feature-state-management.properties file

Issue-ID: POLICY-2035
Change-Id: I31edae42025a8167e242535da6eb41c15228bac8
Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
4 years agoMerge "Fix new sonar issues in RestManager"
Pamela Dragosh [Fri, 8 Nov 2019 12:54:46 +0000 (12:54 +0000)]
Merge "Fix new sonar issues in RestManager"

4 years agoFix new sonar issues in RestManager 78/98078/1
Jim Hahn [Wed, 6 Nov 2019 21:38:19 +0000 (16:38 -0500)]
Fix new sonar issues in RestManager

Eliminated duplicate code issues.  Unfortunately, introduced new
sonar issues with lambda expressions.

Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ib5853fab6135d2177da449ef6261a352ee4f203e

4 years agoDrools Controller upgrades Tests 72/98072/4
jhh [Wed, 6 Nov 2019 19:38:31 +0000 (13:38 -0600)]
Drools Controller upgrades Tests

Issue-ID: POLICY-1407
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I6963fced5608b62a41b73fef5070c21cf45d6fbe
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Fix duplicate code in drools-pdp RestManager"
Liam Fallon [Wed, 6 Nov 2019 17:47:53 +0000 (17:47 +0000)]
Merge "Fix duplicate code in drools-pdp RestManager"

4 years agoAddress drools-pdp sonar issues 48/98048/2
Jim Hahn [Wed, 6 Nov 2019 11:57:50 +0000 (06:57 -0500)]
Address drools-pdp sonar issues

Addressed more sonar issues in drools-pdp:
- unwrap multiple instances of the same annotation (NamedQuery)
- use lambda instead of anonymous class
- duplicate code; addressed by using annotation instead of toString.
  This still leaves other duplicate code.

Issue-ID: POLICY-2203
Change-Id: I8c6ff6562820af638044f134eb8a6725a5f05e8e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix duplicate code in drools-pdp RestManager 52/98052/1
Jim Hahn [Wed, 6 Nov 2019 13:28:36 +0000 (08:28 -0500)]
Fix duplicate code in drools-pdp RestManager

Change-Id: I22821a5027d01f0965c54b60389d3988ac53ed5c
Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix syntax error in DistributedLock "DELETE" 79/97979/1
Jim Hahn [Tue, 5 Nov 2019 19:47:08 +0000 (14:47 -0500)]
Fix syntax error in DistributedLock "DELETE"

Changed the "DELETE" to "DELETE FROM" to fix this error:
  You have an error in your SQL syntax; check the manual that corresponds
  to your MariaDB server version for the right syntax to use

Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I10a398c13dc3da547d2b3ea47564ab0d5761a2ee

4 years agoUse jersey dependencies from policy-endpoints 15/97915/1
liamfallon [Mon, 4 Nov 2019 14:35:34 +0000 (14:35 +0000)]
Use jersey dependencies from policy-endpoints

There is no need to ahve Jersey dependencies in the PDP POMs as they are
inherited fromt he policy-endpoints POM.

Issue-ID: POLICY-2209
Change-Id: Iaa51995864eec0bf5b4134719c32e956295084a1
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoAdd common Jersey version 49/97849/4
liamfallon [Fri, 1 Nov 2019 12:01:13 +0000 (12:01 +0000)]
Add common Jersey version

Add a common version of Jersey for all Policy Framework components.

Issue-ID: POLICY-2209
Change-Id: Iab5a62475eb73b5e4db8a02cfa029002a7f5f8ea
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoMerge "Refactor duplicate code from lock managers"
Jorge Hernandez [Fri, 1 Nov 2019 13:21:07 +0000 (13:21 +0000)]
Merge "Refactor duplicate code from lock managers"

4 years agoRefactor duplicate code from lock managers 05/97805/4
Jim Hahn [Wed, 30 Oct 2019 20:28:55 +0000 (16:28 -0400)]
Refactor duplicate code from lock managers

Change-Id: I8910a1a4267d824f064b52c6ad08945590bd9617
Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoupgrade to 7.28.0.Final drools libraries 02/97802/3
jhh [Thu, 31 Oct 2019 16:36:17 +0000 (11:36 -0500)]
upgrade to 7.28.0.Final drools libraries

commons-lang does not seem to be packaged anymore
(commons-lang3 still does, which is the desired one).

There are some @SupressWarning that seem to have no effect
that were removed.

Some libraries that were explicitly added are transitively
used now in the latest version of drools, hence some rework
in the dependency and exclude sections.   We will need to
generate a clm report to verify.

Issue-ID: POLICY-1407
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I44e09183caca72f5f33bdec0b8fa88b0b4793055
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Provide a way to trigger Drools rules when an update occurs"
Liam Fallon [Thu, 31 Oct 2019 16:23:30 +0000 (16:23 +0000)]
Merge "Provide a way to trigger Drools rules when an update occurs"

4 years agoProvide a way to trigger Drools rules when an update occurs 34/97634/4
Straubs, Ralph (rs8887) [Mon, 28 Oct 2019 12:49:56 +0000 (07:49 -0500)]
Provide a way to trigger Drools rules when an update occurs

An instance of 'DroolsInitFeature.Init' is inserted into a Drools
session when it is initialized, updated, or restored from
persistent data. This provides an opportunity to catch more
initialization scenarios than you can with an empty 'when' clause.

Updates:

1) Change 'DroolsInitFeature' to use Policy Engine scheduled executor

2) Add new test to 'DroolsInitFeatureTest' to verify that the 'Init'
   object is inserted into and deleted from Drools memory

3) Remove trailing spaces

Issue-ID: POLICY-1948
Change-Id: I4748c2415c4563e98b4a53d573c9ebe1e96e8e34
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
4 years agoFix more sonar issues in drools-pdp 70/97770/1
Jim Hahn [Wed, 30 Oct 2019 18:47:54 +0000 (14:47 -0400)]
Fix more sonar issues in drools-pdp

Sonar issue fixed:
- log or rethrow exception
- empty code block; moved the comment inside the empty "synchronized" block

Change-Id: I55ca87a321b3a1e4079dae6d5a4d44b651cb3086
Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix new sonar issues in drools-pdp 05/97705/1
Jim Hahn [Tue, 29 Oct 2019 19:12:39 +0000 (15:12 -0400)]
Fix new sonar issues in drools-pdp

Did not address duplicate code issues.

Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I304a02dbe9b1425df38abae815df0cff8faa0692

4 years agoCleanup eclipse warnings in drools-pdp 95/97695/1
Jim Hahn [Tue, 29 Oct 2019 16:37:37 +0000 (12:37 -0400)]
Cleanup eclipse warnings in drools-pdp

Issue-ID: POLICY-2203
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I3e854b1ea1986cd4992dc2ff84d799e970e443a9

4 years agoMerge "Allow encrypted property values"
Jorge Hernandez [Fri, 25 Oct 2019 15:34:59 +0000 (15:34 +0000)]
Merge "Allow encrypted property values"

4 years agoSymmetric Key configuration 79/97579/1
jhh [Thu, 24 Oct 2019 21:19:09 +0000 (16:19 -0500)]
Symmetric Key configuration

Issue-ID: POLICY-1945
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I58de93f031bd6482f928be70fc7114ad0a04f0a5

4 years agoHandle DB error codes in distributed locking 50/97550/1
Jim Hahn [Thu, 24 Oct 2019 14:17:07 +0000 (10:17 -0400)]
Handle DB error codes in distributed locking

The commons library wraps the SQLExceptions within its own SQLException,
so changed the code to simply look for a cause that's SQLTransientException,
eliminating the need to check specific error codes.  Deleted the error
code property now that it is no longer needed.
Also updated the distributed locking properties to include examples.

Issue-ID: POLICY-2113
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If46e85a81cfc952e561174fea670df81efb8309a

4 years agoAllow encrypted property values 29/97229/6
jhh [Thu, 17 Oct 2019 02:30:26 +0000 (21:30 -0500)]
Allow encrypted property values

Issue-ID: POLICY-1945
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I0317a6de838d99b579638252859e42fc49cedfa8
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoReimplement Lock API using Lock objects 97/96197/27
Jim Hahn [Tue, 24 Sep 2019 14:51:21 +0000 (10:51 -0400)]
Reimplement Lock API using Lock objects

Modified PolicyResourceLockManager to just return a feature, deferring
the lock() call/method to the feature, itself.  The manager was also
modified so that, if it can't find an enabled provider, it will return
a default provider, whose lock() methods always fail.  Once a feature
has been identified, the manager will cache it for use thereafter.

Modified the feature API to return lock objects and simplified the
interface to remove the beforeXxx and afterXxx methods.
Moved the unlock and refresh methods from the feature API into the
lock class, renaming them to free and extend, respectively.
Added a separate, feature-simple-locking project, which implements
a simple version of the locking feature, over a single JVM.
Extensively revised the distributed locking feature to fit in with
the new API.

Added support for persistence so that the various LockImpl classes
can be serialized and still function correctly when they are
deserialized back into new feature instances
Added default implementations of free & extend to LockImpl.
Modified API to take the ownerKey string, instead of the owner object.
Removed Extractor as unneeded - may add via another review, if still useful.

Updates per review comments:
- Updated licenses in feature-simple-locking
- Added beforeCreateLock & afterCreateLock to feature API
- Moved SimpleLockingFeature into policy-management so that it's
  always available
- Moved the executor service, "exsvc", into PolicyEngine
- Moved Extrator into policy-utils
- Changed Extractor logging level for exceptions
- Fixed feature sequence numbers
- Fixed mixing of seconds and milliseconds
- Renamed exsvc
- Modified to use property method with default value
- Configured scheduled executor
- Added suffix to Extractor.register()
- Eliminated Feature Api and tied lock manager into engine
- Added non-null checks to LockImpl parameters
- Added non-null checks to createLock() parameters
- Checked that lockManager is initialized

Change-Id: Iddba38157ddc5f7277656979c0e679e5489eb7b1
Issue-ID: POLICY-2113
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Add 'PolicySession.insertDrools' method"
Jorge Hernandez [Tue, 15 Oct 2019 16:19:01 +0000 (16:19 +0000)]
Merge "Add 'PolicySession.insertDrools' method"

4 years agoAdd 'PolicySession.insertDrools' method 84/96884/2
Straubs, Ralph (rs8887) [Thu, 10 Oct 2019 12:48:14 +0000 (07:48 -0500)]
Add 'PolicySession.insertDrools' method

This change includes feature hooks, so a "smart insert" could forward
the object to a remote host, and do the insert there. The methods 'insert'
and 'insertAll' in 'PolicyContainer' now make use of this smart insert.

Change-Id: I69f0e874b6fda09d1f457e4353e4b30d63696210
Issue-ID: POLICY-2160
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
4 years agoReplace protobuf-java 2.6.0 dependency with 3.6.1 67/96867/2
Bruno Sakoto [Thu, 10 Oct 2019 14:02:21 +0000 (10:02 -0400)]
Replace protobuf-java 2.6.0 dependency with 3.6.1

This change fixes protobuf-java library conflict when running policy
because of presence of 2.6.0 and 3.6.1 librairies in pdp docker
container.

Issue-ID: POLICY-2088
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Ifcebf2207dc54543083d080151e0685d51792be5

4 years agoModify property files in active-standby-management 92/96592/3
Peyton Puckett [Thu, 3 Oct 2019 15:47:09 +0000 (10:47 -0500)]
Modify property files in active-standby-management

Remove ${env:} and update property syntax
Add new property failure.threshold
Add new property interval_sec
Update: change property syntax back to using ${env:}
Update: add 2019 to copyright information

Issue-ID: POLICY-2031
Change-Id: I6db10700189197a1306c3b8fa23dff26518be0f3
Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
4 years agoAdd encoding declaration to pom.xml 63/96563/2
Peyton Puckett [Mon, 30 Sep 2019 19:28:14 +0000 (14:28 -0500)]
Add encoding declaration to pom.xml

Small pom change to add encoding declaration
Remove two trailing spaces
Update: remove additional trailing spaces

Issue-ID: POLICY-2036
Change-Id: I326e2cae576c53ee14150a28d6826d675f470578
Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
4 years agoRemove windows carriage return 08/96508/1
Peyton Puckett [Wed, 2 Oct 2019 13:29:51 +0000 (08:29 -0500)]
Remove windows carriage return

Remove windows CR from code in feature-controller-logging/
Remove windows CR from code in feature-mdc-filters/

Issue-ID: POLICY-2032
Change-Id: I9779f6907fb5a50ab6129969081c2228ce91d3a7
Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
4 years agoAddress junit failure in active-standby 92/96092/1
Jim Hahn [Thu, 19 Sep 2019 21:58:19 +0000 (17:58 -0400)]
Address junit failure in active-standby

In testLocking1(), the sleep() call after the final demote() was
allowing the background FPManager thread to re-promote the PDP before
the next test in the test case.  Removed the sleep() call, thus
preventing it from being re-promoted before the test.  As that's
the last test in that particular test case, it shouldn't cause a
problem.
In the process of diagnosing and fixing the problem, made the
additional changes below.
Made each junit runnable independently so that background threads
could be terminated and started afresh with each test.
Decreased the maximum "real" wait time of the tests, as the
main thread only needs to wait an instant for the other threads
to fire.
Modified code to use common entity manager factories rather than
creating them for each test.
Deleted unnecessary sleeps at the end of tests.
Deleted unnecessary db clean-ups at the start of tests (already
done by the @Before method.

Change-Id: Ia9f1053be564d85f1b29e47379ab184ffdbac235
Issue-ID: POLICY-2080
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd YAML support to drools-pdp rest servlets 83/95683/4
Jim Hahn [Fri, 13 Sep 2019 21:31:46 +0000 (17:31 -0400)]
Add YAML support to drools-pdp rest servlets

Drools-pdp depends on some of the GsonJackson annotations that cannot
be easily worked around via standard gson.  Consequently, this continues
to use the JacksonHandler for json-encoding, thus it uses the
YamlJacksonHandler for yaml-encoding.
Added YAML to swagger "consumes" list.

Change-Id: Ic70c68bb274222db571b3515cbf1ab22d9ff2366
Issue-ID: POLICY-2081
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump versions for drools-pdp master 92/95392/1
Jim Hahn [Tue, 10 Sep 2019 15:22:40 +0000 (11:22 -0400)]
Bump versions for drools-pdp master

Change-Id: I9882ab12334dc4b548de527ab2d7dbfc22177113
Issue-ID: POLICY-2045
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoReleasing drools-pdp 1.5.2 93/95293/1 5.0.0-ONAP
Pamela Dragosh [Tue, 10 Sep 2019 00:49:52 +0000 (20:49 -0400)]
Releasing drools-pdp 1.5.2

Releaseing 1.5.2 of drools-pdp

Issue-ID: POLICY-2045
Change-Id: I874b50d95ec94f784ebe5348f90cc23460f2114d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUpgrade to released artifacts 84/95284/1
Pamela Dragosh [Mon, 9 Sep 2019 23:45:41 +0000 (19:45 -0400)]
Upgrade to released artifacts

Released artifacts are parent, common and models

Issue-ID: POLICY-2045
Change-Id: I8cc38806d25887c8af1a1c7580e50741e968e4f1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoSplit Engine start method into "start" and "open" 88/94988/2
jhh [Thu, 5 Sep 2019 02:26:56 +0000 (21:26 -0500)]
Split Engine start method into "start" and  "open"

"open" meaning to open external configuration interfaces
to external provisioning systems.

Issue-ID: POLICY-2055
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ic984f0ebccd088503b6b13620c3b80ed8e640899
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Remove AlertSeverity from logback in drools-pdp"
Jorge Hernandez [Fri, 30 Aug 2019 12:37:14 +0000 (12:37 +0000)]
Merge "Remove AlertSeverity from logback in drools-pdp"

4 years agoRemove AlertSeverity from logback in drools-pdp 69/94369/3
Jim Hahn [Tue, 27 Aug 2019 18:37:50 +0000 (14:37 -0400)]
Remove AlertSeverity from logback in drools-pdp

Merged severity and AlertSeverity in the MDC, and updated the
logback xml files accordingly.
The logback patterns for the metrics log had a place for
both Severity and AlertSeverity; the latter was replaced with an
empty place-holder so-as to maintain the same position for
the other fields.

Change-Id: Ic0977e1133cc4219394f2d71ca8ebae080620e0b
Issue-ID: POLICY-1989
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoremove staging profile from settings.xml 29/94629/1
jhh [Thu, 29 Aug 2019 18:37:52 +0000 (13:37 -0500)]
remove staging profile from settings.xml

Issue-ID: POLICY-1371
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I969b69386f307669d0d5f70e8618f0e56552d133

4 years agooptionally source .conf files 15/94315/1
jhh [Tue, 27 Aug 2019 00:42:15 +0000 (19:42 -0500)]
optionally source .conf files

.conf files are now optional as environment
variables can be used instead without needing
a .conf.

Issue-ID: POLICY-1371
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I2cec20fe40d3bfd020e40c9925760de022d4ef34

4 years agoMerge "update keystore"
Pamela Dragosh [Fri, 23 Aug 2019 12:52:08 +0000 (12:52 +0000)]
Merge "update keystore"

4 years agoupdate keystore 74/94174/2
jhh [Fri, 23 Aug 2019 03:38:12 +0000 (22:38 -0500)]
update keystore

Issue-ID: POLICY-1988
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ia823e0439a0749719118a18e296c70cce501b968
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoUse pseudo time for junits 53/94053/3
Jim Hahn [Wed, 14 Aug 2019 21:31:50 +0000 (17:31 -0400)]
Use pseudo time for junits

Modified feature-active-standby-management and feature-lifecycle
to be able to use TestTimeMulti, eliminating the need for sleep()
calls in the junit tests and speeding the tests up significantly.
Also modified feature-active-standby-management to use a memory DB
for its junit tests.

Change-Id: I6d7ae61bb73cbb19ff405b8d9fb660e92732edbb
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix more sonar issues in drools-pdp 85/93585/2
Jim Hahn [Wed, 14 Aug 2019 21:31:50 +0000 (17:31 -0400)]
Fix more sonar issues in drools-pdp

Addressed issues of cyclomatic complexity and deep nesting by
refactoring code into separate methods.  In some cases, had to
refactor the code into nested classes to avoid passing too many
parameters to the newly extracted methods.
Addressed issue "too many conditionals" by breaking conditionals
apart.
Addressed issue "Remove usage of generic wildcard type" by eliminating
"? extends" from return values.
Addressed issue "Remove this use of 'Thread.sleep()'" in junit tests
by introducing latches or using Awaitility.

Note: this won't build until ApiUtils has been merged.

Change-Id: I0d5596b4cb918a36bc22f426f426bd238195b458
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonar issues in drools-pdp 36/92736/9
Jim Hahn [Mon, 5 Aug 2019 19:27:16 +0000 (15:27 -0400)]
Fix sonar issues in drools-pdp

Address sonar issue, "Move constants to a class or enum", by
moving them from interfaces to classes:
  ActiveStandbyFeatureApi
  StateManagementFeatureApi
  PolicyResourceLockFeatureApi
  PolicySessionFeatureApi
  DroolsController
  DroolsControllerFeatureApi
  PolicyControllerFeatureApi
  PolicyEngineFeatureApi
  HealthCheck
  SystemPersistence
  EventProtocolCoder
  PolicyController
  PolicyEngine
  TestTransaction
  MdcTransaction
Address sonar issue, "Move constants to a class or enum", by
change the interface to a class:
  DroolsProperties
Address sonar issue, "Override the "equals" method in this class", by
adding equals & hashCode to:
  DroolsPdpEntity
  DroolsPdpImpl
Use lombok for a number of getters & setters.
Address sonar issue, "Define a constant instead of duplicating this
literal" in:
  DroolsPdpsElectionHandler
  JpaDroolsPdpsConnector
  MavenDroolsController
  GenericEventProtocolCoder
  GsonProtocolCoderToolset
  RestManager
Address sonar issue, "Remove the parentheses around the parameter" in:
  MavenDroolsController
Address sonar issue, "Replace this lambda with a method reference" in:
  LifecycleFsm
Address sonar issue, "Move this constructor to comply with Java Code
Conventions" in:
  LifecycleStateRunning
Address sonar issue, "Replace this 'switch' statement by 'if'
statements to increase readability", as specified in:
  PolicyEngineManager
Address sonar issue, "Rename field to prevent any misunderstanding/clash
with field" in:
  MdcTransactionImpl
Address sonar issue, "Either log or rethrow this exception", in:
  RestManager
Address sonar issue, "Rename this constant name to" uppercase, by
replacing enums with static lists in:
  RestManager
Addressed review comments:
  Fixed license dates.
  Renamed getSiteName/setSiteName methods to getSite/setSite in
  the interface to match the field names in the implementation
  classes.
  Renamed *Instance classes to *Constants.
  Next round of review comments.

Change-Id: I1c26af9f194833dd773f2b25dc5f60cde163201c
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoUpgrade to snapshot integration parent artifact 70/93070/1
Bruno Sakoto [Thu, 8 Aug 2019 12:33:42 +0000 (08:33 -0400)]
Upgrade to snapshot integration parent artifact

Issue-ID: POLICY-1603
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: I90268bbb34d0ab6b5597b47a18671e7c4f0b2dfe

4 years agoBump version of drools-pdp 49/92949/5
Jim Hahn [Wed, 7 Aug 2019 19:17:36 +0000 (15:17 -0400)]
Bump version of drools-pdp

Updated the remaining *.pom files.
Updated java test file that uses the version.
Changed versions in *.pom files to all be 1.0.0.

Change-Id: Ia75cdfa5704b1e16b3c78e0257e619cd41220f93
Issue-ID: POLICY-1965
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd release 1.5.1 file 36/92836/1
jhh [Tue, 6 Aug 2019 19:39:22 +0000 (14:39 -0500)]
Add release 1.5.1 file

Issue-ID: POLICY-1953
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I128189bf37b5742c4a80db52cd2b923a96d8fcd8

4 years agoUpdate to latest common/models released versions 90/92690/3
jhh [Mon, 5 Aug 2019 14:20:43 +0000 (09:20 -0500)]
Update to latest common/models released versions

policy/models: 2.1.2
policy/common: 1.5.1

Issue-ID: POLICY-1953
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Id9c8f91d85248e2431175ffe4f0808b7157ec402

4 years agoExpand AAF_NS in properties to onap.org.osaaf.aaf 11/92411/2
jhh [Wed, 31 Jul 2019 20:22:05 +0000 (15:22 -0500)]
Expand AAF_NS in properties to onap.org.osaaf.aaf

Change-Id: I2e8f887093f9ba3e1fd9c5038dd4ad41d2a5c4c7
Issue-ID: POLICY-1959
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoFix junit broken by new addTopic(List) method 22/92422/1
Jim Hahn [Wed, 31 Jul 2019 22:18:08 +0000 (18:18 -0400)]
Fix junit broken by new addTopic(List) method

Addition of new TopicEndpoint.addTopic() method resulted in errors
like the following in drools-pdp:
  [ERROR] ... reference to addTopicSources is ambiguous
  both method addTopicSources(Properties)
  and method addTopicSources(List<TopicParameters>)
  match
Fixed the junits to disambiguate the method invocation.

Change-Id: Ibd648412f22290099c1213e9a1b45ab34bcbb859
Issue-ID: POLICY-1953
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Sonar ignored test"
Jim Hahn [Fri, 26 Jul 2019 15:01:35 +0000 (15:01 +0000)]
Merge "Sonar ignored test"

4 years agoMerge "Add lombok.config to drools-pdp"
Jorge Hernandez [Fri, 26 Jul 2019 14:18:52 +0000 (14:18 +0000)]
Merge "Add lombok.config to drools-pdp"

4 years agoSonar ignored test 20/92120/1
Jim Hahn [Fri, 26 Jul 2019 13:59:41 +0000 (09:59 -0400)]
Sonar ignored test

Renaming test file in an attempt to get sonar to include it.

Change-Id: I72ecc4255e45dabeec0ce86f8be5ce7daa8cb999
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd lombok.config to drools-pdp 09/92109/1
Jim Hahn [Fri, 26 Jul 2019 13:06:14 +0000 (09:06 -0400)]
Add lombok.config to drools-pdp

This prevents sonar from checking lombok annotations for code coverage.

Change-Id: I3458f76623a353d5ff0e900ce74aa1c80aa9cc66
Issue-ID: POLICY-1938
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd coverage to MavenDroolsController 55/92055/2
Jim Hahn [Thu, 25 Jul 2019 13:49:44 +0000 (09:49 -0400)]
Add coverage to MavenDroolsController

Change-Id: I7234c0146ef77f685a9766bb03168e385090fd1b
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Add coverage to feature-active-standby-management"
Pamela Dragosh [Thu, 25 Jul 2019 13:06:20 +0000 (13:06 +0000)]
Merge "Add coverage to feature-active-standby-management"

4 years agoAdd junit coverage to feature-mdc-filters 72/91972/2
Jim Hahn [Wed, 24 Jul 2019 21:03:32 +0000 (17:03 -0400)]
Add junit coverage to feature-mdc-filters

Change-Id: Idb1946c60d550deece25d2cc74131242ccc4c376
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd coverage to feature-active-standby-management 66/91966/1
Jim Hahn [Wed, 24 Jul 2019 17:19:28 +0000 (13:19 -0400)]
Add coverage to feature-active-standby-management

Also removed some logger.isXxx() tests, which should reduce the
number of branches that need to be tested.
Removed unneeded objects and methods from feature-lifecyle.

Change-Id: Ic3eb9c0b63a2ad5585846525eb0ebda81fc55d5e
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd junit coverage to drools-pdp 54/91954/3
Jim Hahn [Wed, 24 Jul 2019 15:15:51 +0000 (11:15 -0400)]
Add junit coverage to drools-pdp

Change-Id: I253d3e85a08b893e7a9b168d92752205bcc459f6
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>