policy/drools-pdp.git
3 years agoFix sonars in server-pool 55/111855/1
Jim Hahn [Fri, 28 Aug 2020 21:19:25 +0000 (17:19 -0400)]
Fix sonars in server-pool

Addressed the following sonars in feature-server-pool:
- re-interrupt after catching an InterruptException
- reduce cognitive complexity
- cognitive complexity
- not enough arguments for logger message
- use UnaryOperator instead of Function
- update static fields via static methods
- too many break/continue in for-loop

Also fixed some Eclipse warnings:
- add parameter to generic types
- useless assignments
- newInstance() has been deprecated
- close streams

Issue-ID: POLICY-2616
Change-Id: Ibf6c20e6c2a7eb8c60e1b38f388d86a0f9b8804b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRemove commons-io dependency 39/111739/2
Pamela Dragosh [Wed, 26 Aug 2020 11:50:00 +0000 (07:50 -0400)]
Remove commons-io dependency

Policy parent has this declaration to the latest 2.7
version of commons-io which fixes a sonatype security
issue. There is no reason that drools-pdp should be
declaring this.

Issue-ID: POLICY-2798
Change-Id: Ie7dbe14458be4ead395dfcbebbc1c0cd3ccc4ea6
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoAddress more sonars in drools-pdp 20/111720/1
Jim Hahn [Tue, 25 Aug 2020 21:05:37 +0000 (17:05 -0400)]
Address more sonars in drools-pdp

Addressed the following sonars:
- either log or rethrow
- call "remove()" for thread-local-storage
- use assertEquals
- only one method call in exception test
- swap arguments in assertEquals
- add assertion to assertThatThrownBy()
- explain @Ignore

Also addressed eclipse warnings:
- unused fields and methods

Issue-ID: POLICY-2616
Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoblock status operations until controllers ready 65/111665/3
jhh [Tue, 25 Aug 2020 01:04:52 +0000 (20:04 -0500)]
block status operations until controllers ready

Status messages to the PAP won't be send until
all mandatory resources specified in the
lifecycle.pdp.policytypes property are functional.

Issue-ID: POLICY-2669
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ia9d4c678fcfbdb232059d0827235845ee11f1201
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
3 years agoexit jvm when detecting configuration problems 56/111656/2
jhh [Mon, 24 Aug 2020 18:09:58 +0000 (13:09 -0500)]
exit jvm when detecting configuration problems

It follows the same approach that in other policy
components by throwing a runtime-exception vs
System.exit(x).

Issue-ID: POLICY-2752
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Iba508fc7095b060373742849e394c8fdd2a2334f
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
3 years agoMerge "remove legacy operational policies support"
Jim Hahn [Mon, 24 Aug 2020 15:02:30 +0000 (15:02 +0000)]
Merge "remove legacy operational policies support"

3 years agomove to alpine from debian 49/111349/5
Taka Cho [Mon, 17 Aug 2020 22:23:00 +0000 (18:23 -0400)]
move to alpine from debian

moving to alpine-jdk base for
drool-pdp apps

csit drools/apps tested in windriver labs:
http://10.12.6.96:8080/tmp/tmp.yxBE30uD1m-robot-workdir/report.html

1, httpie has to install via apk
2, http-prompt has to install via pip

Issue-ID: POLICY-2787
Change-Id: I3d1bd86c7c2c3c48e9ac2a823b988bb9b1bdf98f
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoremove legacy operational policies support 96/111496/1
jhh [Thu, 20 Aug 2020 23:27:40 +0000 (18:27 -0500)]
remove legacy operational policies support

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

3 years agoUpdate INFO.yaml in policy-drools-pdp 58/110758/1
Taka Cho [Thu, 30 Jul 2020 18:11:43 +0000 (14:11 -0400)]
Update INFO.yaml in policy-drools-pdp

Verified with Jessica W that the "type" should still be "Addition",
even when updating the PTL.
Updated to Mature, per TSC.

Issue-ID: POLICY-2738
Change-Id: I3a90f3dff643f89cc5eba3a46ba4570dc756bfef
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoRemove more jackson dependencies from drools-pdp 32/110632/1
Jim Hahn [Mon, 27 Jul 2020 17:08:33 +0000 (13:08 -0400)]
Remove more jackson dependencies from drools-pdp

Issue-ID: POLICY-1528
Change-Id: I9b4054cbfd41ec1abe61d6fe459ebb29adaa7a45
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd Ajith to policy/drools-pdp info 63/110563/1
Jim Hahn [Fri, 24 Jul 2020 16:55:12 +0000 (12:55 -0400)]
Add Ajith to policy/drools-pdp info

Issue-ID: POLICY-2738
Change-Id: Ib40ad93e6c0562fa60c99c9c6eff5072e355c062
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Support multiple Policy/Controller types using 'controller.type' property"
Jorge Hernandez [Tue, 21 Jul 2020 23:29:12 +0000 (23:29 +0000)]
Merge "Support multiple Policy/Controller types using 'controller.type' property"

3 years agoSupport multiple Policy/Controller types using 'controller.type' property 26/110126/6
Straubs, Ralph (rs8887) [Mon, 13 Jul 2020 14:26:50 +0000 (10:26 -0400)]
Support multiple Policy/Controller types using 'controller.type' property

It provides a feature base to allow for custom Policy
and Drools Controllers.

Issue-ID: POLICY-2415
Change-Id: Ibe3f11e3ecd925537ffd03d2420bb3b8214029c9
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
3 years agoRemove jackson from drools-pdp 89/110389/1
Jim Hahn [Mon, 20 Jul 2020 20:38:12 +0000 (16:38 -0400)]
Remove jackson from drools-pdp

Issue-ID: POLICY-1528
Change-Id: I616c48d62c63f8f213ec012f8746509471c38f89
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoPoint to SNAPSHOT for drools-pdp 48/110348/1
Jim Hahn [Fri, 17 Jul 2020 16:23:31 +0000 (12:23 -0400)]
Point to SNAPSHOT for drools-pdp

Issue-ID: POLICY-2695
Change-Id: I65fb75dda4dd26a54c593ecb26d7e0950a59e27c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "add exec option to policy usage message"
Jorge Hernandez [Fri, 17 Jul 2020 13:21:30 +0000 (13:21 +0000)]
Merge "add exec option to policy usage message"

3 years agoadd exec option to policy usage message 98/110298/1
jhh [Thu, 16 Jul 2020 21:23:40 +0000 (16:23 -0500)]
add exec option to policy usage message

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

3 years agoMerge "exec pdp-d java process to run in the foreground"
Jorge Hernandez [Wed, 15 Jul 2020 19:05:34 +0000 (19:05 +0000)]
Merge "exec pdp-d java process to run in the foreground"

3 years agoexec pdp-d java process to run in the foreground 75/110175/1
jhh [Tue, 14 Jul 2020 21:55:25 +0000 (16:55 -0500)]
exec pdp-d java process to run in the foreground

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

3 years agoMerge "sonar fix for server pool"
Jim Hahn [Mon, 13 Jul 2020 13:08:44 +0000 (13:08 +0000)]
Merge "sonar fix for server pool"

3 years agoBump drools-pdp to 1.7.1-SNAPSHOT 94/110094/1
Taka Cho [Fri, 10 Jul 2020 19:09:52 +0000 (15:09 -0400)]
Bump drools-pdp to 1.7.1-SNAPSHOT

Issue-ID: POLICY-2709
Change-Id: Ifb6232eb428e2cd9c729fef54862779b2ee55bbc
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agorelease docker 1.7.0 74/110074/2
Taka Cho [Fri, 10 Jul 2020 14:36:58 +0000 (10:36 -0400)]
release docker 1.7.0

Issue-ID: POLICY-2695
Change-Id: I250bd36079484f9869f39ec000347c106384ebaf
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agorelease drool-pdp 1.7.0 39/110039/2
Taka Cho [Thu, 9 Jul 2020 21:46:02 +0000 (17:46 -0400)]
release drool-pdp 1.7.0

Issue-ID: POLICY-2709
Change-Id: Ide08c4847a7c41bcb76b6009be59be7ec3621191
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agopoint to release parent, common and model 30/110030/2
Taka Cho [Thu, 9 Jul 2020 20:06:49 +0000 (16:06 -0400)]
point to release parent, common and model

release 1.7.0

Issue-ID: POLICY-270
Change-Id: I4975883ef85ab99345d7f9f32bbc72c091c0573a
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agosonar fix for server pool 88/109988/4
Taka Cho [Wed, 8 Jul 2020 19:58:29 +0000 (15:58 -0400)]
sonar fix for server pool

- move to a method for nest try and catch
- fixed some typos in comments
- use constant for the same String
- boolean method should be checked
- removed unnecessary exceptions

Issue-ID: POLICY-2616
Change-Id: I647ee095171feedfd44ca6967676f61842c2c91b
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoMerge "Checkstyle fixes to drools-pdp"
Ram Krishna Verma [Mon, 6 Jul 2020 20:53:44 +0000 (20:53 +0000)]
Merge "Checkstyle fixes to drools-pdp"

3 years agoMerge "Use apache Triple"
Ram Krishna Verma [Mon, 6 Jul 2020 20:53:31 +0000 (20:53 +0000)]
Merge "Use apache Triple"

3 years agoMerge "sonar fix for TargetLock"
Jorge Hernandez [Mon, 6 Jul 2020 18:17:28 +0000 (18:17 +0000)]
Merge "sonar fix for TargetLock"

3 years agoCheckstyle fixes to drools-pdp 66/109866/2
Jim Hahn [Mon, 6 Jul 2020 17:29:47 +0000 (13:29 -0400)]
Checkstyle fixes to drools-pdp

Issue-ID: POLICY-2696
Change-Id: I7f80737c52e3f16e03803118d92411e4ac39c5fb
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse apache Triple 63/109863/4
HAHN III [Mon, 6 Jul 2020 16:10:06 +0000 (12:10 -0400)]
Use apache Triple

Replaced policy-utils/Triple with apache Triple.

Issue-ID: POLICY-2694
Change-Id: I160f90c03f18b7da8dec5d0a00f809bcfb29680b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agosonar fix for TargetLock 51/109751/3
Taka Cho [Wed, 1 Jul 2020 19:50:15 +0000 (15:50 -0400)]
sonar fix for TargetLock

- duplicating strings to constant
- to not log tainted, user-controlled data.

Issue-ID: POLICY-2616
Change-Id: Iaa9dd9f9ef839cec58ae60d8464b889a02b8ddb5
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agodrools-pdp sonar fix 81/109781/2
Taka Cho [Thu, 2 Jul 2020 15:56:18 +0000 (11:56 -0400)]
drools-pdp sonar fix

most of changes are assert statement

Issue-ID: POLICY-2616
Change-Id: I3bd3076115d28d8cfabcbe0859cc4b21085e1394
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "Updating drools pdp dependencies"
Jorge Hernandez [Thu, 2 Jul 2020 12:43:26 +0000 (12:43 +0000)]
Merge "Updating drools pdp dependencies"

4 years agoUpdating drools pdp dependencies 93/109693/2
RossC [Tue, 30 Jun 2020 14:57:07 +0000 (15:57 +0100)]
Updating drools pdp dependencies

Issue-ID: POLICY-2387
Change-Id: I5fe17c2514aed5c595d4e2a3d95fbb210a6f229b
Signed-off-by: RossC <ross.carter@est.tech>
4 years agosonar fix for feature server pool 07/109707/3
Taka Cho [Tue, 30 Jun 2020 20:54:50 +0000 (16:54 -0400)]
sonar fix for feature server pool

- reduce cognitive complexity
- return a boolean value
- Replace this lambda with a method reference
- use lombok annotation @EqualsAndHashcode
- removed unnecessary exception

Issue-ID: POLICY-2616
Change-Id: Ia0c300c2909bbdd232f2a3c758a5709b70f06d1c
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "feature-eelf: eelf-core from: 1.0.0 -> 2.0.0-oss"
Jim Hahn [Mon, 29 Jun 2020 21:50:11 +0000 (21:50 +0000)]
Merge "feature-eelf: eelf-core from: 1.0.0 -> 2.0.0-oss"

4 years agoMerge "Clean up of Pair classes - drools-pdp"
Jim Hahn [Mon, 29 Jun 2020 20:54:18 +0000 (20:54 +0000)]
Merge "Clean up of Pair classes - drools-pdp"

4 years agofeature-eelf: eelf-core from: 1.0.0 -> 2.0.0-oss 55/109655/2
jhh [Mon, 29 Jun 2020 15:05:10 +0000 (10:05 -0500)]
feature-eelf: eelf-core from: 1.0.0 -> 2.0.0-oss

Issue-ID: POLICY-2387
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I29d4f07d990797a470bce0898ca67741974f1c00
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "sonar fix - FeatureServerPool"
Jim Hahn [Mon, 29 Jun 2020 16:46:56 +0000 (16:46 +0000)]
Merge "sonar fix - FeatureServerPool"

4 years agoClean up of Pair classes - drools-pdp 62/109362/8
waynedunican [Fri, 19 Jun 2020 14:23:27 +0000 (15:23 +0100)]
Clean up of Pair classes - drools-pdp

Removed Pair class from drools-pdp and replaced with Apache Common Pair
class

Issue-ID: POLICY-2202
Change-Id: Ica2a5b734fb6eebfc0713027c1c4dc3b8d3882c8
Signed-off-by: waynedunican <wayne.dunican@est.tech>
4 years agoMerge "replace an emptyArray and computeIfAbsent instead"
Ram Krishna Verma [Fri, 26 Jun 2020 22:14:17 +0000 (22:14 +0000)]
Merge "replace an emptyArray and computeIfAbsent instead"

4 years agooverride central repo with right repository 13/109613/1
jhh [Fri, 26 Jun 2020 19:23:35 +0000 (14:23 -0500)]
override central repo with right repository

This is to prevent that other poms setting the repository
http://repo2.maven.org, which has been decommissioned.
The repo1.maven.org is the one to be used, only with https.

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

4 years agoreplace an emptyArray and computeIfAbsent instead 80/109580/7
Taka Cho [Thu, 25 Jun 2020 16:10:00 +0000 (12:10 -0400)]
replace an emptyArray and computeIfAbsent instead

- some methods should return an empty array.
- avoid the result of a java.util.Map.get()
  against null before proceeding with adding
  or changing the value in the map.
- Declaring a variable only to immediately
  return or throw it is a bad practice.

Issue-ID: POLICY-2616
Change-Id: I21a55c5ea716d8f64dc9155f84cabcfbcf5a22e0
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agosonar fix - FeatureServerPool 30/109530/4
Taka Cho [Wed, 24 Jun 2020 20:24:26 +0000 (16:24 -0400)]
sonar fix - FeatureServerPool

- sonar thinks one block of comments are code,
  so changed some syntax in comments
- not more than one break or continue statement

Issue-ID: POLICY-2616
Change-Id: Ia35b73584f5a8492320c4beaa069ba7f903ce268
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agofeature server Keyword sonar fix 71/109471/4
Taka Cho [Tue, 23 Jun 2020 20:19:35 +0000 (16:19 -0400)]
feature server Keyword sonar fix

- remove unnecessary cast
- A "NullPointerException" could be
  thrown; "last" is nullable here
- regexp method name
- remove curly braces and 'return'

Issue-ID: POLICY-2616
Change-Id: Icd6ab0cf1f77cdc8cf1bffb3ae2781702add9ab5
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "replace Thread sleep with Awaitility"
Jim Hahn [Fri, 26 Jun 2020 12:49:43 +0000 (12:49 +0000)]
Merge "replace Thread sleep with Awaitility"

4 years agoreplace Thread sleep with Awaitility 66/109466/3
Taka Cho [Tue, 23 Jun 2020 19:09:28 +0000 (15:09 -0400)]
replace Thread sleep with Awaitility

- use '{}' for logger msg
- sonar suggest using use libraries
  Awaitility for asynchroneous testing

Issue-ID: POLICY-2616
Change-Id: I09828cdb9467235403f299c6419e8560ca21aefd
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "Upgrade hibernate to clear dom4j sonatype"
Pamela Dragosh [Thu, 25 Jun 2020 16:13:48 +0000 (16:13 +0000)]
Merge "Upgrade hibernate to clear dom4j sonatype"

4 years agoUpgrade hibernate to clear dom4j sonatype 55/109555/1
Pamela Dragosh [Thu, 25 Jun 2020 14:18:07 +0000 (10:18 -0400)]
Upgrade hibernate to clear dom4j sonatype

dom4j 1.3.1 has sonatype issue, 1.3.3 fixed it.

hibernate is the dependency that pulls in dom4j, upgrading
to latest patch will pull in the fixed dom4j.

Issue-ID: POLICY-2675
Change-Id: Ibb80fa7c96df42322bd3dc6c7a1d1d81deb365ab
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agofix sonar issue - feature-server 14/109514/3
Taka Cho [Wed, 24 Jun 2020 14:20:59 +0000 (10:20 -0400)]
fix sonar issue - feature-server

- A field should not duplicate
  the name of its containing class
- Invoke method(s) only conditionally
- add equals and hashcode
- some leftover changes for %n

Issue-ID: POLICY-2616
Change-Id: Icc094c17245e6a163d1158d97890579d76b84aec
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "need Override equals and hashCode method"
Pamela Dragosh [Tue, 23 Jun 2020 20:31:13 +0000 (20:31 +0000)]
Merge "need Override equals and hashCode method"

4 years agoMerge "fix sonar - feature-server"
Pamela Dragosh [Tue, 23 Jun 2020 20:30:57 +0000 (20:30 +0000)]
Merge "fix sonar - feature-server"

4 years agofix sonar - feature-server 59/109459/1
Taka Cho [Tue, 23 Jun 2020 14:15:00 +0000 (10:15 -0400)]
fix sonar - feature-server

%n is portable across platforms \n is not.

Issue-ID: POLICY-2616
Change-Id: I6daa827b93384c8b25dcb58b87fff116d09a2176
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoneed Override equals and hashCode method 33/109433/1
Taka Cho [Mon, 22 Jun 2020 20:17:07 +0000 (16:17 -0400)]
need Override equals and hashCode method

Use eclipse to generate those two
Overrides in order to avoid sonar
issue

Issue-ID: POLICY-2616
Change-Id: If7e887b99fa44dac5ac5fa6f8c8cfe677238576d
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoreduce sonar issue - feature-server 17/109417/1
Taka Cho [Mon, 22 Jun 2020 14:42:34 +0000 (10:42 -0400)]
reduce sonar issue - feature-server

Remove useless curly braces around statement
Rename the method name
change to '<>'

Issue-ID: POLICY-2616
Change-Id: I679ce7e44b1a8c2c30f78820c12f91f18e5aa944
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoremoved unused methods parameter 14/109414/1
Taka Cho [Mon, 22 Jun 2020 13:52:30 +0000 (09:52 -0400)]
removed unused methods parameter

Unused parameters are misleading.
Whatever the values passed to such
parameters, the behavior will be the same.

Issue-ID: POLICY-2616
Change-Id: I9a595dca81ce061846fa53adf8086130ffd31a74
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoRemoving log4j from feature-state-management/pom.xml 90/109390/1
Utkarsh Jauhari [Sun, 21 Jun 2020 20:26:10 +0000 (20:26 +0000)]
Removing log4j from feature-state-management/pom.xml

Issue-ID: POLICY-2623
Signed-off-by: Utkarsh Jauhari <uj426b@att.com>
Change-Id: I5f9e7b67ce39177c4f7211ea0e30d78bc7a95cc3

4 years agoAddress checkstyle version issues in drools-pdp 72/109372/2
Jim Hahn [Fri, 19 Jun 2020 18:32:10 +0000 (14:32 -0400)]
Address checkstyle version issues in drools-pdp

Also added serializationId to several classes to address eclipse warnings.

Issue-ID: POLICY-2188
Change-Id: I3df5e8abaad8da9261c0d5cd19a93ed68dceb870
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "drools-pdp sonar issue fixes"
Ram Krishna Verma [Fri, 19 Jun 2020 16:50:22 +0000 (16:50 +0000)]
Merge "drools-pdp sonar issue fixes"

4 years agodrools-pdp sonar issue fixes 20/109320/2
Taka Cho [Thu, 18 Jun 2020 18:15:16 +0000 (14:15 -0400)]
drools-pdp sonar issue fixes

fix all assert statements to
comply with sonar issue

Issue-ID: POLICY-2616
Change-Id: Ia36e3eab7c74d8dfb1ab3fa1395b1f64b173e09a
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoequals and hashCode should be overridden in pairs 76/109276/2
Taka Cho [Wed, 17 Jun 2020 20:41:57 +0000 (16:41 -0400)]
equals and hashCode should be overridden in pairs

hashCode should be overridden in pairs.
followed by Effective Java:

You must override hashCode() in every class that
overrides equals(). Failure to do so will result
in a violation of the general contract for
Object.hashCode(), which will prevent your class from
functioning properly in conjunction with all
hash-based collections, including HashMap, HashSet, and Hashtable.

Issue-ID: POLICY-2616
Change-Id: I2b29722daab5c520547397aae68d8ebaa71b2c4b
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "reduce sonar issue - 2 rev"
Liam Fallon [Tue, 16 Jun 2020 07:01:36 +0000 (07:01 +0000)]
Merge "reduce sonar issue - 2 rev"

4 years agoreduce sonar issue - 2 rev 80/108980/3
Taka Cho [Tue, 9 Jun 2020 15:21:31 +0000 (11:21 -0400)]
reduce sonar issue - 2 rev

In some conditions for assertTrue, sonarcloud
recommends using assertEquals

Assert.assertTrue(a.equals(b));
Assert.assertTrue(a == b);
Assert.assertTrue(a == null);
Assert.assertTrue(a != null);
Assert.assertFalse(a.equals(b));

Compliant Solution

Assert.assertEquals(a, b);
Assert.assertSame(a, b);
Assert.assertNull(a);
Assert.assertNotNull(a);
Assert.assertNotEquals(a, b);

Issue-ID: POLICY-2616
Change-Id: Ib362573bd865d1b561916bf64640c8ddeaa02546
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "do strict validation before domain conversion"
Pamela Dragosh [Thu, 11 Jun 2020 18:27:56 +0000 (18:27 +0000)]
Merge "do strict validation before domain conversion"

4 years agodo strict validation before domain conversion 94/108994/3
jhh [Tue, 9 Jun 2020 22:11:36 +0000 (17:11 -0500)]
do strict validation before domain conversion

need to perform a validation pass as the validation
combined with putting a domain model object tree
together run into problems when dealing with
integers that are passed as strings.

Issue-ID: POLICY-2577
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I06a2b6e8dc7e0442c2503b6d978deddbf652d830
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoreduce sonar issue - drools-pdp 37/108937/3
Taka Cho [Mon, 8 Jun 2020 19:58:46 +0000 (15:58 -0400)]
reduce sonar issue - drools-pdp

remove unused import
rename the method name

Issue-ID: POLICY-2616
Change-Id: I15845159063ec5fa3cfb34a59b9c433ba3201ccc
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoreduce sonar issue 32/108932/4
Taka Cho [Mon, 8 Jun 2020 16:35:15 +0000 (12:35 -0400)]
reduce sonar issue

In some conditions for assertTrue, sonarcloud
recommends using assertEquals

Assert.assertTrue(a.equals(b));
Assert.assertTrue(a == b);
Assert.assertTrue(a == null);
Assert.assertTrue(a != null);
Assert.assertFalse(a.equals(b));

Compliant Solution

Assert.assertEquals(a, b);
Assert.assertSame(a, b);
Assert.assertNull(a);
Assert.assertNotNull(a);
Assert.assertNotEquals(a, b);

Issue-ID: POLICY-2616
Change-Id: I6a4b0ac76c0816a8d4bf1914dc96210d20cdff03
Signed-off-by: Taka Cho <takamune.cho@att.com>
4 years agoMerge "Change metrics and transactions layout in logback.xml"
Jorge Hernandez [Tue, 9 Jun 2020 15:28:03 +0000 (15:28 +0000)]
Merge "Change metrics and transactions layout in logback.xml"

4 years agoChange metrics and transactions layout in logback.xml 03/108003/21
Joseph Chou [Wed, 20 May 2020 17:32:30 +0000 (13:32 -0400)]
Change metrics and transactions layout in logback.xml

Update logging code to compliant with logging standard

Issue-ID: POLICY-2578
Change-Id: I98decce81eae95c006d6485bf3440ac9119b2bf5
Signed-off-by: Joseph Chou <jc2555@att.com>
4 years agoPoint to parent SNAPSHOT 34/108434/1
Pamela Dragosh [Thu, 28 May 2020 18:37:45 +0000 (14:37 -0400)]
Point to parent SNAPSHOT

Issue-ID: POLICY-2319
Change-Id: I9332186e1a163eda1386a41750ae4a5718debba1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUse snapshot versions 51/108351/1
Jim Hahn [Wed, 27 May 2020 20:46:28 +0000 (16:46 -0400)]
Use snapshot versions

Issue-ID: POLICY-1526
Change-Id: Id2d6a737c3481f7ecaac7343ffcdcd58bc2493fc
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoTests must specify serialization provider 91/108291/1
Jim Hahn [Tue, 26 May 2020 21:44:44 +0000 (17:44 -0400)]
Tests must specify serialization provider

When GSON is made the default serialization provider, several
junits break.  Modified them to specify the GsonJackson provider,
which is what the REST classes use in production.

Issue-ID: POLICY-1526
Change-Id: If1bcb955d7411cf747a14a0bf1dc069b02e2f2ea
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump Drools-Pdp to 1.7.0 71/108071/1
aditya.puthuparambil [Thu, 21 May 2020 15:13:39 +0000 (16:13 +0100)]
Bump Drools-Pdp to 1.7.0

Issue-ID: POLICY-2514
Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech>
Change-Id: Ib18f045a621ce15f8381607ba87639dd188887e5

4 years agoBump Drools-Pdp to 1.6.4 58/108058/1
aditya.puthuparambil [Thu, 21 May 2020 12:15:30 +0000 (13:15 +0100)]
Bump Drools-Pdp to 1.6.4

Issue-ID: POLICY-2514
Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech>
Change-Id: Icb874f6b91488c5003e9d22460ce57e37b11dc30

4 years agorelease docker container 05/108005/1 6.0.0-ONAP
jhh [Wed, 20 May 2020 18:39:34 +0000 (13:39 -0500)]
release docker container

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

4 years agoRelease Drools-Pdp 1.6.3 java 91/107991/2
aditya.puthuparambil [Wed, 20 May 2020 15:51:20 +0000 (16:51 +0100)]
Release Drools-Pdp 1.6.3 java

Issue-ID: POLICY-2514
Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech>
Change-Id: I8dbb9269ebdaa906e19a05efcc4a588164b06667

4 years agoMerge "Point to released artifacts"
Ram Krishna Verma [Tue, 19 May 2020 17:06:45 +0000 (17:06 +0000)]
Merge "Point to released artifacts"

4 years agoPoint to released artifacts 92/107892/2
Pamela Dragosh [Tue, 19 May 2020 16:29:58 +0000 (12:29 -0400)]
Point to released artifacts

Issue-ID: POLICY-2514
Change-Id: Idf97f7bd6308e954deaa40d33147025dfdac2268
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoReduce Sonar complaints in 'feature-server-pool' 80/107380/3
Straubs, Ralph (rs8887) [Fri, 8 May 2020 10:35:27 +0000 (05:35 -0500)]
Reduce Sonar complaints in 'feature-server-pool'

Issue-ID: POLICY-2546
Change-Id: Ibddde78d705349b3c8510678f25dfce817b1a091
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
4 years agoBump drools-pdp 1.6.3-SNAPSHOT 27/106627/1
Pamela Dragosh [Fri, 24 Apr 2020 21:12:14 +0000 (17:12 -0400)]
Bump drools-pdp 1.6.3-SNAPSHOT

Issue-ID: POLICY-2510
Change-Id: Ic6ce8069e65c9b7606ab3529ee6291bc772a4191
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoRelease drools-pdp 1.6.2 docker image 16/106616/1
Pamela Dragosh [Fri, 24 Apr 2020 19:24:27 +0000 (15:24 -0400)]
Release drools-pdp 1.6.2 docker image

Issue-ID: POLICY-2510
Change-Id: I31213a695e2fdaf9ae83a1b63e9bc435a7192809
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoRelease drools-pdp 1.6.2 java 10/106610/1
Pamela Dragosh [Fri, 24 Apr 2020 17:54:34 +0000 (13:54 -0400)]
Release drools-pdp 1.6.2 java

Issue-ID: POLICY-2510
Change-Id: I7c9a32c61cc88bca072f035526c16b5019d29e84
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoPoint drools-pdp and release models 06/106606/1
Jim Hahn [Fri, 24 Apr 2020 16:27:28 +0000 (12:27 -0400)]
Point drools-pdp and release models

Issue-ID: POLICY-2510
Change-Id: I86db56cc373269b97822f9e243a189b9272a394e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agorelax optional 'description' to also allow empty 63/106163/1
jhh [Thu, 16 Apr 2020 22:30:36 +0000 (17:30 -0500)]
relax optional 'description' to also allow empty

description is an optional field, CLAMP users, may not populate
it and send an empty string value

    description: ''

This change removes the requirement to be a non-empty string when
present.

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

4 years agoPoint to new models version in drools-pdp 15/106115/1
Jim Hahn [Thu, 16 Apr 2020 17:42:00 +0000 (13:42 -0400)]
Point to new models version in drools-pdp

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

4 years agobump to 1.6.2-SNAPSHOT 64/105964/1
jhh [Tue, 14 Apr 2020 22:03:05 +0000 (17:03 -0500)]
bump to 1.6.2-SNAPSHOT

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

4 years agorelease 1.6.1 docker image 56/105956/1
jhh [Tue, 14 Apr 2020 20:51:32 +0000 (15:51 -0500)]
release 1.6.1 docker image

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

4 years agorelease 1.6.1 artifacts 54/105954/1
jhh [Tue, 14 Apr 2020 20:06:38 +0000 (15:06 -0500)]
release 1.6.1 artifacts

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

4 years agoMerge "Point to released common/models"
Jorge Hernandez [Tue, 14 Apr 2020 19:32:58 +0000 (19:32 +0000)]
Merge "Point to released common/models"

4 years agoPoint to released common/models 40/105940/1
Pamela Dragosh [Tue, 14 Apr 2020 18:51:58 +0000 (14:51 -0400)]
Point to released common/models

Issue-ID: POLICY-2378
Change-Id: Iba4bac51ab85ba14ac3c28d74b1fa99a49bd8480
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agonative controller generates invalid properties 31/105931/2
jhh [Tue, 14 Apr 2020 17:36:49 +0000 (12:36 -0500)]
native controller generates invalid properties

Additional instrumetation and tests have been added
as well.

Issue-ID: POLICY-2489
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I65df586f3a44acf3d6f825ebfb8bd73107255a1f
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoPoint to fix common/models 69/105869/1
Pamela Dragosh [Mon, 13 Apr 2020 20:40:33 +0000 (16:40 -0400)]
Point to fix common/models

Fixed naming policy string and yaml coder string fix

Issue-ID: POLICY-2486
Change-Id: I77dc1593a0d4c744090aa7b89303ea5e76d36ead
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoPoint to released parent, common, models 20/105820/1
Pamela Dragosh [Sat, 11 Apr 2020 19:33:49 +0000 (15:33 -0400)]
Point to released parent, common, models

Issue-ID: POLICY-2378
Change-Id: Ic80fe0334919361f973c7ae7796c5d8868882fcb
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoDisable sonar main args for drools-pdp 79/105679/1
Jim Hahn [Thu, 9 Apr 2020 13:46:07 +0000 (09:46 -0400)]
Disable sonar main args for drools-pdp

Issue-ID: POLICY-2305
Change-Id: If056c7e9179e245fafd6badc70ff9eee78fb23b3
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAddress more sonar issues in drools-pdp 10/105510/1
Jim Hahn [Wed, 8 Apr 2020 14:46:40 +0000 (10:46 -0400)]
Address more sonar issues in drools-pdp

Addressed the following sonar issues:
- use of "synchronized"
- use Files.delete() instead of File.delete()

Issue-ID: POLICY-2305
Change-Id: Id55628fe12d9d764616e57321382a70cb5704ba1
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Address sonar issues in policy-management"
Jim Hahn [Wed, 8 Apr 2020 13:11:20 +0000 (13:11 +0000)]
Merge "Address sonar issues in policy-management"

4 years agoAddress sonar issues in policy-management 44/105344/4
Jim Hahn [Tue, 7 Apr 2020 13:18:12 +0000 (09:18 -0400)]
Address sonar issues in policy-management

Addressed the following sonar issues:
- modified code to specify the correct class name in the
  getLogger() call
- use equals() instead of "==" for string comparison
- remove deprecated code
- use ',' instead of "," in indexOf
- remove code that is commented out; typically bogus, so the comment
  was adjusted to satisfy sonar
- missing assert in junits
- use "{}" instead of concatenation when using logger
- either log or rethrow
- put arguments for assertEquals() in the correct order
- remove "return" statements from the end of void methods
- don't always return the same value; just disabled sonar as
  refactoring would have obfuscated the code
- cognitive complexity; used eclipse auto-refactoring to extract
  out chunks of code into separate methods
- don't pass array of classes to class.getDeclaredMethod(); use
  ellided arguments instead
- fix argument count in logger calls
- remove unnecessary casts
- don't use "volatile"
- make methods "synchronized" to match parent class definitions

Issue-ID: POLICY-2305
Change-Id: Ie96418f696da4ae6c2ca8d4a914371469e695419
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAddress sonar issues in drools-pdp 82/105182/3
Jim Hahn [Mon, 6 Apr 2020 19:33:23 +0000 (15:33 -0400)]
Address sonar issues in drools-pdp

Addressed the following sonar issues:
- add "final" to public static fields
- commented code; some were bogus - just updated the comments
  so sonar is happy
- use "{}" instead of string concatenation
- junit should assert something
- when using logger, invoke compute-intensive tasks conditionally
- use superclass name instead of subclass name to access static fields
- don't always return the same value
- remove "transient" from fields of classes that aren't Serializable
- don't nest try/catch blocks
- use appropriate class name in Logger.getLogger()
- use Predicate<T> instead of Function<T,Boolean>
- remove unused parameters from private methods
- either log or throw
- remove duplicate methods
- use remove() TLS instead of set(null)
- null check is implicit in instanceof check
- do something with return value
- don't use volatile
- don't return "null" list; used Optional instead
- add no-arg constructor to non-Serializable superclass
- add callSuper=true for EqualsAndHashCode
- don't declare "throws XXX" where XXX is a subclass of RuntimeException
- remove serialVersionUID field if the class isn't Serializable

Also addressed some eclipse warnings:
- unused fields
- suppress generic typic cast warnings

Issue-ID: POLICY-2305
Change-Id: I906d5bf71c1f86531423e23b3667a585cdba45e1
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoSync controller capabilities as controllers bounce 61/104861/4
jhh [Wed, 1 Apr 2020 02:05:14 +0000 (21:05 -0500)]
Sync controller capabilities as controllers bounce

As native policies introduce temporality in policy types
supported as they are removed and added, the associated
policy types that can be honored at a a given time, may
need to adjust.

A significan portion of this review is dedicated to multi-policy
junits and telemetry instrumentation.

Issue-ID: POLICY-2459
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I62bbc03411446849eaa55c9b1524220dc13c2cb0
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Point to latest snapshots"
Pamela Dragosh [Fri, 27 Mar 2020 18:48:08 +0000 (18:48 +0000)]
Merge "Point to latest snapshots"