policy/pap.git
2 years agoFix junits broken by change in is-alive type 71/123471/1
Jim Hahn [Mon, 23 Aug 2021 19:02:51 +0000 (15:02 -0400)]
Fix junits broken by change in is-alive type

Issue-ID: POLICY-3531
Change-Id: I1e66779f4ac05862649828e79914e902a99400d3
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoEnable prometheus by default in policy-pap 56/123456/1
a.sreekumar [Mon, 23 Aug 2021 14:29:14 +0000 (15:29 +0100)]
Enable prometheus by default in policy-pap

Change-Id: Id75de7a8c02531acb9c461e917be971feca94ffd
Issue-ID: POLICY-3538
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2 years agoUpdate Policy Components not to create tables 34/123334/1
ktimoney [Tue, 17 Aug 2021 15:59:09 +0000 (16:59 +0100)]
Update Policy Components not to create tables

Issue-ID: POLICY-3488
Change-Id: I945a19eb6bd7b943adaedc1ea836ec6030c9b001
Signed-off-by: ktimoney <kevin.timoney@est.tech>
2 years agoMerge "Update postman collection for pap api's"
Ajith Sreekumar [Tue, 10 Aug 2021 16:13:42 +0000 (16:13 +0000)]
Merge "Update postman collection for pap api's"

2 years agoUpdate postman collection for pap api's 01/123201/1
Ram Krishna Verma [Mon, 9 Aug 2021 20:01:24 +0000 (16:01 -0400)]
Update postman collection for pap api's

Update postman collection in pap to sync with recent changes made in audit & statistics api's.

Issue-ID: POLICY-3528
Change-Id: I38fe28cb6f7303ecb78f74c3546dee1962af9531
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agouse url resource for docker-tag -- pap 00/123200/1
Taka Cho [Mon, 9 Aug 2021 18:55:15 +0000 (14:55 -0400)]
use url resource for docker-tag -- pap

use groovy url resource from docker repo
to identify the tag for docker

Issue-ID: POLICY-3378
Change-Id: I1abd43ae0cd6f0ddc1060ccb525d2ba43e39f392
Signed-off-by: Taka Cho <takamune.cho@att.com>
2 years agoUse lombok in pap 62/123162/1
Ram Krishna Verma [Thu, 5 Aug 2021 20:47:47 +0000 (16:47 -0400)]
Use lombok in pap

Issue-ID: POLICY-3399
Change-Id: I839f67ff02fdabcb4012a340f7a6a7528dc107e5
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoUpdate query params in audit api's 81/123081/1
Ram Krishna Verma [Tue, 3 Aug 2021 22:03:10 +0000 (18:03 -0400)]
Update query params in audit api's

Updating query params in audit api's
to keep them in sync with statistics api's.

Issue-ID: POLICY-3527
Change-Id: I096436930450c263835ff8852edd40655de4fb0d
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoAdd time ranges to PAP statistics API 21/123021/2
Jim Hahn [Fri, 30 Jul 2021 18:54:35 +0000 (14:54 -0400)]
Add time ranges to PAP statistics API

Issue-ID: POLICY-3511
Change-Id: Ifc91e4732b3574da37f55658b23faf8a9f8091f5
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Fix swagger tags in controllers"
Jim Hahn [Fri, 30 Jul 2021 17:43:30 +0000 (17:43 +0000)]
Merge "Fix swagger tags in controllers"

2 years agoAdd audit api's to postman collection 77/122977/1
Ram Krishna Verma [Thu, 29 Jul 2021 20:49:06 +0000 (16:49 -0400)]
Add audit api's to postman collection

Adding policy audit api's to the postman collection in pap.

Issue-ID: POLICY-3340
Change-Id: Ic549ad2e242dd611cac5434b5fc7b0ec052db3ac
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoFix swagger tags in controllers 76/122976/1
Ram Krishna Verma [Thu, 29 Jul 2021 20:42:07 +0000 (16:42 -0400)]
Fix swagger tags in controllers

Fixing the swagger tags in controllers to match with documents.

Issue-ID: POLICY-3340
Change-Id: Ib30029cc4efa287348f5869f036b30cbab3db079
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoMerge "Add datetime format to audit api's"
Ajith Sreekumar [Thu, 29 Jul 2021 13:38:31 +0000 (13:38 +0000)]
Merge "Add datetime format to audit api's"

2 years agoAdd datetime format to audit api's 88/122888/5
Ram Krishna Verma [Tue, 27 Jul 2021 20:22:27 +0000 (16:22 -0400)]
Add datetime format to audit api's

Adding datetime format to audit api's
so that clients can send the request in one common format.
Changed the format to epoch timestamp.
Fixed review comments.

Issue-ID: POLICY-3340
Change-Id: I613ac02154a3e521ae97f7ac2e6129f642164b3f
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoRemove statistics record limits from PAP 28/122928/1
Jim Hahn [Wed, 28 Jul 2021 14:03:50 +0000 (10:03 -0400)]
Remove statistics record limits from PAP

policy/models statistics provider has now been enhanced to limit the
record counts.  Stripped the code from PAP, as it's no longer needed
there.  Also simplified the PAP statistics provider down to one query
method, taking a filter.

Issue-ID: POLICY-3511
Change-Id: I8a8797be191dc1f299b1c4084b0108a3ab89ff61
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd apis for policy audit 07/122807/2
Ram Krishna Verma [Wed, 21 Jul 2021 22:24:57 +0000 (18:24 -0400)]
Add apis for policy audit

Adding api's to fetch policy audit records from db.
This is as per the design documented here -
https://wiki.onap.org/display/DW/PAP+REST+API+changes+for+Istanbul+release

Issue-ID: POLICY-3340
Change-Id: Iff80ab695d17ec38d4fe8ab98c0b95048cbae448
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoMerge "Use docker registry properties in pap"
Ajith Sreekumar [Wed, 21 Jul 2021 11:35:59 +0000 (11:35 +0000)]
Merge "Use docker registry properties in pap"

2 years agoUse docker registry properties in pap 53/122753/1
Jim Hahn [Tue, 20 Jul 2021 13:57:03 +0000 (09:57 -0400)]
Use docker registry properties in pap

Issue-ID: POLICY-3374
Change-Id: Ibc4fe79ec588d5b7342d8d667d51d8b5662fd031
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse new RestClientParameters class in PAP 12/122712/1
Jim Hahn [Mon, 19 Jul 2021 15:21:33 +0000 (11:21 -0400)]
Use new RestClientParameters class in PAP

Replaced generic BusTopicParams with more specific RestClientParameters.

Issue-ID: POLICY-3456
Change-Id: Ic1a3acca5b651730fc74332c2c5d5bc36bccb790
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoLimit statistics record count 65/122565/3
Jim Hahn [Tue, 13 Jul 2021 18:02:30 +0000 (14:02 -0400)]
Limit statistics record count

Modified PAP, for Honolulu only, to limit the number of statistics
records retrieved from the DB.
Also added the recordCount parameter to the REST APIs, because otherwise
it would only return one record.

Per review comments:
- removed default value annotation; relying on the Provider code to
  change "0" to a reasonable default

Issue-ID: POLICY-3485
Change-Id: Ib0820cfda95672f1bc6f879dfd2ac172e7b42f0d
(cherry picked from commit 190b75c59bcc6f250446b627a96e4a12de52278f)
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUpdate Pam's email INFO.yaml 05/122605/1
Dragosh, Pamela (pd1248) [Tue, 13 Jul 2021 14:34:15 +0000 (10:34 -0400)]
Update Pam's email INFO.yaml

Issue-ID: POLICY-3484
Change-Id: I3ba078199300574bd34dd3fd04022fa784fbd909
Signed-off-by: Dragosh, Pamela (pd1248) <pd1248@att.com>
2 years agoUpdate pdp statistics to count deploy/undeploy separately. 99/122499/1
adheli.tavares [Tue, 6 Jul 2021 15:49:41 +0000 (16:49 +0100)]
Update pdp statistics to count deploy/undeploy separately.

Issue-ID: POLICY-3383
Change-Id: Iec7875fb1fa6a4a360b8cfdff0b80f697a289de3
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoMerge "Use separate subscription for heartbeats"
Jim Hahn [Wed, 7 Jul 2021 12:26:04 +0000 (12:26 +0000)]
Merge "Use separate subscription for heartbeats"

2 years agoFix NPE in UpdateReq.reconfigure() 71/122471/1
Jim Hahn [Tue, 6 Jul 2021 20:03:22 +0000 (16:03 -0400)]
Fix NPE in UpdateReq.reconfigure()

While running CSIT to test heartbeat changes with multiple PAPs,
observed an NPE in UpdateReq.reconfigure().  Modified the code to
always use deployment lists instead of null lists.

Issue-ID: POLICY-3460
Change-Id: I884e091817e88309330139a01d060e286bd42008
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse separate subscription for heartbeats 62/122462/2
Jim Hahn [Tue, 6 Jul 2021 14:19:52 +0000 (10:19 -0400)]
Use separate subscription for heartbeats

Separated the heartbeat processing onto its own POLICY-HEARTBEAT topic,
still on the "real" (i.e., "effective") POLICY-PDP-PAP topic, like we
had originally been doing with the statistics.  With this change,
statistics processing continues to be part of the heartbeat
class/processing, thus a separate class is not required to listen for,
and handle, statistics.

This new subscription uses a shared consumer group so that only one PAP
will process any given heartbeat message, which should reduce the
likelihood of DB contention and duplicate keys.

This also means that the "saveStatisticsInDb" flag will still be used,
which is a more obvious mechanism for controlling the storing of
statistics than the presence/absence of a topic in the config file.

Issue-ID: POLICY-3460
Change-Id: Ia07132b1c7aef006af86fddbe677fb1243a4e2c3
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRevert "Add listener to collect PDP statistics" 87/122287/1
Jim Hahn [Mon, 5 Jul 2021 12:13:20 +0000 (12:13 +0000)]
Revert "Add listener to collect PDP statistics"

This reverts commit 7b4a8ec06c8266f368a31cdafe75cf8a59304c83.

Reason for revert:
Decided to have the whole heartbeat processing use its own subscription, thus no need for a new class/topic just to collect statistics.

Issue-ID: POLICY-3405
Change-Id: I71580f877dae86a058ee881bc10f7bd1f57ff338
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd listener to collect PDP statistics 81/122381/2
Jim Hahn [Wed, 30 Jun 2021 21:36:34 +0000 (17:36 -0400)]
Add listener to collect PDP statistics

This new class will be tied into the existing code via the next review.

Issue-ID: POLICY-3405
Change-Id: I4317ccba3eda6863ce96a6db4ef20816e59a7f2d
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd ability to turn on/off pdp statistics 50/122350/3
Ram Krishna Verma [Tue, 29 Jun 2021 21:01:21 +0000 (17:01 -0400)]
Add ability to turn on/off pdp statistics

Adding an ability in pap to turn on/off processing of pdp statistics.
By default it will be turned on and can be changed via configuration.

Issue-ID: POLICY-3450
Change-Id: I093fe3f1390769f9acf2cfe85dd0d4edf0539de8
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoFix sonars in pap 51/122351/1
Jim Hahn [Tue, 29 Jun 2021 21:12:06 +0000 (17:12 -0400)]
Fix sonars in pap

Fixed:
- indentation
- use isEmpty()
- use isZero()

Issue-ID: POLICY-3287
Change-Id: Idcfba3a6839a47c3136fca8500128990ed64dcb1
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Set "source" name in PAP PdpMessages"
Jim Hahn [Tue, 29 Jun 2021 16:19:21 +0000 (16:19 +0000)]
Merge "Set "source" name in PAP PdpMessages"

2 years agoMerge "PolicyAudit creation when deploy/undeploy triggered."
Jim Hahn [Tue, 29 Jun 2021 15:17:39 +0000 (15:17 +0000)]
Merge "PolicyAudit creation when deploy/undeploy triggered."

2 years agoSet "source" name in PAP PdpMessages 41/122341/1
Jim Hahn [Mon, 28 Jun 2021 18:28:01 +0000 (14:28 -0400)]
Set "source" name in PAP PdpMessages

Used the unique name generator to initialize the PAP_NAME constant which
is then stuffed into the various outgoing PdpMessages.

Issue-ID: POLICY-3409
Change-Id: I45d26403b4f3de4b040cad779f29c82f35bacf42
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Send pdp-update if PDP response doesn't match DB"
Jim Hahn [Mon, 28 Jun 2021 18:03:28 +0000 (18:03 +0000)]
Merge "Send pdp-update if PDP response doesn't match DB"

2 years agoUpdate pap for checkstyle 8.43 67/122267/1
liamfallon [Mon, 28 Jun 2021 10:12:16 +0000 (11:12 +0100)]
Update pap for checkstyle 8.43

Updates are indentation changes on annotations.

Issue-ID: POLICY-3209
Change-Id: I3878ea476550e7522605e53bffa5c9c123030cdf
Signed-off-by: liamfallon <liam.fallon@est.tech>
2 years agoSend pdp-update if PDP response doesn't match DB 18/122218/3
Jim Hahn [Wed, 23 Jun 2021 20:27:20 +0000 (16:27 -0400)]
Send pdp-update if PDP response doesn't match DB

Because multiple PAPs can be updating the DB, it's possible that a
pdp-update sent by a PAP does not reflect the latest deployment data
in the DB. To solve that problem, modified code to compare any response
received from a PDP with what's in the DB, potentially generating a new
pdp-update (and/or pdp-state-change).

Issue-ID: POLICY-3426
Change-Id: I241994330d7645c0fffe66abc33de67d71d77250
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoPolicyAudit creation when deploy/undeploy triggered. 00/122100/8
adheli.tavares [Tue, 22 Jun 2021 12:50:52 +0000 (13:50 +0100)]
PolicyAudit creation when deploy/undeploy triggered.

Creates audits for policy when:
- deploy
- undeploy
- undeploy when failure

Issue-ID: POLICY-2899
Change-Id: Ib1a7cc4f826b5dceefcd5c7ba5250647f2cc0121
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoFix broken junits 23/122223/1
Jim Hahn [Fri, 25 Jun 2021 17:09:00 +0000 (13:09 -0400)]
Fix broken junits

Some junits are broken since adding the expiration timer.  Changed the
length of the heartbeat in an attempt to fix it.

Issue-ID: POLICY-3407
Change-Id: I81046476e243a0bf20ae9db9259be4464418e73e
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRemove expired PDPs 47/122147/4
Jim Hahn [Wed, 23 Jun 2021 14:11:14 +0000 (10:11 -0400)]
Remove expired PDPs

Added code to remove PDPs for which no message has been received for a
while.
Added a max-age field to the request-map parameters, changing the
parameters class to use a Builder, in the process.
Deleted the PdpTracker class, as its functionality was replaced by the
expiration checker.
Changed port numbers in some tests, due to collisions in junit tests.

Issue-ID: POLICY-3407
Change-Id: Ifbfbc03b833a4f11ee5e910e256ee42e21a0afab
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUpdate timestamp of PDP record 13/122113/2
Jim Hahn [Fri, 18 Jun 2021 21:41:15 +0000 (17:41 -0400)]
Update timestamp of PDP record

Modified the code to update the record timestamp when a heartbeat is
received from a PDP.
Also used Map operations instead of List operations to construct policy
deploy/undeploy lists so they can be constructed in O(N) instead of
O(N^2).

Issue-ID: POLICY-2898
Change-Id: Ic7b2b9a249fa0563b625e98855c79f96c6ee81d4
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoFix new checkstyle issues in pap 51/122051/1
Jim Hahn [Fri, 18 Jun 2021 17:57:03 +0000 (13:57 -0400)]
Fix new checkstyle issues in pap

The new version of checkstyle identified new issues.  Fixed those.

Issue-ID: POLICY-3287
Change-Id: I18a34cbc6197266375981031106acc38385c69b5
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse new filtering methods in PAP 38/121938/1
Jim Hahn [Tue, 15 Jun 2021 20:18:55 +0000 (16:18 -0400)]
Use new filtering methods in PAP

Modified PAP to use the new filter parameters classes instead of the old
methods that take lots of parameters.

Issue-ID: POLICY-3094
Change-Id: I46ac6d95a8f1e56ced8ed39474eb5a1031142dd7
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoSonars in pap 61/121861/1
Jim Hahn [Thu, 10 Jun 2021 19:42:16 +0000 (15:42 -0400)]
Sonars in pap

Fixed sonars:
-use correct class name in logger

Issue-ID: POLICY-3287
Change-Id: I62fab4b48151d8f2ca32ad5d2951e7359210e2c0
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoremove quoting the groups var in policy-pap.sh 41/121641/2
jhh [Wed, 2 Jun 2021 17:27:51 +0000 (12:27 -0500)]
remove quoting the groups var in policy-pap.sh

Issue-ID: POLICY-3331
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Idccfa3761b9a7d9d8907f105a261c9c7c85e70c5
(cherry picked from commit 689ec7f2a61c0f5347d807f70244588590cd9b8a)

2 years agoUpdate junits for bean validator field name 82/121682/1
Jim Hahn [Tue, 1 Jun 2021 14:49:40 +0000 (10:49 -0400)]
Update junits for bean validator field name

Now that the bean validator uses the serialized field name in its error
messages, updated the junits to use the serialized names, too.

Issue-ID: POLICY-3333
Change-Id: I5d447851b72f460fa71e57936847664e2c789462
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoFix build failure and remove unused imports 62/121662/1
waynedunican [Wed, 2 Jun 2021 10:57:55 +0000 (11:57 +0100)]
Fix build failure and remove unused imports

Issue-ID: POLICY-3339
Change-Id: I0c9bd25e63b24ba3ac7e38a77e963fcdbaa4d26a
Signed-off-by: waynedunican <wayne.dunican@est.tech>
2 years agoMerge "support external configuration of pdp groups"
Jim Hahn [Tue, 1 Jun 2021 14:42:08 +0000 (14:42 +0000)]
Merge "support external configuration of pdp groups"

2 years agosupport external configuration of pdp groups 74/121574/6
jhh [Thu, 27 May 2021 19:41:11 +0000 (14:41 -0500)]
support external configuration of pdp groups

- modify policy-pap.sh to optionally provision
  a custom group if such a file is present.

Issue-ID: POLICY-3331
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ib53bc14ee6b9471ab48f5a792b4283db3ed53b93
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2 years agoUpdate PAP to check for deployed policies only 65/121265/6
waynedunican [Mon, 10 May 2021 11:12:56 +0000 (12:12 +0100)]
Update PAP to check for deployed policies only

Have PAP compare the returned list against the delta deployment list instead of comparing against the full list of policies as is the current behaviour. Any references to "get" or "set" policies methods have also been removed

Issue-ID: POLICY-3263
Change-Id: I0efe03e835db3c4b2136f7e742bba0e78dc2ac44
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Signed-off-by: WayneDunican <wayne.dunican@est.tech>
3 years agoRemove csit folder from policy/pap 45/121345/1
Ram Krishna Verma [Thu, 13 May 2021 19:28:28 +0000 (15:28 -0400)]
Remove csit folder from policy/pap

The csit test files for all repos have been consolidated in policy/docker to maintain them at single place and allow us to trigger verify jobs in gerrit reviews.

Issue-ID: POLICY-3257
Change-Id: I8f80d6a8b56fd5c931f2ba1801c855c125d9704c
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoFix sonars in policy-pap 48/121148/2
Jim Hahn [Thu, 6 May 2021 21:32:21 +0000 (17:32 -0400)]
Fix sonars in policy-pap

Fixed:
- use "var" instead of actual type
- remove unused parameter
- remove un-thrown exception from method declaration
- call isPresent() before Optional.get()
- check empty list before invoking doesNotContain()

Issue-ID: POLICY-3285
Change-Id: Ic90dccfd591c102ce29f14084f025b3ca69587dc
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Query deployed policies by regex"
Ram Krishna Verma [Thu, 6 May 2021 19:30:11 +0000 (19:30 +0000)]
Merge "Query deployed policies by regex"

3 years agoQuery deployed policies by regex 22/120922/9
arkadiusz.adamski [Tue, 13 Apr 2021 10:23:28 +0000 (11:23 +0100)]
Query deployed policies by regex

- Query deployed policies by regex on the name, for a given policy type

Issue-ID: POLICY-2535
Signed-off-by: arkadiusz.adamski <aadamski@est.tech>
Change-Id: Ia2be683d044b22e4104ae14e2ce301882091c8ea

3 years agoRemove deprecated robot methods in pap csit 15/121115/1
Ram Krishna Verma [Wed, 5 May 2021 16:55:29 +0000 (12:55 -0400)]
Remove deprecated robot methods in pap csit

Removing the deprecated methods from pap csit as they will be no longer supported by robot framework.

Issue-ID: POLICY-3257
Change-Id: I2aab85a6704ab12b732ef97e23db6acd60e0e7c0
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoMerge "Remove GroupValidationResult"
Jim Hahn [Mon, 3 May 2021 21:34:46 +0000 (21:34 +0000)]
Merge "Remove GroupValidationResult"

3 years agoRemove GroupValidationResult 81/120981/1
Jim Hahn [Tue, 27 Apr 2021 14:30:14 +0000 (10:30 -0400)]
Remove GroupValidationResult

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: I9597dc84e8a81ac5b8954bb2ce4ad0d7e2a3a4a7
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFixing issue where PdpHeartbeats are incorrectly processed by PAP 35/120935/1
a.sreekumar [Tue, 27 Apr 2021 15:51:45 +0000 (16:51 +0100)]
Fixing issue where PdpHeartbeats are incorrectly processed by PAP

The below 2 issues are fixed in this review:
1) When updating the policiesToBeUndeployed, the policies list in the
   message itself was getting removed, which resulted in incorrect
   processing. This was the reason for continuos UPDATE and STATE_CHANGE
   messages from PAP to PDP.
2) In case if the policy list in heartbeat doesn't include one or more
   policies that are supposed to be deployed(as per DB), the PAP should
   send UPDATE messages to PDP asking to deploy them too. But this was
   not working as the policiesToBeDeployed list was not getting
   initialized properly before getting processed.

Change-Id: I06dbfd1d40bae8a510fc5500fbd38fb87c203c0d
Issue-ID: POLICY-3248
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoMerge "Address plugin-not-found issues"
Ram Krishna Verma [Fri, 16 Apr 2021 13:58:22 +0000 (13:58 +0000)]
Merge "Address plugin-not-found issues"

3 years agoRefactor PapCommandLineArguments class 69/120569/2
adheli.tavares [Thu, 15 Apr 2021 09:03:11 +0000 (10:03 +0100)]
Refactor PapCommandLineArguments class

CMD Args class to extend functionality from Common CMD class.

Issue-ID: POLICY-3129
Change-Id: Ia00cf7b0277e779811eaac556eebe11da95ed380
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
3 years agoAddress plugin-not-found issues 82/120582/1
Jim Hahn [Thu, 15 Apr 2021 20:12:33 +0000 (16:12 -0400)]
Address plugin-not-found issues

Removed references to archetype-packaging and lifecycle-mapping, where
unnecessary due to pom inheritance.

Issue-ID: POLICY-3136
Change-Id: I7483ccd96876f9babb64c0899eb03d6cf0b195f2
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Use sh instead of ash in PAP"
Pamela Dragosh [Wed, 7 Apr 2021 15:33:16 +0000 (15:33 +0000)]
Merge "Use sh instead of ash in PAP"

3 years agoUse sh instead of ash in PAP 38/120238/2
Jim Hahn [Tue, 6 Apr 2021 19:39:14 +0000 (15:39 -0400)]
Use sh instead of ash in PAP

Issue-ID: POLICY-3160
Change-Id: I79c41aa584efd3f4c617fd7c6de9ccf3862eb34d
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "PAP S3P jmx file changes"
Pamela Dragosh [Thu, 1 Apr 2021 12:08:23 +0000 (12:08 +0000)]
Merge "PAP S3P jmx file changes"

3 years agoPAP S3P jmx file changes 04/120004/2
waynedunican [Tue, 30 Mar 2021 08:11:06 +0000 (09:11 +0100)]
PAP S3P jmx file changes

Issue-ID: POLICY-3110
Change-Id: I679dc16fedccda496e2030e8a0cc2e74b8787d9d
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoValidate parameters of REST calls 01/120001/4
Jim Hahn [Mon, 29 Mar 2021 20:31:23 +0000 (16:31 -0400)]
Validate parameters of REST calls

Added code to validate the parameters of the REST calls.  As it turned
out, validation only needed to be added to one call.

Issue-ID: POLICY-2542
Change-Id: Ia9aabf75e06d6d5f996be9e3ed804218319f70c2
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoDelete keystores from pap 51/119551/1
Jim Hahn [Fri, 19 Mar 2021 15:51:59 +0000 (11:51 -0400)]
Delete keystores from pap

The Keystore is no longer needed in the tarball, as it is supplied
externally by the CSITs and Helm charts.  Deleted that file.
Also modified the junits to use utils-test to generates keystores at
runtime, thus deleted the junit keystore file, too.

Issue-ID: POLICY-3143
Change-Id: I2b0c4868613e0923aad87844dd16f3ac236d4291
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump policy references to latest snapshot versions 14/119514/1
liamfallon [Thu, 18 Mar 2021 15:38:01 +0000 (15:38 +0000)]
Bump policy references to latest snapshot versions

Issue-ID: POLICY-3105
Change-Id: I81d6d343a22b2e27d1b7109d5a918e792ce674fb
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoUpdate policy-keystore with newer certificates 88/119388/1
jhh [Tue, 16 Mar 2021 15:35:12 +0000 (10:35 -0500)]
Update policy-keystore with newer certificates

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

3 years agoBump PAP to 2.5.0-SNAPSHOT 26/119226/1
liamfallon [Fri, 12 Mar 2021 09:28:34 +0000 (09:28 +0000)]
Bump PAP to 2.5.0-SNAPSHOT

Issue-ID: POLICY-3105
Change-Id: I558a09dcc5a28df1a978f760b5fe0eeee72aeb30
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Bump pap to 2.4.2-SNAPSHOT"
Pamela Dragosh [Wed, 10 Mar 2021 18:00:14 +0000 (18:00 +0000)]
Merge "Bump pap to 2.4.2-SNAPSHOT"

3 years agoBump pap to 2.4.2-SNAPSHOT 96/119096/1
waynedunican [Wed, 10 Mar 2021 17:11:28 +0000 (17:11 +0000)]
Bump pap to 2.4.2-SNAPSHOT

Issue-ID: POLICY-3127
Change-Id: I0949f9e03a538e3f9ba463697885b799fd0b2acb
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoRelease pap 2.4.1 docker 89/119089/3
waynedunican [Wed, 10 Mar 2021 16:24:54 +0000 (16:24 +0000)]
Release pap 2.4.1 docker

Issue-ID: POLICY-3127
Change-Id: I87b64768b13e376e38a670e3fb687b137050275b
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoRelease pap 2.4.1 maven artifacts 80/119080/1
waynedunican [Wed, 10 Mar 2021 15:10:55 +0000 (15:10 +0000)]
Release pap 2.4.1 maven artifacts

Issue-ID: POLICY-3127
Change-Id: I9ef1b95a8f2591f6cbdd8106142d015ccd507567
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoPoint to policy-models 2.4.1 58/119058/3
waynedunican [Wed, 10 Mar 2021 11:52:41 +0000 (11:52 +0000)]
Point to policy-models 2.4.1

Issue-ID: POLICY-3127
Change-Id: I97af3ae7c118cb5ec316a4b8bbb4c0bfff328f06
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoUse models 2.4.1-SNAPSHOT in PAP 74/118874/1
Jim Hahn [Fri, 5 Mar 2021 21:01:42 +0000 (16:01 -0500)]
Use models 2.4.1-SNAPSHOT in PAP

Done to resolve EntityNotFoundException in windriver lab and in junit
tests.

Issue-ID: POLICY-3125
Change-Id: I5dbdf732154ee725ae9555722cde5d1f2008223c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUpdate info.yaml in pap 97/118397/1
Ram Krishna Verma [Wed, 24 Feb 2021 15:37:03 +0000 (10:37 -0500)]
Update info.yaml in pap

Issue-ID: POLICY-3028
Change-Id: Ic84724605ac2fc56c1391b0e0a2ad6f10e551545
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoBump pap to 2.4.1-SNAPSHOT 16/118316/1
Ram Krishna Verma [Tue, 23 Feb 2021 20:11:48 +0000 (15:11 -0500)]
Bump pap to 2.4.1-SNAPSHOT

Issue-ID: POLICY-3088
Change-Id: I74f23c31db609ca61592ec62b0594445bb8bf68c
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoRelease pap 2.4.0 docker image 10/118310/1
Ram Krishna Verma [Tue, 23 Feb 2021 18:19:37 +0000 (13:19 -0500)]
Release pap 2.4.0 docker image

Issue-ID: POLICY-3088
Change-Id: I1d7264a4808a787955f17537b4710f1585d92727
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoRelease pap 2.4.0 version 98/118298/2
Ram Krishna Verma [Tue, 23 Feb 2021 17:15:13 +0000 (12:15 -0500)]
Release pap 2.4.0 version

Issue-ID: POLICY-3088
Change-Id: I7bbbb1008e74e8245c1ae0b31a204b2548913e8b
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoPoint to released version of jre 79/118279/1
Ram Krishna Verma [Tue, 23 Feb 2021 16:14:07 +0000 (11:14 -0500)]
Point to released version of jre

Issue-ID: POLICY-3088
Change-Id: I467866accd2d573478282560ebe81a7923f62dc9
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoPoint to released version of dependencies 59/118259/1
Ram Krishna Verma [Tue, 23 Feb 2021 15:22:40 +0000 (10:22 -0500)]
Point to released version of dependencies

Issue-ID: POLICY-3088
Change-Id: Ie1cfd8b08a48881738966b1ce86f5f9c88a6e537
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoSupport Policy updates between PAP and PDPs 92/117692/14
waynedunican [Wed, 10 Feb 2021 12:00:04 +0000 (12:00 +0000)]
Support Policy updates between PAP and PDPs

Change to send only the policies that need to be updated (deployed/undeployed)
rather than full of policies to DMaap via the PDP_UPDATE message

Issue-ID: POLICY-2112
Change-Id: I65f8bf46f230afb9d4b6937cb89af1d9f05d2fbd
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoMerge "Refactor Pap code to use Instant from Date"
Jim Hahn [Mon, 22 Feb 2021 12:44:39 +0000 (12:44 +0000)]
Merge "Refactor Pap code to use Instant from Date"

3 years agoRefactor Pap code to use Instant from Date 23/118023/2
rameshiyer27 [Wed, 17 Feb 2021 18:07:25 +0000 (18:07 +0000)]
Refactor Pap code to use Instant from Date

Issue-ID: POLICY-3069
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
Change-Id: I0e1b8ccc41749cd53a299397c8399f833279df59

3 years agoUpdate Pdp policy status during registration or State change 44/118044/6
a.sreekumar [Thu, 18 Feb 2021 14:13:29 +0000 (14:13 +0000)]
Update Pdp policy status during registration or State change

The Pdp Policy Status is not updated during the pdp heartbeat
handling/registration flow, or during State change.
When a PDP goes down the pdppolicystatus gets cleared. But when the PDP
comes back online, PAP deploys the right policies into it, but the
deployment status was not getting updated.
Similarly, when the State is changed to PASSIVE, the status should be
undeployed, and when the state is changed back to ACTIVE, then the
status should be deployed for any active policies in any PDP.
These issues are fixed here.

Updating postman collection.

Also updating the csit test to check for 202 instead of 200 for the
deployment api response.

Change-Id: I1e05f22df23daaa8da8be1376413e995be2376f3
Issue-ID: POLICY-2526
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoUpdate PAP CSIT to check 202 response 82/118082/1
Jim Hahn [Thu, 18 Feb 2021 21:10:23 +0000 (16:10 -0500)]
Update PAP CSIT to check 202 response

Issue-ID: POLICY-2526
Change-Id: I3f4e1289fb4c8aeb4833d3e76b473cf36f907783
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUpdating PAP deployment API to reflect actual status 47/117847/8
a.sreekumar [Mon, 15 Feb 2021 13:05:44 +0000 (13:05 +0000)]
Updating PAP deployment API to reflect actual status

Change-Id: I5281937fe5a742916c0c86983f71e280bbe126b2
Issue-ID: POLICY-2526
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoFix sonars from dependency upgrade 89/117789/1
Jim Hahn [Fri, 12 Feb 2021 12:46:30 +0000 (07:46 -0500)]
Fix sonars from dependency upgrade

The dependency upgrades in policy-parent caused some new sonars.  In
particular, initMocks() has been deprecated - replaced with calls to the
Mockito Runner and one call to openMocks().

Issue-ID: POLICY-2911
Change-Id: I6f28af9af41a1e5c83dead2eabf580731ffb9526
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMore sonars in pap 25/117725/1
Jim Hahn [Wed, 10 Feb 2021 22:25:39 +0000 (17:25 -0500)]
More sonars in pap

Addressed the following issues:
- don't use eq() with verify()

Issue-ID: POLICY-2911
Change-Id: Idf08195e4e2fb74e5e0d0d30f31b9e630720f48f
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Make filters on TOSCA entities generic"
Jim Hahn [Mon, 8 Feb 2021 23:20:16 +0000 (23:20 +0000)]
Merge "Make filters on TOSCA entities generic"

3 years agoMake filters on TOSCA entities generic 75/117575/1
liamfallon [Sun, 7 Feb 2021 15:23:31 +0000 (15:23 +0000)]
Make filters on TOSCA entities generic

The classes PolicyTypeFilter and PolicyFilter only work on Policy types
and policies. However they just filter on name/version/type/typeversion
so there is no reason that the filters could not be applied to other
entities.

This commit adapts the PolicyTypeFilter to EntityFilter and PolicyFilter
to TypedEntityFilter, so the filters can be applied to collections of
any ToscaEntity class.

Issue-ID: POLICY-2995
Change-Id: I7cc0ffa23fb12ab5b6e7617491dccd6f3289fa22
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agomove pap csit to policy repo 53/117553/1
Taka Cho [Fri, 5 Feb 2021 15:00:39 +0000 (10:00 -0500)]
move pap csit to policy repo

move pap csit plans/tests
to policy/pap repo

Issue-ID: POLICY-2895
Change-Id: I5a64f96d609f4aa39933ef0ca387fbd8dd5b468b
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoMake PAP stateless 94/116894/3
Jim Hahn [Mon, 11 Jan 2021 15:53:54 +0000 (10:53 -0500)]
Make PAP stateless

Removed old code that tracked the status using a cache.  Modified the
code to use the status found in the DB instead.

Issue-ID: POLICY-2648
Change-Id: I4f1f5201eff7b3352631f50d67c40349ac7f2014
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd class to manage policy deployment records 74/116874/1
Jim Hahn [Thu, 14 Jan 2021 13:32:40 +0000 (08:32 -0500)]
Add class to manage policy deployment records

Issue-ID: POLICY-2648
Change-Id: Icbb9545e3df6942e6f9cf98689607c461f6c8cdd
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd notification tracking classes 94/116794/1
Jim Hahn [Wed, 13 Jan 2021 15:40:01 +0000 (10:40 -0500)]
Add notification tracking classes

When PAP is made stateless, a new mechanism will be needed to track and
generate notifications.  Added some classes to facilitate that.

Issue-ID: POLICY-2648
Change-Id: Ib7b707f68a557e7b306dfdd1c6e6e9abd4671ec1
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Changed identifiers to concept identifiers"
Ram Krishna Verma [Wed, 6 Jan 2021 18:58:10 +0000 (18:58 +0000)]
Merge "Changed identifiers to concept identifiers"

3 years agouse jre base 2.2.0 - pap 10/116610/1
Taka Cho [Tue, 5 Jan 2021 20:09:40 +0000 (15:09 -0500)]
use jre base 2.2.0 - pap

use jre base 2.2.0

Issue-ID: POLICY-2917
Change-Id: Ic96af393c7c8689438c2072113ab53a647477d48
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoChanged identifiers to concept identifiers 68/116568/2
liamfallon [Mon, 4 Jan 2021 13:35:29 +0000 (13:35 +0000)]
Changed identifiers to concept identifiers

The policy models tosca classes ToscaPolicyIdentifier and
ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA
concept, not just TOSCA policies so they are renamed to
ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion
respectively.

The class ToscaPolicyTypeIdentifier is redundant and is replaced by
ToscaConceptIdentifier.

Issue-ID: POLICY-2900
Change-Id: I22bb3fdbaf2e237221a5c89afbf7898410603835
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoUpdate persistence.xml with new TOSCA classes 63/116463/1
liamfallon [Thu, 17 Dec 2020 16:37:22 +0000 (16:37 +0000)]
Update persistence.xml with new TOSCA classes

Issue-ID: POLICY-2900
Change-Id: I986074f69bef24ca894adc38eaf8b3ca4b4dc5a2
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoFixing sonar issues in policy-pap 23/116123/1
a.sreekumar [Fri, 4 Dec 2020 10:22:17 +0000 (10:22 +0000)]
Fixing sonar issues in policy-pap

Change-Id: I0f81906098c310aa5c437a2c06b708ae27560af8
Issue-ID: POLICY-2911
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agomove all bash to ash shell scripts - pap 60/115560/1
Taka Cho [Mon, 30 Nov 2020 18:50:21 +0000 (13:50 -0500)]
move all bash to ash shell scripts - pap

bash scripts convert to ash

Issue-ID: POLICY-2847
Change-Id: Icbe4afd9abe7d3634cce9cd7fb5b72dad38ecfcf
Signed-off-by: Taka Cho <takamune.cho@att.com>