policy/models.git
5 years agoRemove sonar issue in simple provider 79/87679/1
liamfallon [Tue, 14 May 2019 13:20:01 +0000 (13:20 +0000)]
Remove sonar issue in simple provider

Issue-ID: POLICY-1738
Change-Id: Id85d710154727c7c535db7cc50af88f52114a358
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "request-action parameter value is changed in SDNC"
Pamela Dragosh [Mon, 13 May 2019 11:32:17 +0000 (11:32 +0000)]
Merge "request-action parameter value is changed in SDNC"

5 years agoChanged Aai schema dependency 38/87538/1
pramod.jamkhedkar [Mon, 13 May 2019 10:43:49 +0000 (06:43 -0400)]
Changed Aai schema dependency

Changed Aai schema dependency to 1.0.2 and removed exclusions.

Issue-ID: POLICY-1717
Change-Id: I5cf192f85a3233bc133a6daaa54618ba0ddd1243
Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
5 years agorequest-action parameter value is changed in SDNC 18/87518/1
Vidyashree Rama [Mon, 13 May 2019 04:09:21 +0000 (09:39 +0530)]
request-action parameter value is changed in SDNC

Enum name SdwanBWPolicyChange  changed to SdwanBandwidthChange.

Change-Id: Ia9305414621de83d0e330ece8c2e09b76639d271
Issue-ID: POLICY-1750
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
5 years agoStore legacy op policy properties as plain strings 99/87399/2
liamfallon [Thu, 9 May 2019 20:59:37 +0000 (20:59 +0000)]
Store legacy op policy properties as plain strings

THe properties of legacy operational policies are already
encoded and should not be stored in JSON format.

Issue-ID: POLICY-1759
Change-Id: I3e2a69f216348c02c2ef9c23282f87da52a7f390
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Change vFW payload from pg-streams to streams"
Jorge Hernandez [Thu, 9 May 2019 20:02:29 +0000 (20:02 +0000)]
Merge "Change vFW payload from pg-streams to streams"

5 years agoStore policy type version in policy before DB write 80/87380/1
liamfallon [Thu, 9 May 2019 15:54:41 +0000 (15:54 +0000)]
Store policy type version in policy before DB write

The policy type version must be updated on a policy before it is stored
to the database, otherwise the database value is incorrect.

Issue-ID: POLICY-1738
Change-Id: I0a7f2da3837497dd999141f40466d6507c26159b
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoChange vFW payload from pg-streams to streams 82/87282/4
Jim Hahn [Wed, 8 May 2019 19:39:37 +0000 (15:39 -0400)]
Change vFW payload from pg-streams to streams

Changed APPC payload from pg-streams to streams.
Also removed trafficgenerator.
Updated licenses.
Added log message when payload is null.
Replaced "ref$" with real payload values in yaml and docs.

Change-Id: I4b38b0f64784d5fffc8f62f3a26cd007e500fbc7
Issue-ID: POLICY-1752
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd JSON encoding to legacy policy properties 83/87283/1
liamfallon [Wed, 8 May 2019 20:59:09 +0000 (20:59 +0000)]
Add JSON encoding to legacy policy properties

Now that all properties on policies are stored as JSON, the properties
on legacy policies must also be stored as JSON in the database.

Issue-ID: POLICY-1753
Change-Id: Ia75a02c8d6f595ce0fb68ac1fa2f2399fbc08f6e
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoSet default and check existance of Policy Type 38/87138/2
liamfallon [Tue, 7 May 2019 12:42:26 +0000 (12:42 +0000)]
Set default and check existance of Policy Type

The TOSCA specification has a "bug" in that it does not have a field to specify
the version of a policy type to use. We already had introduced the "type_version" field
for this.

This review introduces setting of the default version of a policy type to be
be used by a policy as the latest version of the policy type in the database.
As a side effect of this, we now have to check for existence of the policy type
of a policy in the database. This means that creation/update of a policy with
a non-existant policy type specified will now fail.

Issue-ID: POLICY-1738
Change-Id: I27080cf6cd358948810dab6897c72dfe4d41fe91
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Supports new aai changes."
Jorge Hernandez [Tue, 7 May 2019 00:33:47 +0000 (00:33 +0000)]
Merge "Supports new aai changes."

5 years agoSupports new aai changes. 91/86991/2
pramod.jamkhedkar [Mon, 6 May 2019 04:00:24 +0000 (00:00 -0400)]
Supports new aai changes.

Made changes to support model and model version additions to Aai custom
query response.

Issue-ID: POLICY-1729
Change-Id: I84a202105d477548e9e8e060d983bf9cd47d3885
Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
5 years agoSerializaiton of properties to DB as JSON 81/86981/1
liamfallon [Sun, 5 May 2019 21:26:36 +0000 (21:26 +0000)]
Serializaiton of properties to DB as JSON

Properties should be serialized to JSON prior to writing to database
and deserialized from JSON when read from database.

Issue-ID: POLICY-1736
Change-Id: I5ad3fd4a87079f4557f5fcb825395f0b4bec3318
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoDecision should return dictionary 20/86920/1
Pamela Dragosh [Fri, 3 May 2019 17:57:11 +0000 (13:57 -0400)]
Decision should return dictionary

Should not be an array of policies, should be a
dictionary.

Issue-ID: POLICY-1735
Change-Id: Ia88ef65dd332933aafbe6b57693344d5d43c53b8
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFixed guard simulator 98/86898/1
Pamela Dragosh [Fri, 3 May 2019 12:37:15 +0000 (08:37 -0400)]
Fixed guard simulator

The guard simulator should simulate the new xacml pdp
decision api not the old.

Issue-ID: POLICY-1730
Change-Id: I97f5df9d698e8c852a0e2c71dbef6ac5912a2d2c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Fix version.properties"
Jorge Hernandez [Thu, 2 May 2019 18:12:17 +0000 (18:12 +0000)]
Merge "Fix version.properties"

5 years agoFix bug in guard policy metadata creation 40/86840/2
liamfallon [Thu, 2 May 2019 16:53:57 +0000 (16:53 +0000)]
Fix bug in guard policy metadata creation

Issue-ID: POLICY-1728
Change-Id: Ie33a30a811fcd8c128dfac87c17dcb37da6d42b4
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoFix version.properties 25/86825/1
Pamela Dragosh [Thu, 2 May 2019 14:39:39 +0000 (10:39 -0400)]
Fix version.properties

Not in synch with pom.xml. Should be 2.0.0

Issue-ID: POLICY-1700
Change-Id: I3a761c703ce39523d13607f8ef29c58e47f6b11f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUpgrade to release parent and common 98/86698/1
Pamela Dragosh [Wed, 1 May 2019 11:07:23 +0000 (07:07 -0400)]
Upgrade to release parent and common

For Dublin release parent and common are released.

Issue-ID: POLICY-1700
Change-Id: I33e4524c30472cfc789c0daaa771dad8e089c6c8
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFix SONAR issues on DMaaP Simulator 96/86696/1
liamfallon [Wed, 1 May 2019 10:14:09 +0000 (10:14 +0000)]
Fix SONAR issues on DMaaP Simulator

Fixed interrupt issue and stack trace printout on
DMaaP simulator.

Issue-ID: POLICY-1643
Change-Id: I0a7898b7ea230960df8052981fe22dfeb3a04365
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoDocker container for DMaaP Simulator 16/86616/2
liamfallon [Tue, 30 Apr 2019 13:31:03 +0000 (13:31 +0000)]
Docker container for DMaaP Simulator

THis review brings in a Docker container for the DMaaP
simulator for CSIT testing. This container should NOT
be submitted to the ONAP nexus as it is only for testing.

Issue-ID: POLICY-1643
Change-Id: I0e2147da9b7c0a85db68044439d48378d3a3e5b5
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoAddress sonar issue in policy-models/pdp 50/86550/1
Jim Hahn [Mon, 29 Apr 2019 16:33:16 +0000 (12:33 -0400)]
Address sonar issue in policy-models/pdp

Extracted a common constant.

Change-Id: I24504109e9c7bbed352fa3e845d7d3f7b07db970
Issue-ID: POLICY-1708
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd copy constructor for PdpStatus 31/86331/1 3.0.2-ONAP
Jim Hahn [Thu, 25 Apr 2019 22:39:48 +0000 (18:39 -0400)]
Add copy constructor for PdpStatus

Change-Id: Id818d3b16355ad3f3a96ff4456ec8e8062055f98
Issue-ID: POLICY-1645
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoPopulate policies, even if empty 85/86285/1
Jim Hahn [Thu, 25 Apr 2019 12:55:05 +0000 (08:55 -0400)]
Populate policies, even if empty

Modified PdpUpdate to create an empty policy list, by default,
rather than leaving it null.

Change-Id: I81906410bcc7da21d6471d496713ec9b375632a2
Issue-ID: POLICY-1692
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoExclude commons-beanutils 77/86077/1
Pamela Dragosh [Tue, 23 Apr 2019 17:21:06 +0000 (13:21 -0400)]
Exclude commons-beanutils

Per A&AI team, this can be safely excluded. commons-beanutils has
security vulnerabilities https://nvd.nist.gov/vuln/detail/CVE-2014-0114

Issue-ID: POLICY-1659
Change-Id: Ic70cc7cea4f2b3b7609219a0641252e37b8b2de9
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Fix a bug in adding one-digit policy-version in metadata"
Jorge Hernandez [Sat, 20 Apr 2019 16:06:07 +0000 (16:06 +0000)]
Merge "Fix a bug in adding one-digit policy-version in metadata"

5 years agoFix a bug in adding one-digit policy-version in metadata 46/85846/1
Chenfei Gao [Fri, 19 Apr 2019 19:09:19 +0000 (15:09 -0400)]
Fix a bug in adding one-digit policy-version in metadata

Original change of adding single digit policy-version in tosca policy
metadata does not take effect actually. It is added into metadata of
authorative tosca policy but not jpa tosca policy. Identify the issue
at the last minute and fix it.

Issue-ID: POLICY-1442
Change-Id: I8aefa546f757f7841554e3caf00ccc476d23ebf5
Signed-off-by: Chenfei Gao <cgao@research.att.com>
5 years agoExclude jackson-databind 28/85828/1
Pamela Dragosh [Fri, 19 Apr 2019 15:52:40 +0000 (11:52 -0400)]
Exclude jackson-databind

Jackson databind has security issues, sometimes its easier to
just exclude it if possible.

This repo doesn't use it directly, the swagger dependency pulls
it in. It doesn't look like our usage of swagger dependency would
require the jackson-databind as we only use the annotation:
@ApiModelProperty

NOTE: Swagger also pulls in jackson-annotations, which seems to
be used by a few modules for JSON annotations. eg. those modules
are using jackson-annotations indirectly via the swagger
dependency pulling in that dependency. Not a big deal.

Compilation of policy/api repo works with this exclusion.

Issue-ID: POLICY-1507
Change-Id: Ic8501df5ad4f4fc8f6cd93e739d7ff2e52d98785
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoAdd DMaaP simulator for CSIT testing 93/85593/1
liamfallon [Wed, 17 Apr 2019 13:58:26 +0000 (13:58 +0000)]
Add DMaaP simulator for CSIT testing

A rudimentary DMaaP simulator that simply holds requests and responds
to all readers with whatever message comes in on a topic. The simulator
is placed in policy models for now but should be submitted to DMaaP.

The simulator is now working but is still extremely rough.

Issue-ID: POLICY-1643
Change-Id: I28645a73cf198fe825c897243b30cd34dc29f20d
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoDon't include "nullVersion" in swagger API 15/85515/2
Jim Hahn [Tue, 16 Apr 2019 19:32:12 +0000 (15:32 -0400)]
Don't include "nullVersion" in swagger API

Swagger sitll uses jackson, thus it is including
ToscaPolicyIdentifierOptVersion.isNullVersion() in the API that it
generates.  Added @JsonIgnore annotation to prevent it from being
included.  Similar issue with get/setVersion() in PdpGroup.
Created POLICY-1653 to remove the isNullVersion() method altogether in
El Alto.

Change-Id: I6cb7b7d1d75258eeb9d6f9b6c7a48eeb32174307
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoFix null not accepted on PDP message 47/85447/1
liamfallon [Tue, 16 Apr 2019 11:08:38 +0000 (11:08 +0000)]
Fix null not accepted on PDP message

Issue-ID: POLICY-1648
Change-Id: I580d1c433cd3a5730b115ef6353770f17939cf3a
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Add serialized name for typeVersion"
Jorge Hernandez [Mon, 15 Apr 2019 20:47:06 +0000 (20:47 +0000)]
Merge "Add serialized name for typeVersion"

5 years agoAdd serialized name for typeVersion 57/85357/1
Chenfei Gao [Mon, 15 Apr 2019 18:38:39 +0000 (14:38 -0400)]
Add serialized name for typeVersion

Add serialied name and swagger ui rendering name for
attribute typeVersion in ToscaPolicy.

Issue-ID: POLICY-1515
Change-Id: I42e85117c5f47901bf8c16d3cc6f162a8b6db5e1
Signed-off-by: Chenfei Gao <cgao@research.att.com>
5 years agoFix sonar issue in PdpGroups 56/85356/1
Jim Hahn [Mon, 15 Apr 2019 18:21:18 +0000 (14:21 -0400)]
Fix sonar issue in PdpGroups

Extracted common string constant.

Change-Id: I5721641d8a45e7dce317cb6a1b75570a715779ea
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Use keys to speed DB queries"
Pamela Dragosh [Mon, 15 Apr 2019 16:50:51 +0000 (16:50 +0000)]
Merge "Use keys to speed DB queries"

5 years agoUse keys to speed DB queries 36/85336/1
Jim Hahn [Mon, 15 Apr 2019 15:10:58 +0000 (11:10 -0400)]
Use keys to speed DB queries

When a filter specifies a name (and possibly version), those can
be used to speed DB searches.  Modified the code to use the keys
rather than always retrieving every record before applying the
filter.

Change-Id: I6b48d9e6880ab7e8132d5d8f770394720031b9b5
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd conversion from plain Ident to IdentOptVersion 23/85323/1
Jim Hahn [Mon, 15 Apr 2019 13:55:12 +0000 (09:55 -0400)]
Add conversion from plain Ident to IdentOptVersion

Added a "copy constructor" that copies an Ident to an Ident
with an optional version.  The reverse does not make sense,
so did not add that (e.g., version may be null or may just
be a prefix, while the version in Ident is major.minor.patch).

Change-Id: Ifd3935a998cd4c1cb5113a59c5f36a7d9baf79ff
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Add prefix matching for policy version"
Pamela Dragosh [Mon, 15 Apr 2019 13:09:53 +0000 (13:09 +0000)]
Merge "Add prefix matching for policy version"

5 years agoAdd prefix matching for policy version 59/85259/9
Jim Hahn [Sat, 13 Apr 2019 13:05:13 +0000 (09:05 -0400)]
Add prefix matching for policy version

Re-introduced regular expressions to match policy version
so that the policy version found in the metadata, which is just
the major number, can be matched with a policy's version, which
is of the form, major.minor.patch.
Simplified equals() test, as we already know "text!=null".
Added filterPrefixPred() and modified policy filter to use it when
matching versions, as it is simpler to use when matching a version
prefix.
Also added tests to PfObjectFilterTest to test each of the XxxPred()
methods.

Change-Id: I0734873f701a539e883fe25b8eecfdde60cc8b6d
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoDisallow empty subgroup list in group request 62/85262/2
Jim Hahn [Sun, 14 Apr 2019 00:26:33 +0000 (20:26 -0400)]
Disallow empty subgroup list in group request

Change-Id: I8a00caf1b22363fe3ab90bdf57244af687a2cb6d
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoCheck for duplicates in lists 44/85244/5
Jim Hahn [Fri, 12 Apr 2019 19:53:08 +0000 (15:53 -0400)]
Check for duplicates in lists

Modified duplicate subgroup check to eliminate sonar issue.
Added duplicate group check.
Modified ModelsTest to exclude PdpMessage, which seemed to cause
intermittent junit failures.

Change-Id: Id281874506d3a39610739e24cee49360b345724f
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoRemove version from PdpGroup 38/85238/1
liamfallon [Fri, 12 Apr 2019 18:59:25 +0000 (18:59 +0000)]
Remove version from PdpGroup

Issue-ID: POLICY-1095
Change-Id: I91f495947fe77222804e7ab31c4dd7d7aee66b44
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoAdd validation methods for PAP REST API 37/85137/5
Jim Hahn [Fri, 12 Apr 2019 01:58:12 +0000 (21:58 -0400)]
Add validation methods for PAP REST API

Also made the identifier classes comparable.
Stupid tabs.

Change-Id: I54c0595c6a2c61a1b72b58fe1d667657f9d5d71e
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoUNit test and minor fixes for DB pars 26/85126/2
liamfallon [Fri, 12 Apr 2019 12:44:22 +0000 (12:44 +0000)]
UNit test and minor fixes for DB pars

Add unit test for the new database provider driver parameter.

Address the comments raised in the last review.

Issue-ID: POLICY-1095
Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Fix database properties"
Pamela Dragosh [Thu, 11 Apr 2019 17:42:48 +0000 (17:42 +0000)]
Merge "Fix database properties"

5 years agoMerge "Use policy-id instead of name"
Jorge Hernandez [Thu, 11 Apr 2019 17:04:54 +0000 (17:04 +0000)]
Merge "Use policy-id instead of name"

5 years agoMerge "Add constant PdpGroup.VERSION"
Pamela Dragosh [Thu, 11 Apr 2019 16:21:58 +0000 (16:21 +0000)]
Merge "Add constant PdpGroup.VERSION"

5 years agoMerge "Aai Simulator for CQ"
Pamela Dragosh [Thu, 11 Apr 2019 16:14:34 +0000 (16:14 +0000)]
Merge "Aai Simulator for CQ"

5 years agoFix database properties 85/85085/1
liamfallon [Thu, 11 Apr 2019 15:59:47 +0000 (15:59 +0000)]
Fix database properties

Issue-ID: POLICY-1095
Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoAai Simulator for CQ 60/85060/3
pramod.jamkhedkar [Thu, 11 Apr 2019 14:03:23 +0000 (10:03 -0400)]
Aai Simulator for CQ

Added the aai simulator for custom query. Minor change to AaiManager

Issue-ID: POLICY-1278
Change-Id: I4d5d2a616d2ce85f3b6c539a1d90fe85ee55e093
Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
5 years agoAdd constant PdpGroup.VERSION 72/85072/1
Jim Hahn [Thu, 11 Apr 2019 15:04:29 +0000 (11:04 -0400)]
Add constant PdpGroup.VERSION

At some point, the "version" field will be removed from PdpGroup.
Until then, all groups should have the same version, thus added
a constant for that value.

Change-Id: Ib81e2760d04bea0abf83c42bf95fe861a7471176
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoUse policy-id instead of name 69/85069/1
Jim Hahn [Thu, 11 Apr 2019 14:45:23 +0000 (10:45 -0400)]
Use policy-id instead of name

When CLAMP deploys a policy to the PDPs, it uses field names
found in the meta-data, which are "policy-id" and "policy-version".
Modified the class used by that particular to use those field names
when encoded/decoded via gson.

Change-Id: Ib67bd2cd05a906cc809dc6078efdabbd7aa1fa37
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Custom Query Code"
Pamela Dragosh [Wed, 10 Apr 2019 21:22:17 +0000 (21:22 +0000)]
Merge "Custom Query Code"

5 years agoCustom Query Code 36/84736/9
pramod.jamkhedkar [Tue, 9 Apr 2019 18:40:16 +0000 (14:40 -0400)]
Custom Query Code

Changes to aai, so, vfc and restmanager to support aai custom queries.
updated to latest version of aai schema. Made changes according to
latest updates.

Issue-ID: POLICY-1278
Change-Id: I255cef17fff4fe7d4ea21344c0e5ccaac52cbe9a
Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
5 years agoAdd policy ID and version to metadata 07/84907/1
liamfallon [Wed, 10 Apr 2019 17:01:22 +0000 (17:01 +0000)]
Add policy ID and version to metadata

Adds the policy-id and policy-version of the policy
to the policy metadata, duplicating the policy key in therre.

Issue-ID: POLICY-1095
Change-Id: I49603766141f5dee47573edc9f05d2ee2cf9da52
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Parse new model ids from operation policy"
Pamela Dragosh [Wed, 10 Apr 2019 15:27:24 +0000 (15:27 +0000)]
Merge "Parse new model ids from operation policy"

5 years agoFinish unit test on policy-models 79/84779/2
liamfallon [Wed, 10 Apr 2019 11:34:06 +0000 (11:34 +0000)]
Finish unit test on policy-models

Unit test coverage well over 90% in
policy-models-base
policy-models-dao
policy-models-pdp
policy-models-tosca
policy-models-provider

Issue-ID: POLICY-1095
Change-Id: I7703e2ae8a93575ca478c3d809ff8c1fb9f0f334
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoParse new model ids from operation policy 51/84851/1
vamshi.nemalikonda [Wed, 10 Apr 2019 10:43:14 +0000 (16:13 +0530)]
Parse new model ids from operation policy

Takes VFModule info from policy yaml,instead AAI.

Change-Id: If745b3ba32562cbc37571cea29ec7797ee697e88
Issue-ID: POLICY-1545
Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
5 years agoAdd unit tests for policy type and policy filters 25/84725/1
liamfallon [Tue, 9 Apr 2019 16:58:20 +0000 (16:58 +0000)]
Add unit tests for policy type and policy filters

THis review adds unit tests for the authorative concepts in the
models-tosc module and adds unit tests for the authorative and
and database providers.

Issue-ID: POLICY-1095
Change-Id: If98deea99658056030dd47725b0c0a4266d84106
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Parse new model ids from operational policy"
Jorge Hernandez [Tue, 9 Apr 2019 14:29:28 +0000 (14:29 +0000)]
Merge "Parse new model ids from operational policy"

5 years agoParse new model ids from operational policy 72/84672/1
Pamela Dragosh [Tue, 9 Apr 2019 12:24:14 +0000 (08:24 -0400)]
Parse new model ids from operational policy

Companion review to https://gerrit.onap.org/r/#/c/84235/

Copies the required changes into policy/models.

Issue-ID: POLICY-1545
Change-Id: I43fec36f60b5409d9e3df9d925de06209c81fd01
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoComplete unit test for models-pdp 36/84636/2
liamfallon [Tue, 9 Apr 2019 11:55:57 +0000 (11:55 +0000)]
Complete unit test for models-pdp

This review completes the unit test for the models-pdp module, for persistence
of PDP groups and for PDP group filtering.

Added unit test of filters for TOSCA policy types and policies.

Added fix to allow filters to pass when the value being
checked is null.

Issue-ID: POLICY-1095
Change-Id: I982400ef39f0282d813d49e484a58207e03b8a63
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Code changes for OOF SON Use Case"
Jorge Hernandez [Tue, 9 Apr 2019 00:33:20 +0000 (00:33 +0000)]
Merge "Code changes for OOF SON Use Case"

5 years agoCode changes for OOF SON Use Case 66/84566/1
Pamela Dragosh [Mon, 8 Apr 2019 21:11:37 +0000 (17:11 -0400)]
Code changes for OOF SON Use Case

Companian review to https://gerrit.onap.org/r/#/c/84361/

Issue-ID: POLICY-1463
Change-Id: I2640f01c07890a4b1e8938175b637b84dcc19f3c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoAdd lists and tests for PDP filters 47/84547/1
liamfallon [Mon, 8 Apr 2019 17:30:54 +0000 (17:30 +0000)]
Add lists and tests for PDP filters

The policy type and policy filters for PDP groups are added
in this review.

Also filter tests for PDP group filter is completed.

Issue-ID: POLICY-1095
Change-Id: Ia28776c809f2ab879af4007b3480621637a83f69
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Add bug fixes and tests for filters"
Jorge Hernandez [Mon, 8 Apr 2019 16:54:06 +0000 (16:54 +0000)]
Merge "Add bug fixes and tests for filters"

5 years agoMerge "Remove drools PDP dependency"
Jorge Hernandez [Mon, 8 Apr 2019 16:16:55 +0000 (16:16 +0000)]
Merge "Remove drools PDP dependency"

5 years agoMerge "Add PdpMessage.appliesTo()"
Pamela Dragosh [Mon, 8 Apr 2019 15:26:21 +0000 (15:26 +0000)]
Merge "Add PdpMessage.appliesTo()"

5 years agoRemove drools PDP dependency 19/84419/4
Pamela Dragosh [Sat, 6 Apr 2019 01:07:07 +0000 (21:07 -0400)]
Remove drools PDP dependency

Removing working memory and use of PolicyEngine from
drools in these classes.

Cleaned up some unused imports and checkstyle.

Issue-ID: POLICY-1264
Change-Id: Id059da9689a721b0eafc6b310adcbdad43574ce7
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoAdd bug fixes and tests for filters 24/84524/2
liamfallon [Mon, 8 Apr 2019 13:58:53 +0000 (13:58 +0000)]
Add bug fixes and tests for filters

Fixed bugs on filtering where lack of null checks was blocking
all results.
Added unit test for PDP related JPA objects.
Fixed cascading and orphan control on JPA objects.
Added partial testing of PdpProvider.
Added partial testing of filters.
Changed tag for content of operational policies from "Content" to "content".

Issue-ID: POLICY-1095
Change-Id: Ieb22e06955a8434b490bae7d0f6b77d4479515e8
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Add unit test for PDP groups"
Jorge Hernandez [Mon, 8 Apr 2019 12:22:50 +0000 (12:22 +0000)]
Merge "Add unit test for PDP groups"

5 years agoMerge "Clean up a couple of array lists"
Pamela Dragosh [Mon, 8 Apr 2019 11:45:24 +0000 (11:45 +0000)]
Merge "Clean up a couple of array lists"

5 years agoMerge "Add undeploy response to models-pap"
Liam Fallon [Mon, 8 Apr 2019 05:39:32 +0000 (05:39 +0000)]
Merge "Add undeploy response to models-pap"

5 years agoAdd unit test for PDP groups 65/84465/1
liamfallon [Mon, 8 Apr 2019 05:27:08 +0000 (05:27 +0000)]
Add unit test for PDP groups

Unit test for the JPA concepts in models-pdp.

Issue-ID: POLICY-1095
Change-Id: Id33626f3789da45e36935edf564003651e9ce7c4
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoClean up a couple of array lists 38/84438/3
Jim Hahn [Sun, 7 Apr 2019 14:50:27 +0000 (10:50 -0400)]
Clean up a couple of array lists

Initialized initial array size for empty list.
Add some junit tests to ensure that the returned lists are mutable.
Updated license in filter class.

Change-Id: I9c151eb50355a71f4d34ac46b41f8278cf913664
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd PdpMessage.appliesTo() 36/84436/2
Jim Hahn [Sun, 7 Apr 2019 13:49:41 +0000 (09:49 -0400)]
Add PdpMessage.appliesTo()

Added a method to determine if a message is applicable to a particular
PDP.  This is a common function that should have been added previously,
as each PDP type has had to create an implementation of it.
Nevertheless, this provides a "reference" implementation.

Change-Id: I54073c77a9d2b4c1f902c5ac0bce9fa5fa485503
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Fix bugs on filters"
Pamela Dragosh [Sun, 7 Apr 2019 00:20:08 +0000 (00:20 +0000)]
Merge "Fix bugs on filters"

5 years agoGuaranteed linear-time latestVersion() 25/84425/4
Jim Hahn [Sat, 6 Apr 2019 03:32:15 +0000 (23:32 -0400)]
Guaranteed linear-time latestVersion()

This is a proposed revision of the latestVersion() method that's
guaranteed to be linear time.  Still makes use of the slick idea
of sorting the list so that items with the same name are adjacent
and in order by version.
Revised to use an array list, which is more like the original code.

Change-Id: If047d4d9630c426c6335f52cb7e5bdda7b6cc0a9
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoFix bugs on filters 27/84427/1
liamfallon [Sat, 6 Apr 2019 05:19:43 +0000 (05:19 +0000)]
Fix bugs on filters

Filters were not being invoked from providers.
Filter for getting latest version was filtering out everything
Filter on PDP state was not implemented.

Issue-ID: POLICY-1095
Change-Id: If43ce48a57b010e05f75db8cfa80e63f2719ace1
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoAdd unit tests for models-base 03/84403/1
liamfallon [Fri, 5 Apr 2019 21:19:37 +0000 (21:19 +0000)]
Add unit tests for models-base

Brings coverage in models-base up over 99%

Issue-ID: POLICY-1095
Change-Id: Ie1c9f3f132715275f44f349a415a8bb34a0115c9
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMissed simulator REST call SDNC 82/84382/1
Pamela Dragosh [Fri, 5 Apr 2019 18:10:33 +0000 (14:10 -0400)]
Missed simulator REST call SDNC

Forgot this as part of this review:
https://gerrit.onap.org/r/#/c/84338/

Issue-ID: POLICY-1264
Change-Id: I8b95cd43b593fd9a79c62b3398a5d44bb7b0c794
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoAdd undeploy response to models-pap 71/84371/2
Jim Hahn [Fri, 5 Apr 2019 17:01:47 +0000 (13:01 -0400)]
Add undeploy response to models-pap

Also modified toString() methods on other response classes to
invoke the super class' toString() so the error message is printed.

Change-Id: I7147da8acd521ed30d40aa6cbf2d8fd43715179b
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Complete filters for Database Fetches"
Pamela Dragosh [Fri, 5 Apr 2019 16:40:27 +0000 (16:40 +0000)]
Merge "Complete filters for Database Fetches"

5 years agoComplete filters for Database Fetches 06/84306/3
liamfallon [Fri, 5 Apr 2019 15:40:15 +0000 (15:40 +0000)]
Complete filters for Database Fetches

This review completes the implementaiton of the filters
for fetching policy types, policies, and PDP groups
from the database.

It also fixes bugs in Policy type creation.

Yaml in some of the policy type examples modified so that it is syntatically
correct.

Proeprties now stored as a blob in DB as they can be big.

Issue-ID: POLICY-1095
Change-Id: I6aef88ee2905afa58d778d82832f2b55d794fe9c
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoremove dependency of drool-application/yaml in actors 66/84066/4
ning.xi [Thu, 4 Apr 2019 02:55:50 +0000 (02:55 +0000)]
remove dependency of drool-application/yaml in actors

Issue-ID: POLICY-1264
Change-Id: Ie89749cf25d6880fd2884eb6935f36f046114b23
Signed-off-by: ning.xi <ning.xi@est.tech>
5 years agoMerge "move two modules from drools-application to models"
Jorge Hernandez [Fri, 5 Apr 2019 15:30:39 +0000 (15:30 +0000)]
Merge "move two modules from drools-application to models"

5 years agomove two modules from drools-application to models 63/84063/3
ning.xi [Wed, 3 Apr 2019 08:10:03 +0000 (16:10 +0800)]
move two modules from drools-application to models

Also removed reference to drools logging util.

Issue-ID: POLICY-1264
Change-Id: I7795f23b2b06fcb98f4099c3a6c303561a68e55f
Signed-off-by: ning.xi <ning.xi@est.tech>
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUpdate SDNC changes 38/84338/1
Pamela Dragosh [Fri, 5 Apr 2019 12:43:33 +0000 (08:43 -0400)]
Update SDNC changes

Per this review: https://gerrit.onap.org/r/#/c/83945/

Copying those changes into policy/models before removal
in drools-applications.

Issue-ID: POLICY-1264
Change-Id: I151816e78293af813d24ca1164ca364a3c54f87c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUpdates to models from scrum on 4/4 53/84253/5
Jim Hahn [Thu, 4 Apr 2019 15:20:42 +0000 (11:20 -0400)]
Updates to models from scrum on 4/4

Moved ToscaPolicyIdentXxx classes from models-pdp to models-tosca,
and added methods to retrieve them from a ToscaPolicy.

Removed version and instance fields from PdpStatus.

Chose to leave "description" field in the PAP/PDP messages.  The
PDPs can ignore them or leave them null.  In a PdpUpdate message,
the description will be the description associated with the PdpGroup.
In a PdpStatus message, the PDP could choose to provide a description
of the PDP, itself (or the type of PDP).
Added comments to that effect.

Moved name, group, and subgroup fields into PdpMessage.

Fixed typos in comments.
Updated licenses.
Change "long" to "Long" in PdpUpdate.
Use lombok @ToString instead of override.

Fixed merge conflict.

Change-Id: Icd928f9a7630b838ad4b0b5556e899dc21b7872b
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd filters on policy objects 62/84262/1
liamfallon [Thu, 4 Apr 2019 17:27:50 +0000 (17:27 +0000)]
Add filters on policy objects

I just raised this review to shwo where I'm going with the
filters. They are not complete yet.

Issue-ID: POLICY-1095
Change-Id: I7b602a32bb67159b893f3b3cefea5d88038c4e5f
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Add filter obejcts for concepts"
Pamela Dragosh [Thu, 4 Apr 2019 15:54:23 +0000 (15:54 +0000)]
Merge "Add filter obejcts for concepts"

5 years agoMerge "Add ApiModelProperty annotation to authorative models"
Pamela Dragosh [Thu, 4 Apr 2019 13:57:30 +0000 (13:57 +0000)]
Merge "Add ApiModelProperty annotation to authorative models"

5 years agoAdd filter obejcts for concepts 37/84237/1
liamfallon [Thu, 4 Apr 2019 12:16:12 +0000 (12:16 +0000)]
Add filter obejcts for concepts

This review:
- Fixes the bug in getting policies where the key fields were null
- Removes complex version checks from DAO interface
- Simplifies provider API by introducing filter objects for searches

Issue-ID: POLICY-1095
Change-Id: I5ab7471c03e8b61849e7882ed18541acd627dc39
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoAdd ApiModelProperty annotation to authorative models 65/84165/2
Chenfei Gao [Thu, 4 Apr 2019 01:37:23 +0000 (21:37 -0400)]
Add ApiModelProperty annotation to authorative models

Add @ApiModelProperty to authorative models for the fields
that have different serialized names from their property names.

Issue-ID: POLICY-1515
Change-Id: Id6509afe5cc741a6253fc0d1f98ae6b22d31f0d9
Signed-off-by: Chenfei Gao <cgao@research.att.com>
5 years agoUpdating PdpStatistics model 52/84152/1
ramverma [Wed, 3 Apr 2019 23:08:44 +0000 (23:08 +0000)]
Updating PdpStatistics model

Change-Id: Ic3ae28997dd1db14c16bdfd24a5d936393fa8da4
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
5 years agoMerge "Clean up models-pap based on updates to models-pdp"
Jorge Hernandez [Wed, 3 Apr 2019 21:14:05 +0000 (21:14 +0000)]
Merge "Clean up models-pap based on updates to models-pdp"

5 years agoMerge "Add impl of more PDP persistence"
Liam Fallon [Wed, 3 Apr 2019 20:11:58 +0000 (20:11 +0000)]
Merge "Add impl of more PDP persistence"

5 years agoClean up models-pap based on updates to models-pdp 27/84127/1
Jim Hahn [Wed, 3 Apr 2019 17:15:49 +0000 (13:15 -0400)]
Clean up models-pap based on updates to models-pdp

Change-Id: I5e55dd669200e4fc28f58379bbaa61e5d3331610
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd impl of more PDP persistence 17/84117/1
liamfallon [Wed, 3 Apr 2019 15:47:36 +0000 (15:47 +0000)]
Add impl of more PDP persistence

Add the implementation of more metods in the PDP provider.

Issue-ID: POLICY-1095
Change-Id: Ie02189cad7a262a453e1f731190525f838648401
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoChanging PAP model as per discussion 08/84108/1
ramverma [Wed, 3 Apr 2019 14:58:57 +0000 (14:58 +0000)]
Changing PAP model as per discussion

1) Changing PAP models to use ToscaPolicyIdentifier instead of actual
ToscaPolicy itself.
2) Deleting unused PdpHealthCheck message. As we decided to return heath
check based on DB state.
3) Updating PdpStatus message to use ToscaPolicyIdentifier instead of actual
ToscaPolicy itself. Pdp don't need to send the whole ToscaPolicy
everytime in heartbeat to PAP. Instead the identifier is sufficient.

Change-Id: I50ead8d8b6af118fd1da08071a2b0fc50584d4aa
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>