policy/models.git
19 months agoupdate docker base image to snapshot 34/130734/1 honolulu
liamfallon [Mon, 5 Sep 2022 14:31:52 +0000 (15:31 +0100)]
update docker base image to snapshot

updated docker base image to snapshot

*** This commit is generated by a PF release script ***

Issue-ID: POLICY-4295
Signed-off-by: liamfallon <liam.fallon@est.tech>
Change-Id: I94cf796345d02e9967a6d8229f094cb91c90f5c5

20 months agoBump models to 2.4.7-SNAPSHOT 73/130373/3
Ram Krishna Verma [Thu, 18 Aug 2022 19:52:20 +0000 (15:52 -0400)]
Bump models to 2.4.7-SNAPSHOT

Issue-ID: POLICY-4295
Change-Id: Ib1d19bbbc997c69d76a5bc4b67b7e0a738686622
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
20 months agoRelease models 2.4.6 25/130325/1
Ram Krishna Verma [Wed, 17 Aug 2022 13:53:41 +0000 (09:53 -0400)]
Release models 2.4.6

Issue-ID: POLICY-4295
Change-Id: Ifa8333b6fc16afb3d6057bac2491cee921a392a6
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
20 months agoPoint to parent 3.3.3 and common 1.8.3 12/130312/1
Ram Krishna Verma [Tue, 16 Aug 2022 21:29:10 +0000 (17:29 -0400)]
Point to parent 3.3.3 and common 1.8.3

Issue-ID: POLICY-4295
Change-Id: Id7118485a553ddc652a36e9702a9cb5dab87b6af
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
21 months agoUpgrade to oparent 3.2.1 46/130146/4
pdragosh [Wed, 3 Aug 2022 13:23:37 +0000 (08:23 -0500)]
Upgrade to oparent 3.2.1

Use commons and parent

Issue-ID: POLICY-4211
Change-Id: I553a2d7531e0e91266a833e5b655e4d0fb42f079
Signed-off-by: pdragosh <pd1248@att.com>
21 months agoChange scripts to sh rather than bash 09/129909/1
liamfallon [Wed, 13 Jul 2022 12:38:22 +0000 (13:38 +0100)]
Change scripts to sh rather than bash

The models simulator in Honolulu uses bash for running scripts but bash
is not available in the alpine base image.

This commit replaces bash with sh

Issue-ID: POLICY-4233
Change-Id: I2cdab931257d6686c693d307c5eb742a896b0d08
Signed-off-by: liamfallon <liam.fallon@est.tech>
21 months agoupdate policy models references 61/129861/1
liamfallon [Mon, 11 Jul 2022 13:36:02 +0000 (14:36 +0100)]
update policy models references

updated policy models references

*** This commit is generated by a PF release script ***

Issue-ID: POLICY-4233
Signed-off-by: liamfallon <liam.fallon@est.tech>
Change-Id: If422638de955b177a07a8804b2f63cfe599cc30f

21 months agoUpdate snapshot and/or references of policy/models to latest snapshots 54/129854/1
liamfallon [Thu, 7 Jul 2022 13:18:36 +0000 (14:18 +0100)]
Update snapshot and/or references of policy/models to latest snapshots

policy/models updated to its latest own and reference snapshots

*** This commit is generated by a PF release script ***

Issue-ID: POLICY-4233
Signed-off-by: liamfallon <liam.fallon@est.tech>
Change-Id: I327d07981fe249f0a3fa851eb4774700111ed18d

21 months agoRelease docker images for policy/models: 2.4.5 17/129817/1
liamfallon [Thu, 7 Jul 2022 12:24:06 +0000 (13:24 +0100)]
Release docker images for policy/models: 2.4.5

This commit releases docker images for repo policy/models.

*** This commit is generated by a PF release script ***

Issue-ID: POLICY-4233
Signed-off-by: liamfallon <liam.fallon@est.tech>
Change-Id: I452794432e5c4a295ec59405cc1f427db02b5e9b

21 months agoRelease policy/models: 2.4.5 12/129812/1
liamfallon [Thu, 7 Jul 2022 10:31:15 +0000 (11:31 +0100)]
Release policy/models: 2.4.5

This commit releases repo policy/models.

*** This commit is generated by a PF release script ***

Issue-ID: POLICY-4233
Signed-off-by: liamfallon <liam.fallon@est.tech>
Change-Id: I84917f874c580a7669bdb3ff391bcdfa6dd5ffc8

2 years agoBump models to 2.4.5-SNAPSHOT 25/123125/1
Ram Krishna Verma [Wed, 4 Aug 2021 18:19:47 +0000 (14:19 -0400)]
Bump models to 2.4.5-SNAPSHOT

Issue-ID: POLICY-3329
Change-Id: I50fc59d9d9d605f3c979c71dc0fd17351036089a
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoRelease models 2.4.4 version 10/123110/1
Ram Krishna Verma [Wed, 4 Aug 2021 16:41:31 +0000 (12:41 -0400)]
Release models 2.4.4 version

Issue-ID: POLICY-3329
Change-Id: Idc768b60ce920df6b11b2e2290de5df40bb7fccd
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoPoint to parent 3.3.2 common 1.8.2 08/123108/1
Ram Krishna Verma [Wed, 4 Aug 2021 15:46:33 +0000 (11:46 -0400)]
Point to parent 3.3.2 common 1.8.2

Issue-ID: POLICY-3329
Change-Id: I246a591a9b5dece931c46f4ec4da42a529efa425
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoUpgrade to cds 1.1.5-SNAPSHOT 06/122906/2
Ram Krishna Verma [Mon, 2 Aug 2021 18:37:35 +0000 (14:37 -0400)]
Upgrade to cds 1.1.5-SNAPSHOT

Upgrading policy components to cds 1.1.5-SNAPSHOT
to verify the contract and fixes coming up in the next released version.

Issue-ID: POLICY-3516
Change-Id: I93602c392a5f917e68a7a1a74eaf0f188f520c39
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
(cherry picked from commit 35dff8f8bd31fd71e7f5e6c9aa39fe096e35d98a)

2 years agoUpgrade CDS dependency 77/122577/5
k.kedron [Mon, 19 Jul 2021 16:05:52 +0000 (18:05 +0200)]
Upgrade CDS dependency

- New CDS client libraries.
- Update code to use new CDS BlueprintProcessingService

Change-Id: I00fb044908774a48755ff8d9ebb32e055a74c819
Issue-ID: POLICY-3507
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoAdd example for pnf policy chaining 79/121979/1
Ram Krishna Verma [Mon, 21 Jun 2021 20:45:36 +0000 (16:45 -0400)]
Add example for pnf policy chaining

Adding example for policy chaining in drools-pdp for PNF.
This will be later referenced in the documents in upcoming review.

Issue-ID: POLICY-3382
Change-Id: Ifce5cf17e869566725a8e15fd391fb130c115e0f
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
(cherry picked from commit 6554ad87e8f3c760d5d6fc1692d112fa5dd2f8cd)

2 years agoAdd example for policy chaining 78/121978/1
Ram Krishna Verma [Wed, 16 Jun 2021 22:04:16 +0000 (18:04 -0400)]
Add example for policy chaining

Adding example for policy chaining in drools-pdp.
This will be later referenced in the documents in upcoming review.

Issue-ID: POLICY-3382
Change-Id: If2189422cb7e9ac35fb93e0fd9ae44f1cd412686
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
(cherry picked from commit 46af75bda81e5dfc5f885f3d735e51b57662bcc0)

2 years agoBump models to 2.4.4-SNAPSHOT 37/122137/1
Ram Krishna Verma [Wed, 23 Jun 2021 17:06:23 +0000 (13:06 -0400)]
Bump models to 2.4.4-SNAPSHOT

Issue-ID: POLICY-3329
Change-Id: I815ebb553c84664e175e252fb89f43f0c017a438
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoRelease models 2.4.3 maven artifacts 17/122117/1
Ram Krishna Verma [Tue, 22 Jun 2021 21:58:29 +0000 (17:58 -0400)]
Release models 2.4.3 maven artifacts

Issue-ID: POLICY-3329
Change-Id: I2091b30d902a2ac56a566b7ba7060cdaae11e3cc
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoPoint to released dependencies 11/122111/1
Ram Krishna Verma [Tue, 22 Jun 2021 16:33:17 +0000 (12:33 -0400)]
Point to released dependencies

Issue-ID: POLICY-3329
Change-Id: I3b06b1cf12569ed42ef9ceef81454a4484754ca8
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoUpgrade CDS dependency 45/121645/2
Rashmi Pujar [Tue, 1 Jun 2021 21:35:56 +0000 (17:35 -0400)]
Upgrade CDS dependency

CDS client libraries are exposed by a different
maven module making is much more cleaner to use.
The only drawback is we need to go back to older
version of grpc-testing artifact due to conflicts.

Issue-ID: POLICY-3338
Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
Change-Id: I98c79de7f12feefbae7c42c4c8f26357801b44f9
(cherry picked from commit d8b5454e5d389332f4f624c291fa46690cf177ef)
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoBump to 2.4.3 in models 64/119664/1
Jim Hahn [Tue, 23 Mar 2021 21:24:07 +0000 (17:24 -0400)]
Bump to 2.4.3 in models

Issue-ID: POLICY-3150
Change-Id: Ie55f2fda2e890efdfed602e2f6030199400645c0
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease 2.4.2 artifacts for models 59/119659/1 8.0.0-ONAP
Jim Hahn [Tue, 23 Mar 2021 19:15:49 +0000 (15:15 -0400)]
Release 2.4.2 artifacts for models

Issue-ID: POLICY-3150
Change-Id: I3337133a01981a7b8ad6309e52cbd7ae33ee4e4f
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix write failure on PDP statistics 17/119417/1
liamfallon [Fri, 19 Mar 2021 18:18:10 +0000 (18:18 +0000)]
Fix write failure on PDP statistics

Due to the precision of time stamps being saved to the nearest second,
a millisecond precision timestamp was being compared to a second
precision timestamp, causing the write to fail. This change fixes that.

A unit test is also added to test for this on the provider.

In addition, a USE-MARIADB flag is being introduced, which allows unit
tests to be run against a locally installed MariaDB instance so that the
unit tests can be verified against MariaDB locally rather than H2, the
default in Gerrit.

Issue-ID: POLICY-3146
Change-Id: I878f160956e89506743dc074679ee81ac1c48216
Signed-off-by: liamfallon <liam.fallon@est.tech>
(cherry picked from commit d6db5582b6705c11abbf8b507aa423aa00bcd7ae)

3 years agoUpdate policy-keystore with newer certificates 01/119401/2
jhh [Tue, 16 Mar 2021 15:34:48 +0000 (10:34 -0500)]
Update policy-keystore with newer certificates

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

3 years agoDefault to honolulu branch 07/119107/2
Jim Hahn [Wed, 10 Mar 2021 21:48:22 +0000 (16:48 -0500)]
Default to honolulu branch

Issue-ID: POLICY-3105
Change-Id: I651d1f67275979d95888695091e0699ac0adad52
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump models to 2.4.2-SNAPSHOT 84/118984/1
Jim Hahn [Tue, 9 Mar 2021 16:56:51 +0000 (11:56 -0500)]
Bump models to 2.4.2-SNAPSHOT

Issue-ID: POLICY-3127
Change-Id: Ie37871c54dc5e7eab0ee7d553c6b38ea0e720a29
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease models 2.4.1 artifacts 61/118961/1
Jim Hahn [Tue, 9 Mar 2021 14:37:54 +0000 (09:37 -0500)]
Release models 2.4.1 artifacts

Issue-ID: POLICY-3127
Change-Id: I2350bed3a5679ac5edb87544c732c4c094b7c028
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Use Date instead of Timestamp"
Jim Hahn [Mon, 8 Mar 2021 21:07:40 +0000 (21:07 +0000)]
Merge "Use Date instead of Timestamp"

3 years agoUse Date instead of Timestamp 73/118873/4
Jim Hahn [Fri, 5 Mar 2021 20:50:47 +0000 (15:50 -0500)]
Use Date instead of Timestamp

Use of Timestamp in JPA classes appears to cause
EntityNotFoundException.  Changed from Timestamp back to Date.

Issue-ID: POLICY-3125
Change-Id: I3ee29675849e3feda2641e9b240207c96fd975d4
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix 4 newly added Sonar bugs 55/118855/1
lapentafd [Fri, 5 Mar 2021 09:53:05 +0000 (09:53 +0000)]
Fix 4 newly added Sonar bugs

Added casting for 4 asserts in policy/models/base

Issue-ID: POLICY-3094
Change-Id: Ibc97be3eca366a7e9b8b9611bc284f2473acff6e
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoMerge "Refactor models for common type handling"
Liam Fallon [Thu, 4 Mar 2021 16:13:36 +0000 (16:13 +0000)]
Merge "Refactor models for common type handling"

3 years agoMerge "Fix sonar issues on policy-models"
Jim Hahn [Thu, 4 Mar 2021 14:13:06 +0000 (14:13 +0000)]
Merge "Fix sonar issues on policy-models"

3 years agoRefactor models for common type handling 67/118767/1
liamfallon [Tue, 2 Mar 2021 10:55:31 +0000 (10:55 +0000)]
Refactor models for common type handling

Currently we have handling for "type" and "type_version" on TOSCA Policy
class. However, the concept of a "type" and "type_version" also exists
on the ToscaCapabilityAssignment, the ToscaNodeTemplate, and the
ToscaRequriement classes.

This review makes the type handling on Policy generic, thus extending it
to the other three types.

Issue-ID: POLICY-2983
Change-Id: Ia20e3a8c485f4841257075df08e0784eac415770
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoFix sonar issues on policy-models 50/118750/2
lapentafd [Mon, 1 Mar 2021 17:09:28 +0000 (17:09 +0000)]
Fix sonar issues on policy-models

Tests refactoring to reduce number of assertions to less then 25

Issue-ID: POLICY-3094
Change-Id: Icd3d83c7f8168dd81df13a584229eab36c646f37
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoFix Reference Key columns persistence issue in db 20/118720/5
rameshiyer27 [Mon, 1 Mar 2021 18:46:33 +0000 (18:46 +0000)]
Fix Reference Key columns persistence issue in db

Problem: When PfReferenceTimestamp Key is persisted in db, the parent
class fields are ignored which causes inconsistent data while saving and
fetching in db.

Fix: JPA is not supporting inheritance in @Embeddable classes. Hence
included the super class as @Embedded property in PfReferenceTimestamp
key. @Embedded properties are unable to be queried directly. Slightly
modified Dao methods to support querying @embedded fields.

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

3 years agoMerge "Fix Null key issue in PfReferenceTimestampKey"
Liam Fallon [Thu, 25 Feb 2021 16:36:11 +0000 (16:36 +0000)]
Merge "Fix Null key issue in PfReferenceTimestampKey"

3 years agoFix Null key issue in PfReferenceTimestampKey 01/118501/2
rameshiyer27 [Tue, 23 Feb 2021 15:10:39 +0000 (15:10 +0000)]
Fix Null key issue in PfReferenceTimestampKey

isNUllKey check for PfReferenceTimestamp key is always returning false as the parent class is
validating the child object in its method which has additional parameters (timestamp).
Fixing the issue by validating only the fields of parent class.

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

3 years agoUpdate info.yaml in models 86/118386/1
Ram Krishna Verma [Wed, 24 Feb 2021 14:54:18 +0000 (09:54 -0500)]
Update info.yaml in models

Issue-ID: POLICY-3028
Change-Id: I9e3038fed7b4322cbf050fa56ffe77ee01e50a20
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoBump models to 2.4.1-SNAPSHOT 87/118287/1
Ram Krishna Verma [Tue, 23 Feb 2021 16:31:06 +0000 (11:31 -0500)]
Bump models to 2.4.1-SNAPSHOT

Issue-ID: POLICY-3088
Change-Id: I7f6cc0ab5299200315c78f6e6c79c79349d2608c
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoRelease models 2.4.0 version 46/118246/1
Ram Krishna Verma [Tue, 23 Feb 2021 14:43:29 +0000 (09:43 -0500)]
Release models 2.4.0 version

Issue-ID: POLICY-3088
Change-Id: I19c9020011dc4145894f726c1327670d409a7d78
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoPoint to non-snapshots in models 37/118237/1
Jim Hahn [Tue, 23 Feb 2021 13:19:13 +0000 (08:19 -0500)]
Point to non-snapshots in models

Issue-ID: POLICY-3088
Change-Id: I2789f3435514de5ef2be3f07f8419434bda89d6d
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRefactor timestamp property in policy models to use Instant 17/118017/6
rameshiyer27 [Tue, 16 Feb 2021 16:25:18 +0000 (16:25 +0000)]
Refactor timestamp property in policy models to use Instant

Updated JPA classes to use java.sql.TImestamp rather than Instant.

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

3 years agoMerge "Remove more duplicate code from models"
Ram Krishna Verma [Thu, 18 Feb 2021 16:34:29 +0000 (16:34 +0000)]
Merge "Remove more duplicate code from models"

3 years agoMerge "Use new version of A&AI APIs"
Ram Krishna Verma [Thu, 18 Feb 2021 16:24:17 +0000 (16:24 +0000)]
Merge "Use new version of A&AI APIs"

3 years agoAdd time and date attributes to DecisionRequest 01/118001/1
Pamela Dragosh [Wed, 17 Feb 2021 21:43:43 +0000 (15:43 -0600)]
Add time and date attributes to DecisionRequest

These are optional for clients, but may be necessary in
configurations where the application enforcing a guard is
running in a different time zone. Allows some flexibility
instead of always using the time zone that the xacml pdp
is running in.

Issue-ID: POLICY-2810
Change-Id: I4057e5956e59803cc9505fae0ee4e2f67eaf0358
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoRemove more duplicate code from models 94/117994/1
Jim Hahn [Wed, 17 Feb 2021 19:27:03 +0000 (14:27 -0500)]
Remove more duplicate code from models

Addressed sonar "duplicate code" issue by extracting a common
ToscaNameVersion class from the XxxIdentifier classes.
Also removed junit test for class that no longer exists and renamed
another junit to match the renaming of the class being tested.

Issue-ID: POLICY-2905
Change-Id: I4a28cd7de2478f2771a864439c0b440ad8310299
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse new version of A&AI APIs 13/115213/3
Jim Hahn [Fri, 20 Nov 2020 21:44:12 +0000 (16:44 -0500)]
Use new version of A&AI APIs

Just changed the version numbers; the APIs appear to be the same
otherwise.
Also removed unused APIs from the A&AI simulator.

Issue-ID: POLICY-2788
Change-Id: I8c0ae11c1e42f487b34286d5dfd4ca536bb2c07b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix sonars from removal of duplicate code 58/117958/3
Jim Hahn [Wed, 17 Feb 2021 15:10:39 +0000 (10:10 -0500)]
Fix sonars from removal of duplicate code

The work to remove duplicate code from models introduced as many new
sonars as it eliminated. :-(  Addressed the following new issues:
- visibility of constructor
- use of more specific assertThat() calls

Also added two junit test file that were somehow previously left out.

Issue-ID: POLICY-2905
Change-Id: I7a0206bd157412d3c6d98bfe21797f106b37ac65
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoPAP Deployment API changes - change url to uri 15/117915/3
a.sreekumar [Tue, 16 Feb 2021 16:56:47 +0000 (16:56 +0000)]
PAP Deployment API changes - change url to uri

Change-Id: I6fa4b001a0c4573a34e1cefe0d32ca969ca5096e
Issue-ID: POLICY-2526
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoMerge "Fix duplicate code in Jpa classes"
Pamela Dragosh [Tue, 16 Feb 2021 21:38:02 +0000 (21:38 +0000)]
Merge "Fix duplicate code in Jpa classes"

3 years agoAdd PfReference Timestamp key in policy-models-base to support timestamp 77/117777/5
rameshiyer27 [Thu, 11 Feb 2021 07:33:34 +0000 (07:33 +0000)]
Add PfReference Timestamp key in policy-models-base to support timestamp
property

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

3 years agoMerge "Updating PAP deployment API to reflect actual status"
Liam Fallon [Tue, 16 Feb 2021 14:40:11 +0000 (14:40 +0000)]
Merge "Updating PAP deployment API to reflect actual status"

3 years agoFix duplicate code in Jpa classes 18/117818/3
Jim Hahn [Fri, 12 Feb 2021 18:55:31 +0000 (13:55 -0500)]
Fix duplicate code in Jpa classes

Addressed the following issues:
- remove duplicate code; extracted a common class containing properties

Issue-ID: POLICY-2905
Change-Id: I80c423ab45c0c6823d338a034762d222ec334288
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix the Naming policy example 32/117832/2
sebdet [Mon, 15 Feb 2021 09:49:17 +0000 (10:49 +0100)]
Fix the Naming policy example

Change the attribute derived_from of the policy.data.increment-sequence attribute in the Naming policy example.
It should inherit from tosca.datatypes.Root

Issue-ID: POLICY-3067

Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I7a62b8c662b90a8481bb609d6a39e33ab9e7dada

3 years agoUpdating PAP deployment API to reflect actual status 06/117806/6
a.sreekumar [Fri, 12 Feb 2021 16:57:58 +0000 (16:57 +0000)]
Updating PAP deployment API to reflect actual status

Change-Id: I1fb0232d2f5fe37e95e87babb233a824212439ff
Issue-ID: POLICY-2526
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoMerge "Use type adapters from common"
Ram Krishna Verma [Mon, 15 Feb 2021 17:39:48 +0000 (17:39 +0000)]
Merge "Use type adapters from common"

3 years agoMerge "More sonars in models"
Jim Hahn [Fri, 12 Feb 2021 22:33:23 +0000 (22:33 +0000)]
Merge "More sonars in models"

3 years agoUse type adapters from common 13/117813/1
Jim Hahn [Fri, 12 Feb 2021 15:11:53 +0000 (10:11 -0500)]
Use type adapters from common

Addressed the following sonar issue:
- remove duplicate code by using gson type adapters from common

Issue-ID: POLICY-2905
Change-Id: I7a832ce3e15387ed25061caec3e057f150828dad
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMore sonars in models 10/117810/1
Jim Hahn [Fri, 12 Feb 2021 14:26:24 +0000 (09:26 -0500)]
More sonars in models

Addressed the following issues:
- change visibility of constructor
- assert exception type

Issue-ID: POLICY-2905
Change-Id: Iaededb32802e4facbbc776ae51d05d2ef5c60b93
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Alter PDP_UPDATE message to store lists of delpoyed/undeployed policies"
Ram Krishna Verma [Fri, 12 Feb 2021 14:37:42 +0000 (14:37 +0000)]
Merge "Alter PDP_UPDATE message to store lists of delpoyed/undeployed policies"

3 years agoAlter PDP_UPDATE message to store lists of delpoyed/undeployed policies 56/117756/3
waynedunican [Thu, 11 Feb 2021 16:31:38 +0000 (16:31 +0000)]
Alter PDP_UPDATE message to store lists of delpoyed/undeployed policies

Update the PdpUpdate class to store lists of deployed and undeployed
policies while maintaining it's current original full list of policies.
This will ensure that the changes to send policy updates only in the
PDP_UPDATE message will not effect the PDPs they can support updated
policies.

Issue-ID: POLICY-2112
Change-Id: I1a6e9d426ed3a8a3b4469a8b72ef57441e50545e
Signed-off-by: waynedunican <wayne.dunican@est.tech>
3 years agoFix sonars from depeendency upgrade 66/117766/1
Jim Hahn [Thu, 11 Feb 2021 22:06:38 +0000 (17:06 -0500)]
Fix sonars from depeendency upgrade

The dependency upgrades in policy-parent caused some new sonars.  In
particular, initMocks() has been deprecated - replaced with calls to the
Mockito Runner, in most cases.  Changed to openMocks() in one case and
removed unnecessary stubbings.

Issue-ID: POLICY-2905
Change-Id: I9aa098aa7aaebba09f6dcea4cac69ac1e5fbd4d6
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMore sonars in models 20/117720/5
Jim Hahn [Wed, 10 Feb 2021 21:17:10 +0000 (16:17 -0500)]
More sonars in models

Addressed the following:
- make constructors protected
- check exception type
- too many assertions
- remove annotation lists
- use "<>"
- reduce cognitive complexity
- extract constant
- multiple method calls in one assert
- don't use eq() in verify()
- indentation

Issue-ID: POLICY-2905
Change-Id: I25bb3951f781250e9cdfe8f5f3b80cb63e129184
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoSet target-database property 09/117609/1
Jim Hahn [Fri, 5 Feb 2021 16:03:41 +0000 (11:03 -0500)]
Set target-database property

The new version of eclipselink doesn't recognize mariaDB by default.
Added an optional property, databaseType, to the DB parameter class,
which defaults to "MySQL" if not set.  ("MySQL" is what web discussions
indicated should be used for mariaDB.)

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

3 years agoMake filters on TOSCA entities generic 73/117573/1
liamfallon [Sun, 7 Feb 2021 14:51:45 +0000 (14:51 +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: I8fcf76ee8c8497836b3286b35f928b0c341dac34
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoGive better messages than NPE for missing data 61/117561/2
Jim Hahn [Fri, 5 Feb 2021 16:13:31 +0000 (11:13 -0500)]
Give better messages than NPE for missing data

When data is not available to actor operations, an NPE is generally
thrown.  Modified the code to provide more info about what is missing
than simply NPE.

Issue-ID: POLICY-2913
Change-Id: I37b6eadd966e0693508a6d552b7db4edf5410018
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Upgrade io.grpc library in CDS actor"
Ajith Sreekumar [Fri, 29 Jan 2021 14:36:21 +0000 (14:36 +0000)]
Merge "Upgrade io.grpc library in CDS actor"

3 years agoUpgrade io.grpc library in CDS actor 70/117170/3
Ram Krishna Verma [Wed, 27 Jan 2021 21:31:45 +0000 (16:31 -0500)]
Upgrade io.grpc library in CDS actor

Upgrading to latest version of io.grpc 1.35.0 to fix security issues. The methods named loadBalancerFactory and nameResolverFactory have been removed in the latest version. After going through the grpc-java codebase found that the one's we were using to initialize those factories are made default. Confirmed my understanding by posting a query on grpc-java github repo.

Issue-ID: POLICY-2936
Change-Id: I238700ac3f384ff8e5fdef6c3f2ccfb54bff7005
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoAdd copy constructors to concepts 79/117179/1
liamfallon [Thu, 28 Jan 2021 10:42:12 +0000 (10:42 +0000)]
Add copy constructors to concepts

Copy constructors for ToscaServiceTemplate and ToscaTopologyTemplate.

Issue-ID: POLICY-2971
Change-Id: Idb4abf8bce40593e0bf18614b8c647688dd5748d
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Remove "Jpa" from table name"
Ram Krishna Verma [Wed, 20 Jan 2021 19:05:01 +0000 (19:05 +0000)]
Merge "Remove "Jpa" from table name"

3 years agoRemove "Jpa" from table name 90/116990/1
Jim Hahn [Tue, 19 Jan 2021 22:24:40 +0000 (17:24 -0500)]
Remove "Jpa" from table name

The DB table names of the various JpaXxx classes do not include the
"Jpa" prefix.  Removed it from the new Jpa class.

Issue-ID: POLICY-2648
Change-Id: I7f56502d75db05631749780138e989009eb93c83
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Convert Model Exception to Runtime Exception"
Ram Krishna Verma [Tue, 19 Jan 2021 22:23:10 +0000 (22:23 +0000)]
Merge "Convert Model Exception to Runtime Exception"

3 years agoMerge "Allow providers other than PolicyModelsProvider"
Ram Krishna Verma [Tue, 19 Jan 2021 22:21:53 +0000 (22:21 +0000)]
Merge "Allow providers other than PolicyModelsProvider"

3 years agoAllow providers other than PolicyModelsProvider 49/116949/2
liamfallon [Mon, 18 Jan 2021 11:34:12 +0000 (11:34 +0000)]
Allow providers other than PolicyModelsProvider

This change separates the database initiation and close functions of the
DatabasePolicyModelsProviderImpl class into an abstract class that does
the database DAO initiation and closing, and a domain specific part,
that does the manipulation of the policy models in the database.

This means that other providers, that wish to manipulate other objects
in the database, can specialize the AbstractModelsProvider class and use
its common DAO initiation and clsoing functionality, but can have their
own domain specific code.

The abstract class also now supports the Closeable interface.

Note that the exiting JUnit tests provide 100% coverage on
AbstractModelsProvider.

Issue-ID: POLICY-2971
Change-Id: Ibe59c02ab127ddbd9355d892b94a5d315507a8e6
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoConvert Model Exception to Runtime Exception 47/116947/3
liamfallon [Mon, 18 Jan 2021 11:17:28 +0000 (11:17 +0000)]
Convert Model Exception to Runtime Exception

Sometimes the exception thrown by the database providers has to be
converted to a runtime exception, especiall if the database provider is
running in a thread (called by the rum() method that does not return
exceptions). It is convenient to have a constructor on the
PfModelRuntimeException class that takes a PfModelException class as its
argument, thus creating the runtime exception.

Also the mapMap method in pfUtils is updated to allow the key of the map
to be templated. By doing this, the utility can be used for maps that
are keyed with types other than String (such as UUID).

Issue-ID: POLICY-2971
Change-Id: Ib0b3678de531fd383753a1cd0ce47a06f4079ec0
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Add PfKey translation to ToscaConceptIdentifier"
Pamela Dragosh [Tue, 19 Jan 2021 13:18:06 +0000 (13:18 +0000)]
Merge "Add PfKey translation to ToscaConceptIdentifier"

3 years agoCreate ToscaConceptIdentifier from ToscaEntityKey 43/116943/1
liamfallon [Mon, 18 Jan 2021 09:25:34 +0000 (09:25 +0000)]
Create ToscaConceptIdentifier from ToscaEntityKey

THis change adds a method to create a ToscaConceptIdentifer from a
ToscaEntityKey class. This method reduces the code vloume when
translating between these identifiers.

Issue-ID: POLICY-2971
Change-Id: Idd62339935d2ba78e6c60b40ee95fedac0642bef
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoAdd PfKey translation to ToscaConceptIdentifier 30/116930/1
liamfallon [Sat, 16 Jan 2021 09:11:48 +0000 (09:11 +0000)]
Add PfKey translation to ToscaConceptIdentifier

Concenience constructor to create a TosaConceptIdentifier from a PfKey
and a method to create a PfConceptKey from a ToscaConceptIdentifier.

Issue-ID: POLICY-2971
Change-Id: I402b2e12cc11976cd7e98436eb46486c35fdaa31
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Do not log filter to error log"
Liam Fallon [Fri, 15 Jan 2021 18:14:08 +0000 (18:14 +0000)]
Merge "Do not log filter to error log"

3 years agoMerge "Add copy constructor to ToscaNodeTemplate"
Jim Hahn [Fri, 15 Jan 2021 14:58:27 +0000 (14:58 +0000)]
Merge "Add copy constructor to ToscaNodeTemplate"

3 years agoMerge "Rename keywords used as column names in API and PAP JPA"
Jim Hahn [Fri, 15 Jan 2021 14:38:15 +0000 (14:38 +0000)]
Merge "Rename keywords used as column names in API and PAP JPA"

3 years agoDo not log filter to error log 07/116907/1
Jim Hahn [Fri, 15 Jan 2021 12:33:45 +0000 (07:33 -0500)]
Do not log filter to error log

The DAO code was logging the query filter to the error log.  Modified to
log it to the debug log.

Issue-ID: POLICY-2648
Change-Id: I372c77cb4fa1e5c4cb645d82b26ab0bba4a00826
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd copy constructor to ToscaNodeTemplate 89/116889/1
liamfallon [Wed, 13 Jan 2021 10:04:43 +0000 (10:04 +0000)]
Add copy constructor to ToscaNodeTemplate

In order to support serialization and deserialization of
ToscaNodeTemplate objects onto DMaaP, we need a copy constructor on the
ToscaNodeTemplate object.

Issue-ID: POLICY-2971
Change-Id: If6dc6c54d5673cef46734a88d0a91ae868c11dcb
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoRename keywords used as column names in API and PAP JPA 72/116872/4
gregory.hayes [Wed, 13 Jan 2021 20:35:46 +0000 (20:35 +0000)]
Rename keywords used as column names in API and PAP JPA

Using keywords as column names in JPA models is causing syntax errors during auto generation of DDL
The errors are visible in the policy api and pap docker logs on startup
This review renames the relevant columns

Issue-ID: POLICY-2670
Signed-off-by: gregory.hayes <gregory.hayes@est.tech>
Change-Id: I52a3156461940465c3945841c69a04fcb2f90117

3 years agoRemove extra logging from cds actor 07/116807/3
Ram Krishna Verma [Wed, 13 Jan 2021 20:24:35 +0000 (15:24 -0500)]
Remove extra logging from cds actor

Issue-ID: POLICY-2885
Change-Id: I5b7cb219f55a25153d50260d62292b92cfe39323
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoAdd more methods to query deployment status 60/116760/2
Jim Hahn [Tue, 12 Jan 2021 16:52:29 +0000 (11:52 -0500)]
Add more methods to query deployment status

Issue-ID: POLICY-2648
Change-Id: I398fa1332eb5a862dabd97ed409ef6413bb0c202
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd PDP-Policy deployment table to DB 90/116690/3
Jim Hahn [Thu, 7 Jan 2021 14:07:05 +0000 (09:07 -0500)]
Add PDP-Policy deployment table to DB

Added a table to record the PDP policy deployment status, which is
required for making PAP stateless.

Issue-ID: POLICY-2648
Change-Id: Ibe40ce00aca7a600051edcac49e55651c1c0164f
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse annotations on parameterized types 79/116679/1
Jim Hahn [Tue, 5 Jan 2021 16:11:26 +0000 (11:11 -0500)]
Use annotations on parameterized types

Updated the code to place validation annotations directly on the
annotated types instead of using the @Items and @Entries annotations.
Also added/updated junits for validation code.

Issue-ID: POLICY-2648
Change-Id: Ia535da07a38cec77a74c5c3215b5ae784d7a4e1a
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoChanged identifiers to concept identifiers 66/116566/5
liamfallon [Mon, 4 Jan 2021 12:15:18 +0000 (12:15 +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: Id0a37c42ea4e74f07b47e1694c4f8291c35879c9
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Add Service Template TOSCA handling"
Liam Fallon [Wed, 23 Dec 2020 18:28:33 +0000 (18:28 +0000)]
Merge "Add Service Template TOSCA handling"

3 years agoAdd Service Template TOSCA handling 48/116448/3
liamfallon [Thu, 17 Dec 2020 12:10:21 +0000 (12:10 +0000)]
Add Service Template TOSCA handling

Today we can only handle a single service template in the database. We
should be able to handle multiple service templates and assign arbitrary
policy types and policies to maned and versioned service templates.

This review brings in the Java API in models provider for handling
service templates in this way and uses a simplistic single-teplate
implementation in models-tosca, that will work but still only handles a
single service template under the hood.

Issue-ID: POLICY-2900
Change-Id: Ia02dea8abe44b7f407e685090a4b8e0360889653
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoAllow wild-card in supportedPolicyTypes 07/116507/1
Jim Hahn [Tue, 22 Dec 2020 15:10:40 +0000 (10:10 -0500)]
Allow wild-card in supportedPolicyTypes

Changes to the validation code broke the validation check for the
supportedPolicyTypes field in PdpSubGroup - it no longer supports wild-
cards in the name.  Modified the validation annotation in
PfSearchableKey to allow wild-card names.

Issue-ID: POLICY-2648
Change-Id: Ibd2853025ce72ed88697dd9a7d6d5eed2b28475e
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse annotations to do validation 90/116490/4
Jim Hahn [Sat, 19 Dec 2020 00:01:52 +0000 (19:01 -0500)]
Use annotations to do validation

Modified models to use annotations instead of function calls for most
field validations.  Created a few new validation annotations for use
within models.
Per review comments:
- renamed Key to VerifyKey
- enhanced VerifyKey to imply "@Valid", unless disabled

Issue-ID: POLICY-2648
Change-Id: I2b53f218b0a2ab1ed1f5e278816a3509f1408972
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse ValidationResult for models v2.0 71/116471/2
Jim Hahn [Thu, 17 Dec 2020 17:07:14 +0000 (12:07 -0500)]
Use ValidationResult for models v2.0

Policy models uses PfValidationXxx classes which are totally unrelated
to ValidationResult in policy common.  This precludes the use of various
utility methods and annotations for doing validation.  Modified policy
models to use ValidationResult instead.
This approach uses function calls, though a future approach could make
use of annotations instead.

Issue-ID: POLICY-2648
Change-Id: I9760f1dc46902ab6bef7f440f3caf5e951660a5d
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoJPA concepts for TOSCA 80/116180/6
liamfallon [Mon, 7 Dec 2020 16:25:14 +0000 (16:25 +0000)]
JPA concepts for TOSCA

Implement the Database persistence parts for the new TOSCA concepts so
that those concepts can be written to and read from the database.

First batch of comment fixes

Issue-ID: POLICY-2900
Change-Id: I45191c1ff57cf1ea8563399db6cc8e51b2724813
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoAdd functional method for mapping maps to PfUtils 53/116253/3
liamfallon [Wed, 9 Dec 2020 11:30:40 +0000 (11:30 +0000)]
Add functional method for mapping maps to PfUtils

Add a functional interface to PfUtils for mapping maps so that more
complex conversions can be handled.

List mapping functional methods added as well.

Issue-ID: POLICY-2900
Change-Id: I4189e09d6d8621638960b5d9f0d19792a7faceb8
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoFix Modify NSSI operation 50/116150/1
krishnaa96 [Mon, 7 Dec 2020 07:03:17 +0000 (12:33 +0530)]
Fix Modify NSSI operation

Update the operation to receive payload
from the onset message

Issue-ID: POLICY-2916
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: If49d41b35c1cd6562146fe4d92799a9a77a46db9

3 years agoMerge "Add generic methods to TOSCA providers and utils"
Jim Hahn [Fri, 4 Dec 2020 15:18:09 +0000 (15:18 +0000)]
Merge "Add generic methods to TOSCA providers and utils"