policy/models.git
2 years agoMerge "Add "configure" operation to xacml"
Ajith Sreekumar [Thu, 29 Jul 2021 08:19:12 +0000 (08:19 +0000)]
Merge "Add "configure" operation to xacml"

2 years agoAdd junit test for empty statistics filter 27/122927/2
Jim Hahn [Wed, 28 Jul 2021 13:48:00 +0000 (09:48 -0400)]
Add junit test for empty statistics filter

Also removed the version field from the filter, as it is not applicable
to the PDP instance name.

Issue-ID: POLICY-3511
Change-Id: I17e8d2d6646a27736a827b9e9e17881d6b0a3795
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd "configure" operation to xacml 61/122861/3
Jim Hahn [Mon, 26 Jul 2021 15:11:09 +0000 (11:11 -0400)]
Add "configure" operation to xacml

Added "configure" operation to xacml simulator and actor.xacml.

Issue-ID: POLICY-3502
Change-Id: Ia206303c65ce4e54187d818da9253dabfe864d62
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRemove actor.guard from models 62/122862/1
Jim Hahn [Mon, 26 Jul 2021 13:48:31 +0000 (09:48 -0400)]
Remove actor.guard from models

Replaced by actor.xacml.

Issue-ID: POLICY-3506
Change-Id: I41b6a9918df31b251eb93105fc9413deda04daf3
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRemove unused statistics methods 42/122842/1
Jim Hahn [Fri, 23 Jul 2021 19:14:12 +0000 (15:14 -0400)]
Remove unused statistics methods

The getPdpStatistics method should be removed as they're functionality
has been subsumed by getFilteredPdpStatistics.

Issue-ID: POLICY-3511
Change-Id: I98da98ac483705bea46ebaa0619257195be6b518
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoLimit the number of statistics records returned 41/122841/4
Jim Hahn [Wed, 21 Jul 2021 21:30:32 +0000 (17:30 -0400)]
Limit the number of statistics records returned

Added limit of MAX records (100).  Also, if unspecified, or negative,
it defaults to MAX records.

Issue-ID: POLICY-3511
Change-Id: I0170951cd79818af5944adf5d29480bad4de815b
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRefactor GuardOperation 24/122824/2
Jim Hahn [Wed, 21 Jul 2021 21:30:32 +0000 (17:30 -0400)]
Refactor GuardOperation

Extracted DecisionOperation superclass out of GuardOperation.

Issue-ID: POLICY-3502
Change-Id: Ice766e9c33756a5780726c75a0283f89c85cabad
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdded Xacml actor 04/122804/3
Jim Hahn [Tue, 20 Jul 2021 18:07:35 +0000 (14:07 -0400)]
Added Xacml actor

Cloned the guard actor to use as a starting point for creating a more
generic actor for interacting with the xacml-pdp.
Also renamed various classes.

Issue-ID: POLICY-3501
Change-Id: I9bd0107845de41a349d56259e6cfa6a3180efa25
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUpgrade CDS dependency 77/122777/1
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>
2 years agoAdd attributes to Decision Response 11/122711/1
Dragosh, Pamela (pd1248) [Mon, 19 Jul 2021 15:10:22 +0000 (11:10 -0400)]
Add attributes to Decision Response

In order to support returning specific attributes, this field will
be needed.

Issue-ID: POLICY-2865
Change-Id: I9901e89abeb2fd375d6e218d4d39e736ff8829da
Signed-off-by: Dragosh, Pamela (pd1248) <pd1248@att.com>
2 years agoMerge "Delete extra simulator docker images"
Ram Krishna Verma [Tue, 13 Jul 2021 17:31:01 +0000 (17:31 +0000)]
Merge "Delete extra simulator docker images"

2 years agoUpdate Pam's email INFO.yaml 03/122603/1
Dragosh, Pamela (pd1248) [Tue, 13 Jul 2021 14:31:52 +0000 (10:31 -0400)]
Update Pam's email INFO.yaml

Issue-ID: POLICY-3484
Change-Id: Ibbba0d4c981df0b27ac76aed97a64dab27871750
Signed-off-by: Dragosh, Pamela (pd1248) <pd1248@att.com>
2 years agoDelete extra simulator docker images 89/122589/4
Jim Hahn [Mon, 12 Jul 2021 19:25:53 +0000 (15:25 -0400)]
Delete extra simulator docker images

The policy-models-simulator docker image, built from
models-sim/packages, subsumes the functionality of the other simulator
images.  Deleted the other images.

This simulator still needs some of the code from the dmaap-sim modules,
so only deleted the code from the latter that is not needed by this
simulator.

Also modified the simulator launch script to use sh instead of bash.

Issue-ID: POLICY-3474
Change-Id: Ie7f69b327a18c3e07f154124ae38975d5e6924f0
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd default min records for policy audit 88/122588/2
Ram Krishna Verma [Mon, 12 Jul 2021 20:11:51 +0000 (16:11 -0400)]
Add default min records for policy audit

Adding default min records as 10 for policy audit provider.
This is inline with our discussions and design doumented here
https://wiki.onap.org/display/DW/PAP+REST+API+changes+for+Istanbul+release

Issue-ID: POLICY-3340
Change-Id: I5bab5f186f2591b1a2f2c42e9851ad88f73c8dfb
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoMerge "Handle numRecords default setting when built as 0."
Jim Hahn [Mon, 12 Jul 2021 18:34:41 +0000 (18:34 +0000)]
Merge "Handle numRecords default setting when built as 0."

2 years agoHandle numRecords default setting when built as 0. 49/122549/3
adheli.tavares [Fri, 9 Jul 2021 17:28:28 +0000 (18:28 +0100)]
Handle numRecords default setting when built as 0.

Check the numRecord to be set as DEFAULT_MAX_RECORDS when not added to
the auditFilter (builder set it to 0).

Issue-ID: POLICY-3340
Change-Id: I25ad83bbea71ddd82064aec3069ffa4cbce5aac1
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoRemove unused DAO statistics methods 82/122582/1
Jim Hahn [Mon, 12 Jul 2021 14:04:40 +0000 (10:04 -0400)]
Remove unused DAO statistics methods

The PDP statistics provider had several filter methods, at least one
of which has now been subsumed by another and is no longer being used.

Issue-ID: POLICY-3405
Change-Id: If603eaf3df36fd4e6e3555376bf1b95144ec8eb1
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUpdate pdp statistics to count deploy/undeploy separately. 53/122453/4
adheli.tavares [Mon, 5 Jul 2021 13:59:40 +0000 (14:59 +0100)]
Update pdp statistics to count deploy/undeploy separately.

Issue-ID: POLICY-3383
Change-Id: I41e2668bdebd732149db0ccbe160b67b9952a8d9
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoUpdate policy-models for checkstyle 8.43 62/122262/3
liamfallon [Mon, 28 Jun 2021 08:33:18 +0000 (09:33 +0100)]
Update policy-models for checkstyle 8.43

Issue-ID: POLICY-3209
Change-Id: Ic45f889ab4d0ed24f6c1fc1aaece0601636e7a10
Signed-off-by: liamfallon <liam.fallon@est.tech>
2 years agoAdd "source" to PAP-PDP messages 09/122109/4
Jim Hahn [Tue, 22 Jun 2021 16:01:37 +0000 (12:01 -0400)]
Add "source" to PAP-PDP messages

Added a "source" field to the PdpStateChange and PdpUpdate messages so
that PAP can record a unique name in the message, for logging purposes.

In a separate review, planning to add a method in policy-common for
creating the unique name.  Once that has been created, it will be used
by PAP, to populate the "source" field, and all PDPs, to populate the
"name" field in the PdpStatus messages.

Issue-ID: POLICY-3409
Change-Id: I86c97702abe62a5672720330df50b7b106187661
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Add example for pnf policy chaining"
Pamela Dragosh [Tue, 22 Jun 2021 11:22:36 +0000 (11:22 +0000)]
Merge "Add example for pnf policy chaining"

2 years agoAdd timestamp to Pdp records 74/122074/3
Jim Hahn [Fri, 18 Jun 2021 20:03:04 +0000 (16:03 -0400)]
Add timestamp to Pdp records

To support the case where multiple PAPs are running, added a timestamp
to the PDP records so the PAPs can all be kept in sync as far as when a
PDP was last responsive.

Issue-ID: POLICY-2898
Change-Id: Ia7e0fd17363ff5827564cbc1537e516156b7f53a
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd example for pnf policy chaining 88/122088/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>
2 years agoFix new checkstyle issues in models 73/122073/3
Jim Hahn [Mon, 21 Jun 2021 13:54:27 +0000 (09:54 -0400)]
Fix new checkstyle issues in models

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

Issue-ID: POLICY-3094
Change-Id: I85314bc0249cba0020a0aefbc250851a2b646dd9
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Use lombok for errors pap, pdp, sim-dmaap, sim-pdp"
Jim Hahn [Mon, 21 Jun 2021 13:17:35 +0000 (13:17 +0000)]
Merge "Use lombok for errors pap, pdp, sim-dmaap, sim-pdp"

2 years agoUse lombok for errors pap, pdp, sim-dmaap, sim-pdp 27/122027/2
Jim Hahn [Thu, 17 Jun 2021 20:29:33 +0000 (16:29 -0400)]
Use lombok for errors pap, pdp, sim-dmaap, sim-pdp

Issue-ID: POLICY-3396
Change-Id: Ib2c9bc5dc199e15ae9ca077031c0f2cfbc5b6a81
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse lombok for events, base, dao 29/122029/2
Jim Hahn [Thu, 17 Jun 2021 20:54:20 +0000 (16:54 -0400)]
Use lombok for events, base, dao

Issue-ID: POLICY-3396
Change-Id: I7b37efc13a25e0e27d63a85a3ee291e91a4e1682
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Use lombok annotations for sdnr, simulators"
Jim Hahn [Fri, 18 Jun 2021 13:34:31 +0000 (13:34 +0000)]
Merge "Use lombok annotations for sdnr, simulators"

2 years agoMerge "Use lombok annotations for so, vfc"
Jim Hahn [Fri, 18 Jun 2021 13:34:17 +0000 (13:34 +0000)]
Merge "Use lombok annotations for so, vfc"

2 years agoMerge "Use lombok annotations for aai, appc, appclcm, cds"
Jim Hahn [Fri, 18 Jun 2021 13:34:04 +0000 (13:34 +0000)]
Merge "Use lombok annotations for aai, appc, appclcm, cds"

2 years agoMerge "Use lombok annotations for tosca, rest, sdnc"
Jim Hahn [Fri, 18 Jun 2021 13:33:50 +0000 (13:33 +0000)]
Merge "Use lombok annotations for tosca, rest, sdnc"

2 years agoMerge "Use lombok annotations for actors"
Jim Hahn [Fri, 18 Jun 2021 13:33:33 +0000 (13:33 +0000)]
Merge "Use lombok annotations for actors"

2 years agoUse lombok annotations for actors 32/122032/1
Jim Hahn [Thu, 17 Jun 2021 22:04:53 +0000 (18:04 -0400)]
Use lombok annotations for actors

This is the last one for policy-models!

Issue-ID: POLICY-3396
Change-Id: I05b114a57a720a6ae8ae073b80c8bded36d0d06d
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse lombok annotations for aai, appc, appclcm, cds 31/122031/1
Jim Hahn [Thu, 17 Jun 2021 21:35:26 +0000 (17:35 -0400)]
Use lombok annotations for aai, appc, appclcm, cds

Issue-ID: POLICY-3396
Change-Id: I81b6b0c7929809ffaeadadd6144e9b9f394bfdc8
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse lombok annotations for tosca, rest, sdnc 25/122025/1
Jim Hahn [Thu, 17 Jun 2021 20:05:25 +0000 (16:05 -0400)]
Use lombok annotations for tosca, rest, sdnc

Issue-ID: POLICY-3396
Change-Id: I3c9e5ee7ea6da2bab4fe37504d39f7ce63868887
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse lombok annotations for sdnr, simulators 22/122022/1
Jim Hahn [Thu, 17 Jun 2021 19:39:34 +0000 (15:39 -0400)]
Use lombok annotations for sdnr, simulators

Issue-ID: POLICY-3396
Change-Id: I16787f72b0529417c58b9e83a21880baaba92a3d
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoUse lombok annotations for so, vfc 21/122021/1
Jim Hahn [Thu, 17 Jun 2021 19:26:35 +0000 (15:26 -0400)]
Use lombok annotations for so, vfc

Issue-ID: POLICY-3396
Change-Id: I33781c72dd1c0b9a7a525c23e81c4259fa32384f
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoAdd example for policy chaining 96/121996/2
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>
2 years agoReplace method parameters with filter parameters 39/121939/1
Jim Hahn [Tue, 15 Jun 2021 18:33:56 +0000 (14:33 -0400)]
Replace method parameters with filter parameters

Added more methods taking filter parameters instead of individual method
parameters.  Removed the old methods.
Added genOrderClause().

Issue-ID: POLICY-3094
Change-Id: Ie9d8c13a8d4a7f81e284f07fce3d96a35918a114
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoFix sonar in policy/models 80/121880/4
Ram Krishna Verma [Fri, 11 Jun 2021 14:13:17 +0000 (10:13 -0400)]
Fix sonar in policy/models

use "var" for local variables

Issue-ID: POLICY-3077
Change-Id: Ia1ea62e03c016d336c9b11b07b0ea941ba905497
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2 years agoFix sonars in policy-models 64/121864/5
Jim Hahn [Thu, 10 Jun 2021 21:38:58 +0000 (17:38 -0400)]
Fix sonars in policy-models

Fixed:
- too many parameters in method call

Fixed it by introducing PfFilterParameters.  However, classes having the
Builder annotation are not easily subclassed, so introduced an
interface, too.

Issue-ID: POLICY-3094
Change-Id: Ida99522a542b1296b367c55b7e8f8e83783c2e4f
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Exposing the Audit provider through Models provider."
Liam Fallon [Thu, 3 Jun 2021 21:09:07 +0000 (21:09 +0000)]
Merge "Exposing the Audit provider through Models provider."

2 years agoFix junits for new bean validation field names 81/121681/2
Jim Hahn [Tue, 1 Jun 2021 15:07:44 +0000 (11:07 -0400)]
Fix junits for new bean validation field names

Issue-ID: POLICY-3333
Change-Id: I339024677a2d090f61cc55d1b056b832c87d231a
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoExposing the Audit provider through Models provider. 80/121680/1
adheli.tavares [Thu, 3 Jun 2021 09:37:35 +0000 (10:37 +0100)]
Exposing the Audit provider through Models provider.

Change-Id: I4a3a28b6dbbfbad533a69cf46c545ece7e0b147e
Issue-ID: POLICY-2899
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoMerge "Upgrade CDS dependency"
Liam Fallon [Thu, 3 Jun 2021 10:42:50 +0000 (10:42 +0000)]
Merge "Upgrade CDS dependency"

2 years agoMerge "Handling Policy deploy/undeploy audit models"
Jim Hahn [Wed, 2 Jun 2021 14:35:48 +0000 (14:35 +0000)]
Merge "Handling Policy deploy/undeploy audit models"

2 years agoUpgrade CDS dependency 27/121627/1
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

2 years agoMerge "No-sonar on the wrong line"
Ram Krishna Verma [Fri, 28 May 2021 18:36:58 +0000 (18:36 +0000)]
Merge "No-sonar on the wrong line"

2 years agoMerge "Remove policies field from PdpUpdate message"
Jim Hahn [Fri, 28 May 2021 18:33:22 +0000 (18:33 +0000)]
Merge "Remove policies field from PdpUpdate message"

2 years agoNo-sonar on the wrong line 91/121591/1
Jim Hahn [Fri, 28 May 2021 14:59:36 +0000 (10:59 -0400)]
No-sonar on the wrong line

Tried putting NOSONAR comment at the end of the statement, because it
seems like checkstyle/sonar doesn't like comments in the middle of a
statement.  Nonetheless, sonar still reports an issue on the line with
the "SELECT" statement, so I guess there's no choice but to move NOSONAR
to the end of that line.

Issue-ID: POLICY-3094
Change-Id: If26ad0b1e7dcc9c7aa963da10a9c5160a8fe272d
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoHandling Policy deploy/undeploy audit models 16/121416/9
adheli.tavares [Tue, 11 May 2021 13:35:20 +0000 (14:35 +0100)]
Handling Policy deploy/undeploy audit models

Added a new Entity to store information when a Pdp Policy is deployed or
undeployed and its create/retrieve methods.

Change-Id: I35b3608c878bbfbbee0a99a124d100a48fe08131
Issue-ID: POLICY-2899
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2 years agoFix more sonars in models 78/121578/1
Jim Hahn [Thu, 27 May 2021 21:48:22 +0000 (17:48 -0400)]
Fix more sonars in models

Fixed sonars:
- SQL injection
- use re2j instead of regex

Issue-ID: POLICY-3094
Change-Id: I553bd6aa5832d71a5ac33320e2d0d022f9a00e98
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoRemove policies field from PdpUpdate message 65/121565/2
waynedunican [Thu, 27 May 2021 08:12:05 +0000 (09:12 +0100)]
Remove policies field from PdpUpdate message

Issue-ID: POLICY-3323
Change-Id: I14dafe4a20f95e2ebe4279e5b6ae141e2ee4fc48
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Signed-off-by: WayneDunican <wayne.dunican@est.tech>
2 years agoAdjust indexes for Op History table 19/121519/1
Jim Hahn [Mon, 24 May 2021 15:39:42 +0000 (11:39 -0400)]
Adjust indexes for Op History table

Reordered one index to put requestId first, as that should significantly
reduce the number of index entries to be examined.
Added endtime to another index, which should also reduce the number of
index entries to be examined for look-ups by time.

Issue-ID: POLICY-2874
Change-Id: I29c10fb9cabb22b3520ed1b14d7fe3fd9db40a15
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoFix sonars in policy models 21/121321/2
Jim Hahn [Wed, 12 May 2021 17:25:06 +0000 (13:25 -0400)]
Fix sonars in policy models

Fixed:
- a few other "var" cases
- use re2j instead of java.util.regex
- use correct class for constants
- remove unused constants

Issue-ID: POLICY-3094
Change-Id: Ifcb2b0623e8df0527f0a279e666d062422978ded
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoMerge "Fix sonars in policy models"
Liam Fallon [Tue, 11 May 2021 12:28:31 +0000 (12:28 +0000)]
Merge "Fix sonars in policy models"

2 years agoMerge "Fix sonars in policy-models impls & simulators"
Liam Fallon [Tue, 11 May 2021 12:28:17 +0000 (12:28 +0000)]
Merge "Fix sonars in policy-models impls & simulators"

2 years agoFix sonars in policy models 35/121235/2
Jim Hahn [Mon, 10 May 2021 15:39:27 +0000 (11:39 -0400)]
Fix sonars in policy models

Fixed:
- use "var"

Issue-ID: POLICY-3094
Change-Id: Id5ea7ab049c2018744afa75a55d44e47f216d5bc
Signed-off-by: Jim Hahn <jrh3@att.com>
2 years agoFix sonars in policy-models impls & simulators 33/121233/1
Jim Hahn [Mon, 10 May 2021 13:53:23 +0000 (09:53 -0400)]
Fix sonars in policy-models impls & simulators

Fixed:
- use "var"

Issue-ID: POLICY-3094
Change-Id: I65da54cae5a58966f21f981c6cea1259bfdf4239
Signed-off-by: Jim Hahn <jrh3@att.com>
simulators

Change-Id: I1144568485e62e0c72194caaf21ebf1ba88a6fef
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix sonars in policy-models actors 07/121207/3
Jim Hahn [Fri, 7 May 2021 22:07:09 +0000 (18:07 -0400)]
Fix sonars in policy-models actors

Fixed:
- use "var"
- don't throw generic Exception

Issue-ID: POLICY-3094
Change-Id: I020addb9511fd665b5fed48e7d40719e27039224
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Remove GroupValidationResult"
Jim Hahn [Mon, 3 May 2021 17:00:16 +0000 (17:00 +0000)]
Merge "Remove GroupValidationResult"

3 years agoRemove GroupValidationResult 16/120916/3
Jim Hahn [Mon, 26 Apr 2021 22:16:36 +0000 (18:16 -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: I245e4a647fcbb718faa63a7543f9f81c85da958c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAdd correct filter type prefix to query 31/120931/2
ktimoney [Tue, 27 Apr 2021 10:26:09 +0000 (11:26 +0100)]
Add correct filter type prefix to query

Added unit tests

Issue-ID: POLICY-3247
Change-Id: I27474948619b7256a1e504611531eecac15c27c1
Signed-off-by: ktimoney <kevin.timoney@est.tech>
3 years agoMerge "Add a new key class which uses @GeneratedValue to base classes"
Pamela Dragosh [Mon, 26 Apr 2021 12:55:35 +0000 (12:55 +0000)]
Merge "Add a new key class which uses @GeneratedValue to base classes"

3 years agoAdd a new key class which uses @GeneratedValue to base classes 46/120646/6
ktimoney [Tue, 13 Apr 2021 13:40:06 +0000 (14:40 +0100)]
Add a new key class which uses @GeneratedValue to base classes

This will provide an alternative unique key.
It will be used in place of PfTimestampKey in the PdpStatistics table.
We make use of the @GeneratedValue annotation to provide this feature.
Added DummyGeneratedIdEntity and unit tests
Added PfFilterFactory class
Added new filter classes

Issue-ID: POLICY-3189
Change-Id: I097eab318d2cb958e1157e35825fd6d35d429a25
Signed-off-by: ktimoney <kevin.timoney@est.tech>
3 years agoRefactor CommandLineArguments classes 15/120615/2
adheli.tavares [Thu, 15 Apr 2021 09:35:00 +0000 (10:35 +0100)]
Refactor CommandLineArguments classes

All CMD Args simulator classes to extend from CMD class on Common.
Fix all unit tests accordingly.

Issue-ID: POLICY-3129
Change-Id: If69e432679772df15b06ce7e316c7c876b69773d
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
3 years agoClose DB in junits 70/120370/3
Jim Hahn [Fri, 9 Apr 2021 13:49:48 +0000 (09:49 -0400)]
Close DB in junits

Modified some of the junits to close the DB.
In addition, one of the junits was apparently dependent on a previous
test method adding records to the DB, thus the test methods were
actually order dependent, even though no annotations were used to
enforce the order.  Modified that method to insert the data, itself, so
the test methods are no longer order dependent.

Issue-ID: POLICY-3171
Change-Id: I778c12796340f2a665b4ba00588c823c925c078c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse distinct names in DB junits 43/120343/1
Jim Hahn [Thu, 8 Apr 2021 21:26:18 +0000 (17:26 -0400)]
Use distinct names in DB junits

Junits for models often use the same memory DB name which may leave
garbage in the DB from one test to the next.  Modified the code to use
distinct names for each XxxTest class.

Issue-ID: POLICY-3171
Change-Id: I2a4a0b4949d532d6949f5d39396288c54d03688b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Fix Sonar Issues models-tosca-simple"
Jim Hahn [Fri, 26 Mar 2021 19:18:01 +0000 (19:18 +0000)]
Merge "Fix Sonar Issues models-tosca-simple"

3 years agoFix Sonar Issues models-tosca-simple 49/119849/3
lapentafd [Tue, 23 Mar 2021 17:46:41 +0000 (17:46 +0000)]
Fix Sonar Issues models-tosca-simple

Tests refactoring to reduce number of assertions

Issue-ID: POLICY-3094
Change-Id: I8a9a02100e5d103f574cf2cb89d2e924d0f56507
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoMerge "Fix sonar issues for tests in policy-models"
Jim Hahn [Wed, 24 Mar 2021 12:41:04 +0000 (12:41 +0000)]
Merge "Fix sonar issues for tests in policy-models"

3 years agoMerge "Delete keystores from models"
Ram Krishna Verma [Mon, 22 Mar 2021 21:45:40 +0000 (21:45 +0000)]
Merge "Delete keystores from models"

3 years agoFix write failure on PDP statistics 60/119560/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>
3 years agoDelete keystores from models 57/119557/3
Jim Hahn [Fri, 19 Mar 2021 17:08:02 +0000 (13:08 -0400)]
Delete keystores from models

The Keystores are no longer needed in the tarballs, as they are supplied
externally by the CSITs and Helm charts.  Deleted those files.
Also modified the junits to use utils-test to generate keystores at
runtime, thus deleted the junit keystore file, too.

Issue-ID: POLICY-3143
Change-Id: Idd24b735a908476765d40bdcb5c741257edc7bb6
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix sonar issues for tests in policy-models 15/119615/1
lapentafd [Thu, 18 Mar 2021 12:06:14 +0000 (12:06 +0000)]
Fix sonar issues for tests in policy-models

Tests refactoring to reduce number of assertions

Issue-ID: POLICY-3094
Change-Id: I445462f0ec5d49474b10c1940c7fa12e687636de
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoMerge "Fix Sonar Issues in models-pdp"
Pamela Dragosh [Thu, 18 Mar 2021 12:59:09 +0000 (12:59 +0000)]
Merge "Fix Sonar Issues in models-pdp"

3 years agoUpdate policy-keystore with newer certificates 87/119387/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
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
3 years agoFix Sonar Issues in models-pdp 57/119357/2
lapentafd [Fri, 12 Mar 2021 13:48:03 +0000 (13:48 +0000)]
Fix Sonar Issues in models-pdp

Tests refactoring to reduce number of assertions

Issue-ID: POLICY-3094
Change-Id: I23369c341c43df71b84392501d33739453f7c81f
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoMerge "Fix Sonar Issues on policy-models-tosca"
Jim Hahn [Mon, 15 Mar 2021 16:39:21 +0000 (16:39 +0000)]
Merge "Fix Sonar Issues on policy-models-tosca"

3 years agoFix Sonar Issues on policy-models-tosca 76/119076/4
lapentafd [Tue, 9 Mar 2021 15:13:05 +0000 (15:13 +0000)]
Fix Sonar Issues on policy-models-tosca

Tests refactoring to reduce number of assertions

Removed lines 167-169 in PfKeyImplTest

Issue-ID: POLICY-3094
Change-Id: I94ef11068811c81108b0fbf3e5b878d02ab25306
Signed-off-by: lapentafd <francesco.lapenta@est.tech>
3 years agoRemove more unnecessary plugins from models 77/119277/2
Jim Hahn [Fri, 12 Mar 2021 22:24:33 +0000 (17:24 -0500)]
Remove more unnecessary plugins from models

Issue-ID: POLICY-3126
Change-Id: If93ce1a3412cd7342a78e478ea2684ff9bf6dd97
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAddress plugin-not-found issues 54/119254/2
Jim Hahn [Fri, 12 Mar 2021 14:39:42 +0000 (09:39 -0500)]
Address plugin-not-found issues

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

Issue-ID: POLICY-3126
Change-Id: Ia1124da66239b57d6a05cdbdcce7866a38f59120
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump version to 2.5.0 in models 08/119108/1
Jim Hahn [Wed, 10 Mar 2021 19:53:36 +0000 (14:53 -0500)]
Bump version to 2.5.0 in models

Issue-ID: POLICY-3105
Change-Id: I01fe35f16609f9b8d98fb2083c8b18fc7ce3ccf3
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Add support for localName based filtering in PfReferenceTimestamp key."
Jim Hahn [Wed, 10 Mar 2021 16:42:35 +0000 (16:42 +0000)]
Merge "Add support for localName based filtering in PfReferenceTimestamp key."

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 agoAdd support for localName based filtering in PfReferenceTimestamp key. 59/119059/1
rameshiyer27 [Tue, 9 Mar 2021 12:49:39 +0000 (12:49 +0000)]
Add support for localName based filtering in PfReferenceTimestamp key.

Issue : Currently we have a requirement to filter control loop
statistics based on the UUID of the element which is "localName" of the
PfREferenceTimestamp key. Adding UUID as part of filterMap in
getFiltered() method which also requires this minor change in buildFilter.

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

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>