policy/models.git
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"

3 years agoMerge "Address sonar issues in policy/models"
Ajith Sreekumar [Fri, 4 Dec 2020 09:52:25 +0000 (09:52 +0000)]
Merge "Address sonar issues in policy/models"

3 years agoAdd generic methods to TOSCA providers and utils 80/116080/1
liamfallon [Thu, 3 Dec 2020 12:40:58 +0000 (12:40 +0000)]
Add generic methods to TOSCA providers and utils

Generic methods for getting ehtire service templates are added to the
TOSCA providers in models-tosca.

These are needed to read service tempaltes containing entities that are
not policy related.

Issue-ID: POLICY-2900
Change-Id: If4c646037f51f8a18b66257426accc330905acf9
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Remove unused imports"
Ajith Sreekumar [Thu, 3 Dec 2020 10:02:19 +0000 (10:02 +0000)]
Merge "Remove unused imports"

3 years agoAddress sonar issues in policy/models 45/116045/1
Jim Hahn [Wed, 2 Dec 2020 19:41:19 +0000 (14:41 -0500)]
Address sonar issues in policy/models

Addressed the following issues:
- unused parameter in method call
- make constructor of abstract class protected instead of public

Issue-ID: POLICY-2905
Change-Id: I1e846b88246796f1ad5cee4a3bd296647732fd24
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRemove unused imports 34/116034/1
liamfallon [Wed, 2 Dec 2020 16:39:47 +0000 (16:39 +0000)]
Remove unused imports

Issue-ID: POLICY-2900
Change-Id: Iaba37b81473b60d3da15a52ffcccdaa16a5b7091
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoMerge "Use common LocalDateTimeTypeAdaptor for SO"
Pamela Dragosh [Wed, 2 Dec 2020 14:09:03 +0000 (14:09 +0000)]
Merge "Use common LocalDateTimeTypeAdaptor for SO"

3 years agoMerge "Add extra authorative TOSCA concepts"
Liam Fallon [Wed, 2 Dec 2020 12:54:51 +0000 (12:54 +0000)]
Merge "Add extra authorative TOSCA concepts"

3 years agoAdd extra authorative TOSCA concepts 66/115166/3
liamfallon [Fri, 20 Nov 2020 10:24:44 +0000 (10:24 +0000)]
Add extra authorative TOSCA concepts

This review brings in extra TOSCA concepts for Node types, nodes, and
capabilities.

The TOSCA handling is also amended to make the handling of equality
consistent. Now, if filtering or ordering is required using an order
rather than natural ordering, a comparator must be supplied by the user.

Issue-ID: POLICY-2900
Change-Id: Ie40e86870b97eb993b1338bdc0666ac116f72f67
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoUse common LocalDateTimeTypeAdaptor for SO 78/115978/1
Jim Hahn [Mon, 30 Nov 2020 19:32:47 +0000 (14:32 -0500)]
Use common LocalDateTimeTypeAdaptor for SO

SO has its own specialized GSON type adapter.  Modified it to subclass
from the common type adapter.

Issue-ID: POLICY-2903
Change-Id: I578eecbb1a37b5c95c5c27e6deb5c9f72ca7ae28
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRemove targetEntity from makeOutcome 53/115553/1
Jim Hahn [Mon, 30 Nov 2020 16:02:31 +0000 (11:02 -0500)]
Remove targetEntity from makeOutcome

The Actor Params class had two flavors of makeOutcome, the second of
which took a "targetEntity" parameter.  As the Params no longer deal
directly with the targetEntity, the second flavor was removed.

Issue-ID: POLICY-2804
Change-Id: Ic736dd1c809ce54f6bb7cd37d03bc84cf4a1410c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoDelete preprocessed flag from actors 44/115044/4
Jim Hahn [Wed, 18 Nov 2020 15:44:41 +0000 (10:44 -0500)]
Delete preprocessed flag from actors

Removed the "preprocessed" flag from the Actor parameter class, now
that the actors no longer have a startPreprocess() method.

Also removed targetEntity from Actor parameter class.  Created a
makeOutcome method within OperationPartial, which is used to create an
initial outcome whose target field is pre-populated with the
target-entity extracted from the properties.  As the meaning of "target"
may be specific to an operation, the makeOutcome method may be
overridden by an operation subclass.

Issue-ID: POLICY-2804
Change-Id: Ifb66de63301d644e69340009593513773ee5672d
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Make Actors event-agnostic"
Ram Krishna Verma [Wed, 18 Nov 2020 15:27:45 +0000 (15:27 +0000)]
Merge "Make Actors event-agnostic"

3 years agoFix upcoming checkstyle issues 59/114659/2
Pamela Dragosh [Fri, 6 Nov 2020 13:16:56 +0000 (08:16 -0500)]
Fix upcoming checkstyle issues

When we upgrade to oparent, these will fail as oparent upgrades
to 8.37 of puppycrawl which fixes a few bugs that should have
flagged these previously.

Issue-ID: POLICY-2887
Change-Id: Ia0ceab23ff3d5c177f657c5852115ab1b265c698
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoMake Actors event-agnostic 75/111575/3
Jim Hahn [Fri, 21 Aug 2020 17:43:08 +0000 (13:43 -0400)]
Make Actors event-agnostic

Removed event and event-context code from the Actor code.  Also removed
the preprocessing steps from the Actor code, giving the application
complete control over any preprocessing.
Also fixed a bug wherein the APPC actor was treating the
AAI_RESOURCE_VNF property as a String instead of as a GenericVnf.

Issue-ID: POLICY-2746-actor
Change-Id: Ibc05fe39ffedc0bc461abf10e6a960861ac70119
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoPoint to snapshot versions 94/114294/1
Jim Hahn [Tue, 27 Oct 2020 18:16:29 +0000 (14:16 -0400)]
Point to snapshot versions

Issue-ID: POLICY-2875
Change-Id: Ifac2f1e3330f6cf3ce6225bbc960974c257805f5
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump models master to 2.4.0 SNAPSHOT 86/114286/1
Jim Hahn [Mon, 26 Oct 2020 20:53:04 +0000 (16:53 -0400)]
Bump models master to 2.4.0 SNAPSHOT

Bumping minor version now that guilin branch has been created.

Issue-ID: POLICY-2875
Change-Id: Iec7868062610a3acca6f883f999615ccc109f850
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump models to 2.3.6 snapshot 17/114017/1
Jim Hahn [Mon, 19 Oct 2020 20:05:49 +0000 (16:05 -0400)]
Bump models to 2.3.6 snapshot

Issue-ID: POLICY-2869
Change-Id: I98223c20d6d1d6d9bf5bd958d9d3ed4aacdf17e6
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease models 2.3.5 artifacts 11/114011/1 7.0.0-ONAP
Jim Hahn [Mon, 19 Oct 2020 17:41:14 +0000 (13:41 -0400)]
Release models 2.3.5 artifacts

Issue-ID: POLICY-2869
Change-Id: I920b1da9fb26f3cf12ea23775188aa33d8bc80ed
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Default should be an object on TOSCA properties"
Pamela Dragosh [Fri, 16 Oct 2020 13:32:46 +0000 (13:32 +0000)]
Merge "Default should be an object on TOSCA properties"

3 years agoDefault should be an object on TOSCA properties 12/113112/3
liamfallon [Thu, 24 Sep 2020 15:12:50 +0000 (16:12 +0100)]
Default should be an object on TOSCA properties

Property default value is serialized to the database as Yaml and
deserialized back into an object on a DB read.

Issue-ID: POLICY-2844
Change-Id: I69f2843a93cd5f831359a0965223298b769498d9
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoBug fixes and improvements in CDS Simulator 06/113806/4
a.sreekumar [Mon, 12 Oct 2020 16:22:32 +0000 (17:22 +0100)]
Bug fixes and improvements in CDS Simulator

1) CDS Simulator was not able to run alone. It needed one of the
RestServer simulators to start up to continue running. Providing the cds
simulators parameters alone in the config file was resulting in
termination of the Main process. This is fixed.

2) Response from the CDS Simuator when blueprint and action names are
unknown (in real cases, when a corresponding CBA is not uploaded to CDS) is updated to mimic an actual CDS response instead of always
returning a dummy success response.

Change-Id: I79a6d158addaad31649809006d1e3c1dfdb47a1f
Issue-ID: POLICY-2828
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoBump models to 2.3.5 39/113739/1
Jim Hahn [Fri, 9 Oct 2020 22:51:10 +0000 (18:51 -0400)]
Bump models to 2.3.5

Issue-ID: POLICY-2863
Change-Id: Iba0dfe78576a2ad1551c165e3b9f53fa3c55259a
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease models 2.3.4 artifacts 37/113737/1
Jim Hahn [Fri, 9 Oct 2020 22:30:33 +0000 (18:30 -0400)]
Release models 2.3.4 artifacts

Issue-ID: POLICY-2863
Change-Id: I5d523aaed4da8a2e97a2ef520cdac73b2351633a
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump models to 2.3.4 snapshot 33/113733/1
Jim Hahn [Fri, 9 Oct 2020 20:55:45 +0000 (16:55 -0400)]
Bump models to 2.3.4 snapshot

Issue-ID: POLICY-2863
Change-Id: I9d764a0cd695aa95a5880fd20b594e465d14c658
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease models 2.3.3 artifacts 31/113731/1
Jim Hahn [Fri, 9 Oct 2020 19:37:34 +0000 (15:37 -0400)]
Release models 2.3.3 artifacts

Issue-ID: POLICY-2863
Change-Id: I45e1de278f17fd3527cf700113ee0a879f4c90aa
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoSpecify "Accept" header in A&AI requests 25/113725/1
Jim Hahn [Fri, 9 Oct 2020 16:26:14 +0000 (12:26 -0400)]
Specify "Accept" header in A&AI requests

Modified the A&AI superclass to specify application/json for the Accept
header.  Removed the header from the subclasses.

Issue-ID: POLICY-2863
Change-Id: I90974e305cb36ee2fa01999be4d79225a510e55b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoBump models to 2.3.3 36/113636/2
Jim Hahn [Wed, 7 Oct 2020 19:32:22 +0000 (15:32 -0400)]
Bump models to 2.3.3

Issue-ID: POLICY-2839
Change-Id: Ifd7f45854904545b4f2973e1429cb791ac00b600
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease models 2.3.2 artifacts 26/113626/1
Jim Hahn [Wed, 7 Oct 2020 18:39:27 +0000 (14:39 -0400)]
Release models 2.3.2 artifacts

Issue-ID: POLICY-2839
Change-Id: Ib17668226d28bd966ddab5c583278e66bd61e321
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix parent package name in models simulator 19/113619/1
Jim Hahn [Wed, 7 Oct 2020 16:33:02 +0000 (12:33 -0400)]
Fix parent package name in models simulator

Stage release failed saying:
  Non-resolvable parent POM for
    org.onap.policy.models.sim:models-simulator-tarball

Fixed the name of the parent artifact in the package poms.

Issue-ID: POLICY-2839
Change-Id: I61c81133095d9dadd51d77d73ecfd1ef11695419
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "fix orphan module issue"
Jorge Hernandez [Wed, 7 Oct 2020 14:12:37 +0000 (14:12 +0000)]
Merge "fix orphan module issue"

3 years agoMerge "Adding basic logging to CDS Simulator"
Jorge Hernandez [Wed, 7 Oct 2020 14:10:40 +0000 (14:10 +0000)]
Merge "Adding basic logging to CDS Simulator"

3 years agoMerge "rename controller.controllerName to controller.name"
Jorge Hernandez [Wed, 7 Oct 2020 14:09:33 +0000 (14:09 +0000)]
Merge "rename controller.controllerName to controller.name"

3 years agoAdding basic logging to CDS Simulator 07/113607/2
a.sreekumar [Wed, 7 Oct 2020 10:26:37 +0000 (11:26 +0100)]
Adding basic logging to CDS Simulator

1) Adding log statements to capture actions taken by CDS Simulator.
2) Fixing the way CDSRequest input is read from a String. StandardCoder
decode method cannot directly decode from a String to protobuf type.

Change-Id: I597c64ffb095f6a518b0b6c67c1617ca789ad7d6
Issue-ID: POLICY-2828
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
3 years agoMerge "Don't always validate restServerParameters"
Jorge Hernandez [Tue, 6 Oct 2020 21:37:03 +0000 (21:37 +0000)]
Merge "Don't always validate restServerParameters"

3 years agofix orphan module issue 78/113578/3
Taka Cho [Tue, 6 Oct 2020 16:30:37 +0000 (12:30 -0400)]
fix orphan module issue

when running sonar:sonar
models-simulator-tarball" module
gets orphan module error

Issue-ID: POLICY-2859
Change-Id: I1d08a7ffadb7446c04fb62460e33ba3d2abffe6e
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agorename controller.controllerName to controller.name 80/113580/2
jhh [Tue, 6 Oct 2020 17:52:08 +0000 (12:52 -0500)]
rename controller.controllerName to controller.name

Issue-ID: POLICY-2860
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I097e15f5e6343b26bfb1afe69c530ce3142e18ec
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
3 years agoFix random failures in CdsSimulatorTest 86/113586/2
Jim Hahn [Tue, 6 Oct 2020 18:46:08 +0000 (14:46 -0400)]
Fix random failures in CdsSimulatorTest

Modified CdsSimulatorTest to allocate a unique server port for each
test.

Issue-ID: POLICY-2862
Change-Id: I4a7ed299c7458dade7444c6c8f2b476e24500dd4
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoDon't always validate restServerParameters 81/113581/3
Jim Hahn [Tue, 6 Oct 2020 17:50:36 +0000 (13:50 -0400)]
Don't always validate restServerParameters

Restored original validation code to DmaapSimParameterGroup so it works
as it originally worked (i.e., required "restServerParameters").
However, modified SimulatorParameters to validate the relevant fields
directly, rather than relying on DmaapSimParameterGroup.validate(), thus
eliminating all checks on "restServerParameters" when used within
SimulatorParameters.

Issue-ID: POLICY-2858
Change-Id: I9a09431ce3056a874bf2dba1c5bd6c418f37f69b
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Make simulator parameters optional"
Ajith Sreekumar [Tue, 6 Oct 2020 08:57:06 +0000 (08:57 +0000)]
Merge "Make simulator parameters optional"

3 years agoMake simulator parameters optional 40/113540/1
Jim Hahn [Mon, 5 Oct 2020 15:31:40 +0000 (11:31 -0400)]
Make simulator parameters optional

Modified the simulator to make the DMaaP and GRPC parameters optional so
that a simulator can be started without them.  Also added parameter
validation, as that was not being performed on the DMaaP or GRPC
parameters.  Also modified the validation so-as not to require the rest
server parameter field contained within the DMaaP parameter class.

Issue-ID: POLICY-2858
Change-Id: I85dde93c7baf863eca2cb10eab37806f3e08a087
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Log simulator output at INFO level"
Ram Krishna Verma [Mon, 5 Oct 2020 15:15:50 +0000 (15:15 +0000)]
Merge "Log simulator output at INFO level"

3 years agoLog simulator output at INFO level 98/113498/2
Jim Hahn [Fri, 2 Oct 2020 17:27:31 +0000 (13:27 -0400)]
Log simulator output at INFO level

The simulator is defaulting to DEBUG log level which generates too much
output to wade through.  Changing to INFO level and sending to stdout
for easier use in docker & kubernetes environments.

Issue-ID: POLICY-2742
Change-Id: I078a406d539068e25747a59955214c35fc31510e
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix eclipse/sonar warnings in models 95/113495/1
Jim Hahn [Fri, 2 Oct 2020 16:56:47 +0000 (12:56 -0400)]
Fix eclipse/sonar warnings in models

Addressed the following eclipse/sonar warnings:
- unused imports
- unchanged type
- unreachable "catch" block
- reinterrupt

Issue-ID: POLICY-2714
Change-Id: I2fe6011ec74b7fab8889050e5c83647ab034ea25
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Enhance gRPC Simulator:"
Ajith Sreekumar [Thu, 1 Oct 2020 11:44:39 +0000 (11:44 +0000)]
Merge "Enhance gRPC Simulator:"

3 years agoRemove Entity annotation from PfConceptContainer 89/113389/1
liamfallon [Wed, 30 Sep 2020 16:39:21 +0000 (17:39 +0100)]
Remove Entity annotation from PfConceptContainer

The PfConceptContainer class uses incompatible JPA anotations
@MappedSuperClass and @Entity are incompatible as a MappedSuperClass
cannot be an entity.

Eclipselink silently tolerates this incompatibility but Hibernate (used
in CLAMP) throws a build error on this class.

Issue-ID: POLICY-2851
Change-Id: I2fd3d9217dc00717f8f2471e4848d254e7726b11
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoEnhance gRPC Simulator: 54/113054/13
puthuparambil.aditya [Wed, 23 Sep 2020 11:39:46 +0000 (12:39 +0100)]
Enhance gRPC Simulator:

1.Make gRPC Simulator respond to different actions by generating the response on the basis of received request.
2.Include CDS Simulator in policy-models-simulator
3.Introduce a packages module in models-sim to package the docker image of policy-models-simulator which includes all the simulators(pdp-simulator to be added in future) in models.
4.The Jenkins job changes to push this newly created Docker image may be taken in the next release.

Issue-ID: POLICY-2828
Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca>
Change-Id: Ic1663bbe8205c64a8133ea0b0c28152f21d0732a

3 years agoMerge "Add DCAE policy types"
Liam Fallon [Mon, 28 Sep 2020 10:20:14 +0000 (10:20 +0000)]
Merge "Add DCAE policy types"

3 years agoupdate default keystores 25/113125/1
jhh [Thu, 24 Sep 2020 19:43:05 +0000 (14:43 -0500)]
update default keystores

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

3 years agoAdd DCAE policy types 06/113106/1
Pamela Dragosh [Thu, 24 Sep 2020 13:27:41 +0000 (09:27 -0400)]
Add DCAE policy types

These policy types were removed from SDC and added into policy.
They are legacy and will be determined later if they should be
permanently deleted or moved into use case code.

The default fields need to be changed because our TOSCA code
expects a string and does not recognize list.

Issue-ID: SDC-3229
Change-Id: I36a03032134d6d320d1a459cfe1d56ce6a702d5d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoUse latest alpine base image 71/112771/1
Jim Hahn [Wed, 16 Sep 2020 21:40:09 +0000 (17:40 -0400)]
Use latest alpine base image

Simulators are only used while testing, thus the version of the alpine
image need not be specified.  Removing the version from the Dockerfile
eliminates the need to update the Dockerfile every time the version
changes.

Issue-ID: POLICY-2819
Change-Id: Ie81079f4734b369eaf865c58d319b8244427207a
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRemove base64 encoding of password from models 49/112749/3
Ram Krishna Verma [Wed, 16 Sep 2020 14:21:36 +0000 (10:21 -0400)]
Remove base64 encoding of password from models

Remove base64 encoding of db password from models.
This will have impact on the defaultConfig of API & PAP component.
Seperate reviews are raised for those repos.

Issue-ID: POLICY-2550
Change-Id: I258f76d01c21893bb40b4095a82e56ed51bd1377
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
3 years agoBump models to 2.3.2 20/112320/1
Jim Hahn [Tue, 8 Sep 2020 18:28:58 +0000 (14:28 -0400)]
Bump models to 2.3.2

Issue-ID: POLICY-2789
Change-Id: I19b397ecb165bea30059142d9d4c5357ceba9825
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRelease 2.3.1 models 89/112289/1
Jim Hahn [Tue, 8 Sep 2020 17:40:08 +0000 (13:40 -0400)]
Release 2.3.1 models

Issue-ID: POLICY-2789
Change-Id: I2199abef6ff9e34f3bdcc0103c59e3d5a761df6c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse released versions 83/112283/1
Jim Hahn [Tue, 8 Sep 2020 15:03:36 +0000 (11:03 -0400)]
Use released versions

Issue-ID: POLICY-2789
Change-Id: I94e3a329499365465db9e5c81461570506f86620
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRevert "point to 2.1.0 policy-alpine base - model-sim" 00/112000/1
Jim Hahn [Fri, 4 Sep 2020 21:45:57 +0000 (21:45 +0000)]
Revert "point to 2.1.0 policy-alpine base - model-sim"

This reverts commit e46f74d64fe69d33d5038704b64993aa9cab59fc.

Reason for revert: some CSITs broken because the can't find the image

Issue-ID: POLICY-2789
Change-Id: Id6355c21789281a3f25467b3bd6e2e48d22533f5
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agopoint to 2.1.0 policy-alpine base - model-sim 69/112169/3
Taka Cho [Fri, 4 Sep 2020 12:58:25 +0000 (08:58 -0400)]
point to 2.1.0 policy-alpine base - model-sim

In G-rel, using 2.1.0 base.

Issue-ID: POLICY-2789
Change-Id: I165debaf20267c0b1c3141bff805a29595f1eccf
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoAdd new method to retrieve vnf-id 16/112016/4
Pamela Dragosh [Tue, 1 Sep 2020 20:38:15 +0000 (16:38 -0400)]
Add new method to retrieve vnf-id

For guard filters, once the vnf-id is found. Then this convenience
method helps to retrieve the correct vnf information.

Issue-ID: POLICY-2590
Change-Id: I0b55b15582ddc58bbc5b2c0c2c2b130f3cdc88c3
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Signed-off-by: Jim Hahn <jrh3@att.com>
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoMerge "Add Modify NSSI operation in SO actor"
Jim Hahn [Tue, 1 Sep 2020 16:15:55 +0000 (16:15 +0000)]
Merge "Add Modify NSSI operation in SO actor"

3 years agoAdd Modify NSSI operation in SO actor 35/111735/11
krishnaa96 [Wed, 26 Aug 2020 09:29:04 +0000 (14:59 +0530)]
Add Modify NSSI operation in SO actor

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

3 years agoDefault policies to usecases controller 51/111851/1
Jim Hahn [Fri, 28 Aug 2020 19:26:04 +0000 (15:26 -0400)]
Default policies to usecases controller

The example operation policies specify the "frankfurt" controller.
Modified them to specify the "usecases" controller instead.

Issue-ID: POLICY-2748
Change-Id: I468b43a80e09dd054ba3b8fa8dbc47c8d7efd548
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Remove commons-io dependency from models"
Jim Hahn [Fri, 28 Aug 2020 12:29:16 +0000 (12:29 +0000)]
Merge "Remove commons-io dependency from models"

3 years agoMerge "Remove Target and TargetType"
Jim Hahn [Fri, 28 Aug 2020 12:28:06 +0000 (12:28 +0000)]
Merge "Remove Target and TargetType"

3 years agoRemove commons-io dependency from models 15/111815/2
Jim Hahn [Thu, 27 Aug 2020 21:39:06 +0000 (17:39 -0400)]
Remove commons-io dependency from models

Issue-ID: POLICY-2798-commons-io
Change-Id: I2b2593b5f00aa73ea80fba6438c836e70f6ee45c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoRemove Target and TargetType 97/111797/5
Pamela Dragosh [Thu, 27 Aug 2020 12:44:12 +0000 (08:44 -0400)]
Remove Target and TargetType

The dependency should have been removed in the last review to
remove SDC and policy-yaml legacy code.

It was revealed that usage of TargetType and Type were spread out over the
actor code. Those fields are represented differently in the new
TOSCA Operational Policy Type, so fields were created to capture
those values to be used by actor code.

Issue-ID: POLICY-2428
Change-Id: Ib783526a518ca7942ae9e38019bd343639f4dd98
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
3 years agoFix random failures in dmaap-sim 91/111791/1
Jim Hahn [Thu, 27 Aug 2020 11:59:19 +0000 (07:59 -0400)]
Fix random failures in dmaap-sim

Modified the code to use a separate topic for the format tests, as well
as a separate consumer name for each test.

Issue-ID: POLICY-2749
Change-Id: Ia93f17109b761e98a4f676066024b51dd9024dc0
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Address more sonar issues in policy-models"
Pamela Dragosh [Wed, 26 Aug 2020 11:13:19 +0000 (11:13 +0000)]
Merge "Address more sonar issues in policy-models"

3 years agoMerge "update keystore cert"
Jorge Hernandez [Tue, 25 Aug 2020 23:32:27 +0000 (23:32 +0000)]
Merge "update keystore cert"