policy/drools-applications.git
5 years agoUpgrade drools-apps to 1.3.7 06/85506/1 casablanca 3.0.2-ONAP
Pamela Dragosh [Tue, 16 Apr 2019 12:43:25 +0000 (08:43 -0400)]
Upgrade drools-apps to 1.3.7

For Casablanca Maintenance Release 3.0.2 - keystore upgrade.

Issue-ID: POLICY-1649
Change-Id: If3c22bc5e7cabcd31c2803efc3ea727c443c5177
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUpgrade to release drools 32/82832/1 1.3.6
Pamela Dragosh [Wed, 20 Mar 2019 16:22:12 +0000 (12:22 -0400)]
Upgrade to release drools

When drools-pdp is released, this job will work.

Drools-pdp did not have fixes, it needs to have the same
groupid, artifactid for installation of drools-applications.

Drools-applications has fix for APPC LCM API payloads.

Change-Id: I0d84d6a99f7921255c55aad49b5d38946e12a08b
Issue-ID: POLICY-1607
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFix policy doesn't send payload to APPC 28/79928/1
Adam Wudzinski [Thu, 7 Mar 2019 17:07:07 +0000 (18:07 +0100)]
Fix policy doesn't send payload to APPC

Fix policy doesn't send payload to APPC using AppcLcm. Cassablanca Release.

Change-Id: I6e2186d3f83809e97811162b9cfdf6d20136fa6a
Issue-ID: POLICY-1522
Signed-off-by: awudzins <adam.wudzinski@nokia.com>
5 years agoUpgrade drools-apps to match policy/engine 56/79256/1
Pamela Dragosh [Wed, 27 Feb 2019 13:04:11 +0000 (08:04 -0500)]
Upgrade drools-apps to match policy/engine

Drools-pdp, drools-application and policy/engine must remain
in synch with version numbers.

Issue-ID: POLICY-1538
Change-Id: Iacd6660e641ca992afece358cfed7a50601c4b88
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMove to 1.3.5-SNAPSHOT version 74/75574/1 1.3.5 3.0.1-ONAP
Jorge Hernandez [Wed, 9 Jan 2019 17:09:36 +0000 (11:09 -0600)]
Move to 1.3.5-SNAPSHOT version

Change-Id: Ia4e86b6438f95b852b3ef003afa14d70fd0c9d32
Issue-ID: POLICY-1390
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
5 years agoMove to 1.3.4-SNAPSHOT 23/72723/1
Jorge Hernandez [Thu, 15 Nov 2018 03:46:22 +0000 (21:46 -0600)]
Move to 1.3.4-SNAPSHOT

Change-Id: I48aa7e4c9bd2acbc2aadd16d28a736a98b8f4c9d
Issue-ID: POLICY-1262
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
5 years agoFix guard history database configuration 53/72653/1
Jorge Hernandez [Wed, 14 Nov 2018 03:22:30 +0000 (21:22 -0600)]
Fix guard history database configuration

Change-Id: I70742b9be80a0b0f77730e2453f96f1d3e7826dd
Issue-ID: POLICY-1257
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
(cherry picked from commit d7d6d484486c106cf32345d53f301d29fb731a3e)

5 years agoClose timing loop-hole when YAML updated 74/72474/1
Jim Hahn [Wed, 7 Nov 2018 18:44:21 +0000 (13:44 -0500)]
Close timing loop-hole when YAML updated

Noticed when YAML updates are pushed close together that some
Params objects are deleted that should not be.  Fixed that by
eliminating the "active" list concept and only deleting a Params
object that has an associated cleaner.  If it has no cleaner,
then it can't be deleted, regardless of timing with rule updates.

Added more tests for rule updates, including cases to check
for event objects being retracted, as well as Params objects
being retracted when rules are deleted.

Change-Id: I6b744b29fca228022f43e9322ea149b16d097675
Issue-ID: POLICY-1248
Signed-off-by: Jim Hahn <jrh3@att.com>
(cherry picked from commit 6c72ec89f54bce0741350d3f299c5b441b4f60cc)

5 years agoUpgrade policy parent and common 19/72219/4 1.3.3
Pamela Dragosh [Thu, 8 Nov 2018 15:44:30 +0000 (10:44 -0500)]
Upgrade policy parent and common

Upgrading to policy parent 2.0.1 release and common
1.3.3 to fix dmaap license issue 1.1.9

Upgrading to drools-pdp release 1.3.3

Also upgrading to 1.3.3 SNAPSHOT for release.

Issue-ID: POLICY-1229
Change-Id: Iaf4b2126c1b708ccf9655e410831c78dc0249838
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoCleanup all Param objects when any rules change 51/71851/2
Jim Hahn [Sun, 4 Nov 2018 19:33:36 +0000 (14:33 -0500)]
Cleanup all Param objects when any rules change

Fix license date for new junit test.
Updated some comments.
Ensured different control loop names in different rule sets of new junit
test.
Used different mechanism for examining facts in new junit test.
Fixed typo in comment.
Changed the way new junit checks for existence of facts.
Fixed another typo in comment.
Updated clean-up rules in CLC template and added junit test to verify
that Params are cleaned up appropriately.
Removed code that retracts $manager objects so that the manager clean-up
rule will be used, instead, thus ensuring that all associated objects are
deleted when the manager is deleted.  This was done for amsterdam, CLC,
and casablanca templates.
Added an extra fireAllRules() after calls to fireUntilHalt() to enable
clean-up rules to fire in junit tests.
Address Josh's review comments.
Enhance junit test to compare actual object references to ensure that
Param objects are as expected.

Change-Id: If1fefd3f57e417180c62a3849defbaa6ae83afc1
Issue-ID: POLICY-1248
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Upgrade to released 1.3.2 artifacts" into casablanca
Jorge Hernandez [Mon, 5 Nov 2018 16:32:24 +0000 (16:32 +0000)]
Merge "Upgrade to released 1.3.2 artifacts" into casablanca

5 years agoUpgrade to released 1.3.2 artifacts 49/71849/1
Pamela Dragosh [Mon, 5 Nov 2018 14:49:06 +0000 (09:49 -0500)]
Upgrade to released 1.3.2 artifacts

These artifacts are released, so we will point to them.

Issue-ID: POLICY-1245
Change-Id: Ib4b386a66552eb2f21c5eba29b8bf5c1b50db378
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoChanged actor from "MSO" to "SO" 40/71840/1
Jim Hahn [Thu, 1 Nov 2018 13:15:41 +0000 (09:15 -0400)]
Changed actor from "MSO" to "SO"

Also added "VF Module Delete" to the list of recipes for "SO" accepted
by the compiler.
Removed "AOTS" and "SDNO" from the list of accepted actors, as code does
not exist for those actors.
Update remaining actors and recipes.  Left "AAI" in the list for now,
though it has no recipes listed (and no actor.aai code).
Also removed "AAI" from the list of accepted actors.

Change-Id: I9db56715d8bea3cf86d2112df1e0086777863192
Issue-ID: POLICY-1239
Signed-off-by: Jim Hahn <jrh3@att.com>
(cherry picked from commit af77c268e44da5c6e170a502b7252e5d2ac80727)

5 years agoMerge "Upgrade xacml 1.0.2" into casablanca
Jorge Hernandez [Sat, 3 Nov 2018 15:07:45 +0000 (15:07 +0000)]
Merge "Upgrade xacml 1.0.2" into casablanca

5 years agoRe-added requestParams to vDNS policy 71/71771/1
Jim Hahn [Fri, 2 Nov 2018 18:19:30 +0000 (14:19 -0400)]
Re-added requestParams to vDNS policy

Undo inadvertent change to compiler test.

Change-Id: I1973612f4783936271c3fd74fb978a4f263a14a9
Issue-ID: POLICY-1240
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoUpgrade xacml 1.0.2 57/71757/1
Pamela Dragosh [Fri, 2 Nov 2018 15:09:14 +0000 (11:09 -0400)]
Upgrade xacml 1.0.2

This version of xacml only has license changes to the java
source files. This will clear ONAP license issues.

Issue-ID: POLICY-1228
Change-Id: Ieaff4d52c8046fee8357f7ebc907f2643d77322c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
(cherry picked from commit 27ee507f93aae7519f2e0b75a0ceeadf00bfd837)

5 years agoRemove single quotes from casablanca template 05/71605/1
Jim Hahn [Thu, 1 Nov 2018 00:47:41 +0000 (20:47 -0400)]
Remove single quotes from casablanca template

The shell scripts used to populate the operational policies for
the casablanca template do not work if the yaml includes single
quotes.  Replaced the single quotes with %27 instead.

Change-Id: I31b20708b69153ecb67b7ac8136f464dbf2ce0c6
Issue-ID: POLICY-1240
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Added config params to scale-out policy" into casablanca
Pamela Dragosh [Thu, 1 Nov 2018 00:44:12 +0000 (00:44 +0000)]
Merge "Added config params to scale-out policy" into casablanca

5 years agoMerge "Add /serviceInstances/ to SO URL for scale-out" into casablanca
Pamela Dragosh [Thu, 1 Nov 2018 00:43:14 +0000 (00:43 +0000)]
Merge "Add /serviceInstances/ to SO URL for scale-out" into casablanca

5 years agoRemove openecomp repo from pom 67/71467/2
Jim Hahn [Tue, 30 Oct 2018 13:28:15 +0000 (09:28 -0400)]
Remove openecomp repo from pom

Change-Id: I896084627d9f3b726b543db87dbb6e30cf7922ef
Issue-ID: POLICY-1231
Signed-off-by: Jim Hahn <jrh3@att.com>
(cherry picked from commit a492781caecb83d326c4b1ffafcfbeabaf0bc6eb)

5 years agoAdded config params to scale-out policy 00/71600/2
Jim Hahn [Wed, 31 Oct 2018 23:19:02 +0000 (19:19 -0400)]
Added config params to scale-out policy

Removed requestParameters and reverted name.

Change-Id: Ia3470a751b22375206c571204eff8985e630e05f
Issue-ID: POLICY-1240
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd /serviceInstances/ to SO URL for scale-out 95/71595/1
Jim Hahn [Wed, 31 Oct 2018 22:09:19 +0000 (18:09 -0400)]
Add /serviceInstances/ to SO URL for scale-out

Also reformatted line that was subsequently too long.

Change-Id: I5c634c5157f18de64d37a0f451cd65f3002f35d3
Issue-ID: POLICY-1238
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoStep version for Casablanca support 66/71566/3
liamfallon [Wed, 31 Oct 2018 16:45:05 +0000 (16:45 +0000)]
Step version for Casablanca support

Issue-ID: POLICY-1233
Change-Id: Ibe63bee81db2427d07ec97db601083ed1a0423cd
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
5 years agoFix refering to snapshot in drools-application 28/71228/1 1.3.1
ramverma [Thu, 25 Oct 2018 10:59:09 +0000 (11:59 +0100)]
Fix refering to snapshot in drools-application

Issue-ID: POLICY-1213
Change-Id: I91e4928e33d4e39286bf340e42602890446d9401
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
5 years agoAdd CCVPN policy 10/70710/3
Vidyashree Rama [Thu, 18 Oct 2018 06:15:52 +0000 (11:45 +0530)]
Add CCVPN policy

CCVPN policy

Issue-ID: POLICY-1209

Change-Id: I8adea233f8672c9ff43b4a169b50336d9e43c91d
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
5 years agoAdd missing SDNC and fix JUnit 89/70089/2 1.3.0
Pamela Dragosh [Tue, 9 Oct 2018 16:36:01 +0000 (12:36 -0400)]
Add missing SDNC and fix JUnit

Identified in prior review, ensure all the new actors are
in the appropriate pom.xml and minor fix to JUnit for
assertEquals vs assertTrue.

Issue-ID: POLICY-1191
Change-Id: I5c7505ad795e6e19c99a3aa9cec7ecf688da8316
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Add implementation for OOF PCI use case"
Pamela Dragosh [Tue, 9 Oct 2018 16:29:50 +0000 (16:29 +0000)]
Merge "Add implementation for OOF PCI use case"

5 years agoAdd implementation for OOF PCI use case 52/70052/1
Saravanan A [Tue, 9 Oct 2018 10:50:52 +0000 (16:20 +0530)]
Add implementation for OOF PCI use case

Receive DMaaP message from PCI-Handler MS with PCI Config
change recommendations through DCAE_CL_OUTPUT topic.

Trigger SDN-R (if allowed by policy) by sending
DMaaP request through SDNR-CL topic.

When the response is received from SDNR through
SDNR-CL-RSP topic, just parse and print.

Code review comments addressed
Added controller changes into amsterdam too.

Change-Id: I93e54d3f44b4266092931a5f05b766cc26f2a869
Issue-ID: POLICY-1089
Signed-off-by: Saravanan A<saravanan.a75@wipro.com>
5 years agoRemove unused endpoint dependency 34/70034/1
Pamela Dragosh [Tue, 9 Oct 2018 00:53:48 +0000 (20:53 -0400)]
Remove unused endpoint dependency

This should have been cleaned out when we moved the code into
policy/common. The release job fails since it looks for a
non-existent release artifact for this.

Issue-ID: POLICY-1189
Change-Id: I46c95166ae47cf955cd43f0ce4af8dd40c0251fe
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoAdd new actor SDNC to support CCVPN Closed Loop 89/69689/5
Xin Miao [Mon, 1 Oct 2018 23:09:24 +0000 (18:09 -0500)]
Add new actor SDNC to support CCVPN Closed Loop

Issue-ID: POLICY-1183
Change-Id: I1b77b5b9cefca104382d9d84dd00bbd63b20e0f2
Signed-off-by: Xin Miao <xin.miao@huawei.com>
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFixing sonar issues 77/69677/4
Pamela Dragosh [Tue, 2 Oct 2018 13:50:57 +0000 (09:50 -0400)]
Fixing sonar issues

Some trivial functional interface and ordering.

Added some missing JUnit tests.

Issue-ID: POLICY-1129
Change-Id: Iad6fe757a40819ca39e007b41dae1bf4b3f6cc0c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Fix remaining sonar"
Pamela Dragosh [Tue, 2 Oct 2018 13:09:46 +0000 (13:09 +0000)]
Merge "Fix remaining sonar"

5 years agoFix remaining sonar 44/69644/1
Pamela Dragosh [Tue, 2 Oct 2018 00:42:36 +0000 (20:42 -0400)]
Fix remaining sonar

Mostly moving variables to their right spot.

Issue-ID: POLICY-1129
Change-Id: Iccc084bbb404ffd51bdd0b26b5f8c373c6142fb1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Add sdnr actor to archetype"
Liam Fallon [Fri, 28 Sep 2018 11:06:43 +0000 (11:06 +0000)]
Merge "Add sdnr actor to archetype"

5 years agoMerge "Yet more sonar issues in drools-applications"
Pamela Dragosh [Fri, 28 Sep 2018 08:07:13 +0000 (08:07 +0000)]
Merge "Yet more sonar issues in drools-applications"

5 years agoMerge "Fix more sonar issues"
Jorge Hernandez [Fri, 28 Sep 2018 02:54:50 +0000 (02:54 +0000)]
Merge "Fix more sonar issues"

5 years agoAdd sdnr actor to archetype 27/69427/1
Pamela Dragosh [Thu, 27 Sep 2018 23:27:03 +0000 (19:27 -0400)]
Add sdnr actor to archetype

The casablanca template had the declaration. I made
sure the declarations were in the same place.

Issue-ID: POLICY-1155
Change-Id: Ie5ab7a04ffc0c3fefbc3edcea9e7a02a062f0dbe
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFix more sonar issues 77/69377/3
Pamela Dragosh [Thu, 27 Sep 2018 16:28:19 +0000 (12:28 -0400)]
Fix more sonar issues

Most of these are minor issues along with a few others.
They have been bugging me so I thought I would get them
done. Some also do not show up on sonarlint.

Issue-ID: POLICY-1129
Change-Id: I31f2765f6babdfa80b23f0589daacc98da8d2002
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoYet more sonar issues in drools-applications 23/68523/7
Joshua Reich [Fri, 21 Sep 2018 23:44:25 +0000 (16:44 -0700)]
Yet more sonar issues in drools-applications

removed unused imports and variable definitions
moved variable declarations above methods
refactored deeply nested if/while
removed code smell due to unecessary use of static keyword
moved string literals to left side of comparator
fixed logging of exceptions
immediately return expression instead of assigning it to the temporary variable

Change-Id: Idfd2a2bdf3c2f3bbfcb54a06b713d57bc867b3ab
Issue-ID: POLICY-1129
Signed-off-by: Joshua Reich <jreich@research.att.com>
5 years agoMerge "Use powermock artifacts from parent pom"
Jorge Hernandez [Thu, 27 Sep 2018 14:33:53 +0000 (14:33 +0000)]
Merge "Use powermock artifacts from parent pom"

5 years agoFix for checkstyle declarations 53/69153/3
Pamela Dragosh [Wed, 26 Sep 2018 17:53:38 +0000 (13:53 -0400)]
Fix for checkstyle declarations

I found the problem with policy-yaml. An exception was
occuring due to an extra line between an @return for
javadoc vs. just printing a warning.

See: https://github.com/checkstyle/checkstyle/issues/2398

I also messed up some of the other declarations in the
sub-modules.

Copyright

Issue-ID: POLICY-1153
Change-Id: I848e0b19340d494775e161bab86ffb60a97d83ab
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUse powermock artifacts from parent pom 65/69165/1
Jim Hahn [Wed, 26 Sep 2018 14:41:48 +0000 (10:41 -0400)]
Use powermock artifacts from parent pom

Change-Id: I0b4f22e2bab30daee9efb12e6de427a93db8ae84
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoFix sonar critical 35/68835/3
Pamela Dragosh [Tue, 25 Sep 2018 10:47:53 +0000 (06:47 -0400)]
Fix sonar critical

Sonar complains that the password is an actual password when
in fact we are doing exactly the fix they suggest.

I seem to not have access to resolve it as a false positive.
So it seems the better way to do this is rename this to
reflect that it is actually a property value.

Had to also address 120> due to new variable name size.

Issue-ID: POLICY-1135
Change-Id: I2e2a36ed8d7f5c95e912df4f6ed74983cee8a3dd
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoFix checkstyle declarations 25/68525/8
Pamela Dragosh [Sat, 22 Sep 2018 00:08:11 +0000 (20:08 -0400)]
Fix checkstyle declarations

I fixed what I thought would be tolerable for this release.
Same issue as policy/common I had to defined the checkstyle
in each repo where the suppressions were needed.

Issue-ID: POLICY-1135
Change-Id: I8f30bee7e9cddc692ddad3cf88acedb2e6b4781b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agomore sonar issues in drools-applications 93/68493/4
Jim Hahn [Fri, 21 Sep 2018 20:55:04 +0000 (16:55 -0400)]
more sonar issues in drools-applications

Modified SO code to not return null lists for various buildXxxParam
methods.
Fixed commit message.
Added additional junit coverage to SO code.
Added additional junit coverage to SO code - cover more error cases.
Extracted another constant.

Change-Id: I65a27f2a1af1cfd8dd98bddab9ca1e862a3fa6fb
Issue-ID: POLICY-1129
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agonew sonar issues in drools-applications 23/68423/3
Jim Hahn [Fri, 21 Sep 2018 13:31:25 +0000 (09:31 -0400)]
new sonar issues in drools-applications

Don't return null lists from AAI.
Transient TargetLock.
Extract aai.url, et. al., constants.
Don't allocate extra unneeded variable.
Re-order fields in xacml attributes.
Extract "vserver" constant from simulator.
Replace thread sleep with join.

Change-Id: Iee1bd182862632af1f131cca5db5b526f5865b9f
Issue-ID: POLICY-1129
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd demo for Control Loop Coordination. 73/66773/2
Joshua Reich [Fri, 14 Sep 2018 18:38:01 +0000 (11:38 -0700)]
Add demo for Control Loop Coordination.

New PipEngine and Junit test added to guard.
Also bug in existing Junit test fixed.

All other code added to new directory template.demo.clc

Change-Id: Ida2267528bcb9404dc59ff391d45797b591814cc
Issue-ID: POLICY-1109
Signed-off-by: Joshua Reich <jreich@research.att.com>
5 years agoMerge "remove volumeGroup from SO request"
Pamela Dragosh [Mon, 17 Sep 2018 20:53:28 +0000 (20:53 +0000)]
Merge "remove volumeGroup from SO request"

5 years agopush-policies https for casablanca controller 19/67119/1
Jorge Hernandez [Mon, 17 Sep 2018 20:31:03 +0000 (15:31 -0500)]
push-policies https for casablanca controller

https support for provisioning policies in
experimental casablanca controller

Change-Id: Ica711c10298f49b072c6a4f29a889e27cb851275
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Issue-ID: POLICY-1120

5 years agoremove volumeGroup from SO request 91/67091/2
Jim Hahn [Mon, 17 Sep 2018 19:09:23 +0000 (15:09 -0400)]
remove volumeGroup from SO request

After a new round of discussion with the SO team, it was learned that
the SO scale-out request should NOT include the volumeGroup in
relatedInstanceList[0]; that item should be eliminated altogether.
Re-ordered some imports.
Updated license date.
Left volumeGroup in TestDemo, as it's a pseudo VID request.

Change-Id: I94e82b7e8fe6a41695b99888f291e24b7103687d
Issue-ID: POLICY-962
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Option to disable target locking. Needed by CLC."
Pamela Dragosh [Mon, 17 Sep 2018 15:51:05 +0000 (15:51 +0000)]
Merge "Option to disable target locking. Needed by CLC."

5 years agoMerge "Fixed sonar code smell"
Liam Fallon [Mon, 17 Sep 2018 13:16:20 +0000 (13:16 +0000)]
Merge "Fixed sonar code smell"

5 years agoFixed sonar code smell 63/66863/1
Piyush Garg [Mon, 17 Sep 2018 02:46:56 +0000 (08:16 +0530)]
Fixed sonar code smell

removed unused method parameter aaiResponseWrapper from
constructDeleteRequest

Change-Id: Ie434130b040732ed4e656c5592fff5b049695d29
Issue-ID: POLICY-1079
Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
5 years agofix NPE from rule timers 53/66753/2
Jim Hahn [Fri, 14 Sep 2018 20:30:51 +0000 (16:30 -0400)]
fix NPE from rule timers

This problem occurs in rules that have "timer(expr)" expressions before
the "when" clause.  If a working memory element, other than the timer
object, appears in the "when" clause and is updated BY ANY RULE, then
an NPE is thrown.  The solution is to segregate the objects so that
rules having "timer(expr)" expressions only refer to one object, the
XxxTimer object.  In particular, the rule simply sets an "expired" flag
in the XxxTimer object and then all other rules check that flag, rather
than having their own "timer(expr)" expressions.

Corrected comment associated with rule TIMER.FIRED.

Change-Id: I9e6c20ee46af99234daee8ece4862edbd41ba714
Issue-ID: POLICY-1106
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoOption to disable target locking. Needed by CLC. 85/66485/3
Joshua Reich [Thu, 13 Sep 2018 21:24:43 +0000 (14:24 -0700)]
Option to disable target locking. Needed by CLC.

When used, the ControlLoopEventManager will set useTargetLock to false
converting TargetLock lock/unlock operations to no-ops.

Allows CLC-specified logic to coordinate closed loops instead
of hard-coded mutual-exclusion enforced by target locking.

Change-Id: Ic067c1e1ce47b12d12742ed4bc04d59aa42751d6
Issue-ID: POLICY-953
Signed-off-by: Joshua Reich <jreich@research.att.com>
5 years agoimplement Serializable in additional classes 39/66239/1
Jim Hahn [Wed, 12 Sep 2018 22:01:03 +0000 (18:01 -0400)]
implement Serializable in additional classes

Change-Id: I5d5acb9d71dc49eaa9fb397da5988ba3d8bd5f1d
Issue-ID: POLICY-1106
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd implementation for OOF PCI use case 19/65519/7
Saravanan A [Mon, 10 Sep 2018 12:01:33 +0000 (17:31 +0530)]
Add implementation for OOF PCI use case

Receive DMaaP message from PCI-Handler MS with PCI Config
change recommendations through DCAE_CL_OUTPUT topic.

Trigger SDN-R (if allowed by policy) by sending
DMaaP request through SDNR-CL topic.

When the response is received from SDNR through
SDNR-CL-RSP topic, just parse and print.

Code review comments addressed

Change-Id: If340a23ae18367b7f98e31fe79c09a09e645b2ad
Issue-ID: POLICY-1089
Signed-off-by: Saravanan A<saravanan.a75@wipro.com>
5 years agodisable http for drools apps using dmaap 55/65655/1
Jorge Hernandez [Tue, 11 Sep 2018 05:05:53 +0000 (00:05 -0500)]
disable http for drools apps using dmaap

per security guidelines ..

Change-Id: I1db4468f20c3bd22a9e5f27fefcb76b55a3b6d89
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Issue-ID: POLICY-1105

5 years agoAdded min and max vnf count support 61/65561/4
Michael Mokry [Fri, 7 Sep 2018 21:46:20 +0000 (16:46 -0500)]
Added min and max vnf count support

Added variables for min and max with associated Constructor,  getters and setters
We will need to merge this commit before merging the policy/engine
commit to avoid compilation errors in policy/engine build

Made changes to address Jim Hahn's comments

Change-Id: I45357077cfe046028adcc0033ecf29f8cc1a525b
Issue-ID: POLICY-1038
Signed-off-by: Mike Mokry <mm117s@att.com>
5 years agoFix new sonar issue with vfModuleItem 15/65115/4
Piyush Garg [Fri, 7 Sep 2018 03:41:00 +0000 (09:11 +0530)]
Fix new sonar issue with vfModuleItem

find the last non-base vf module item from AAI response and use the same
to construct create or delete vf module SO request

Change-Id: I3b9b97ac3008f6e4f7952662d9e4262f77dbeec4
Issue-ID: POLICY-1079
Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
5 years agoMerge "Added support for VF Module Delete recipe"
Pamela Dragosh [Thu, 6 Sep 2018 00:27:03 +0000 (00:27 +0000)]
Merge "Added support for VF Module Delete recipe"

5 years agoMerge "Added junit test for commitAbatement."
Jorge Hernandez [Wed, 5 Sep 2018 20:08:42 +0000 (20:08 +0000)]
Merge "Added junit test for commitAbatement."

5 years agoAdd appc lcm request formatter 57/63957/7
Gabriel [Fri, 31 Aug 2018 09:20:43 +0000 (11:20 +0200)]
Add appc lcm request formatter

Formatter is used to dash case recipe in URL and camel case it in body.

Issue-ID: POLICY-1083

Change-Id: I908ae93665f3d069b3a032ae378b7775ebe1110a
Signed-off-by: Gabriel <adam.krysiak@nokia.com>
5 years agoAdded junit test for commitAbatement. 37/61437/5
Joshua Reich [Sun, 19 Aug 2018 07:57:54 +0000 (00:57 -0700)]
Added junit test for commitAbatement.

Change-Id: Iee71481e357861618bed068f8b8ef37ec0ea2ab8
Issue-ID: POLICY-975
Signed-off-by: Joshua Reich <jreich@research.att.com>
5 years agoAdded support for VF Module Delete recipe 33/63433/7
Piyush Garg [Wed, 29 Aug 2018 10:10:53 +0000 (15:40 +0530)]
Added support for VF Module Delete recipe

Enhanced SOActorServiceProvider to support VF Module Delete Recipe.
Added SOOperationType enum to map the policy recipe with the SO API that
we want to call for a recipe. vf module id from non-base vf module is
used to construct the delete request url and same will be deleted.

Updated SOManager so that it sends request to SO based on the
SOOperationType enum value.

Enhanced RESTManager to add support for the http delete using new class
HttpDeleteWithBody (to allow pass the payload to the SO delete VF module API).

Change-Id: I15b678ed9ebc85dfa7cb62bbf23e41c0fe6e4c69
Issue-ID: POLICY-1079
Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
5 years agopass VF count to guard for scale-out 71/64071/2
Jim Hahn [Fri, 31 Aug 2018 20:26:05 +0000 (16:26 -0400)]
pass VF count to guard for scale-out

Also updated license dates.
Fixed new checkstyle errors.

Change-Id: Ia6153814c4333724185918f76be560aba5a52f96
Issue-ID: POLICY-1084
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd code to store abatement events. 35/61435/5
Joshua Reich [Tue, 14 Aug 2018 22:04:03 +0000 (15:04 -0700)]
Add code to store abatement events.

Stores abatement events in history DB.

Change-Id: Ifca6acd42cd9eea85e27765bd268a491028e305a
Issue-ID: POLICY-975
Signed-off-by: Joshua Reich <jreich@research.att.com>
5 years agoFix remaining checkstyle 57/63457/6
Pamela Dragosh [Wed, 29 Aug 2018 11:58:53 +0000 (07:58 -0400)]
Fix remaining checkstyle

Lots of formatting, missing javadoc, distance from use,
imports must be explicit, ordering of methods.

Fixed some abbreviation problems in classes and renamed
JUnit tests to fix this.

Issue-ID: POLICY-883
Change-Id: I8494f63d88d63c0232aca97f7bcc848816228fb1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoRemove overriding dependencies warnings 95/63295/4
Pamela Dragosh [Tue, 28 Aug 2018 15:57:33 +0000 (11:57 -0400)]
Remove overriding dependencies warnings

With the move to oparent for dependencies, there are still
some warnings in the pom's for overriding managed dependencies.

Issue-ID: INT-619
Change-Id: I7ea771cc4536d8dfc77b4d1717e59cf6bfcfcda9
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "use new SO API for scale-out"
Pamela Dragosh [Tue, 28 Aug 2018 15:22:22 +0000 (15:22 +0000)]
Merge "use new SO API for scale-out"

5 years agouse new SO API for scale-out 49/63149/3
Jim Hahn [Mon, 27 Aug 2018 19:32:14 +0000 (15:32 -0400)]
use new SO API for scale-out

Updated licenses and serialization IDs.
Moved hashCode() and equals() methods to be in same location as in the
original code so it can be more easily compared.
Changed vDNS yaml timeout and retry to 1200 and 0, respectively, to match
the original values.
Removed extra newline from yaml, to match original yaml.
Reformatted source to wrap lines at 120 characters and removing trailing
white space.

Change-Id: I3f5e59a1f44750347de49164f587d4ffefdee8b4
Issue-ID: POLICY-962
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoChange parent to policy/parent 71/63271/2
Pamela Dragosh [Tue, 28 Aug 2018 13:57:31 +0000 (09:57 -0400)]
Change parent to policy/parent

Should be pointing to policy/parent rather than oparent
directly. This will automatically support upgrades more
easily. Also removing duplicated managed version override
warnings from Maven.

This is continuing work to support the integration effort
to consolidate common versions of java dependencies across
all projects.

Issue-ID: INT-619
Change-Id: I37ac20e669262d9ac8fff09fd1ac540190b47a30
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agouse new vf-walk code in SO request 93/62393/2
Jim Hahn [Fri, 24 Aug 2018 18:00:30 +0000 (14:00 -0400)]
use new vf-walk code in SO request

Methods were added to AaiNqResponseWrapper to extract VF modules
and generate the new VF module name.  This step modifies the SO
code to use those methods.  It was also determined that the SO
code needs the VF module container object, not just the VF module,
itself.  As a result, AaiNqResponseWrapper was modified to return
a list of the containers instead of a list of the VF modules.

Also modified the AAI simulator to return two VF modules in the
response to the vserver named query.  As part of that, a method
was added to the simulator so that JSON responses can be read from
files rather than having to convert them to Java Strings.

Modified simulator to work even if vnf-id is null.

Change-Id: I68fdf07ea80ee0daf9e16403e35b11710315a8a8
Issue-ID: POLICY-1037
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agowalk VF module names 05/62205/7
jh7358 [Thu, 23 Aug 2018 21:00:50 +0000 (17:00 -0400)]
walk VF module names

Added code to walk the VF modules to count the number of modules and
to generate the new module instance name.
Added comment to test method.
Fix checkstyle errors.
Read json files instead of resources.
Removed checkstyle plugin from aai pom, as it continues to barf every
time I use some automated feature of Eclipse.
Use Files.readAllBytes() instead of IoUtils.toString(uri).
Try concatenating file path.
Turned out to be a problem with file name case sensitivity - renamed
the file.

Change-Id: I1ce98d846dfa1d29e109b161c869108425d29771
Issue-ID: POLICY-1037
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agomove AAI named query 73/61673/2
Jim Hahn [Tue, 21 Aug 2018 19:54:11 +0000 (15:54 -0400)]
move AAI named query

The AAI vserver named-query was being done as a preliminary step for the
SO request.  However, it will now be needed during the guard query, which
happens much earlier.  Thus it has been moved from the SO classes into
the event manager class, where it is retrieved in a lazy fashion and
cached.
Also removed some trailing white space.
Update licenses.
Make test method private.

Change-Id: Id7353a2e0f2d42601d5142cb92961528fa21aa94
Issue-ID: POLICY-1011
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agofix new sonar issues with prov-status check 63/60963/3
Jim Hahn [Thu, 16 Aug 2018 18:57:15 +0000 (14:57 -0400)]
fix new sonar issues with prov-status check

Changes made while adding the prov-status check triggered some sonar
thresholds in ControlLoopEventManager.  Updated the code to resolve
them.  One of the changes that had been introduced was to check for
the existence of both the is-closed-loop-disabled AND the prov-status
fields.  However, if one is there then the other should be there, thus
the second check is redundant and was removed, which should reduce the
cyclomatic complexity back under the threshold.
Re-ordered the code a little, to make it less ambiguous.
Removed trailing white space.

Change-Id: If0ce74cedbf947c32cae3df3374cda6ba1305cd2
Issue-ID: POLICY-964
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoadd prov-status check to AAI queries 01/60801/2
Jim Hahn [Wed, 15 Aug 2018 20:34:02 +0000 (16:34 -0400)]
add prov-status check to AAI queries

Also had to add prov-status field to AaiGetVnfResponse class.
Removed bogus comment from test.
Verify response is not null in test.
Verify no requery by vnf name in test.
Add prov-status to template.demo tests.
Add prov-status to sample json for archetype-cl's.

Change-Id: I3f36a2bb6de8265ce5b10103690d6d8813c15b1a
Issue-ID: POLICY-964
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Fix checkstyle issues"
Jorge Hernandez [Wed, 15 Aug 2018 18:11:01 +0000 (18:11 +0000)]
Merge "Fix checkstyle issues"

5 years agoMerge "update AAI response classes per API"
Pamela Dragosh [Wed, 15 Aug 2018 15:20:09 +0000 (15:20 +0000)]
Merge "update AAI response classes per API"

5 years agoFix checkstyle issues 97/60597/1
Pamela Dragosh [Tue, 14 Aug 2018 18:22:34 +0000 (14:22 -0400)]
Fix checkstyle issues

Spacing, missing javadoc

Issue-ID: POLICY-883
Change-Id: Ice65c6c1baf0bb7c6273411f078bacfe3496b89b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoupdate AAI response classes per API 91/60091/2
Jim Hahn [Fri, 10 Aug 2018 22:16:21 +0000 (18:16 -0400)]
update AAI response classes per API

Several of the AAI response classes did not match the new AAI
interface.  Updated AaiGetVnfResponse and AaiGetVserverResponse
and the classes they use to reflect the new API; other top-level
classes were left untouched.
Fix checkstyle errors.

Change-Id: Ife5830c45ba8aece8d676a10f0fd8a9c9fe6cb66
Issue-ID: POLICY-964
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoResolve checkstyle formatting 63/60363/3
Pamela Dragosh [Mon, 13 Aug 2018 17:24:59 +0000 (13:24 -0400)]
Resolve checkstyle formatting

This submission is mostly focused on 120 spacing, missing
spaces, rearranged imports, newlines before package
and a few other items. Will have to submit further
reviews to finish this.

Issue-ID: POLICY-883
Change-Id: I772a2077ac97a0cb929810d8afadd2f415fae17b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoMerge "Fix basic code issues in controlloop"
Jorge Hernandez [Tue, 7 Aug 2018 14:11:39 +0000 (14:11 +0000)]
Merge "Fix basic code issues in controlloop"

5 years agoMerge "add scripts to measure performance of PDP-D"
Pamela Dragosh [Tue, 7 Aug 2018 13:01:11 +0000 (13:01 +0000)]
Merge "add scripts to measure performance of PDP-D"

5 years agoFix basic code issues in controlloop 69/59069/2
Krishnajinka [Mon, 6 Aug 2018 05:18:00 +0000 (14:18 +0900)]
Fix basic code issues in controlloop

Found few issues while going through the code. Fixing
these issues in the controlloop package classes

Issue-ID: POLICY-1017
Change-Id: I24d0ce1257ad689c3e9d9b7a3bea07eeb65383f1
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
5 years agocarry forward template changes 31/59231/2
Jim Hahn [Mon, 6 Aug 2018 13:53:16 +0000 (09:53 -0400)]
carry forward template changes

Incorporated changes, to clean-up objects that have no associated Param
object, from the amsterdam rules template into the casablanca rules
template.  Also carried forward changes in behavior of PolicyGuard
lock requests.
Fix typo in comment.
Change tabs to spaces and removing trailing spaces.

Change-Id: Ifcfda573f4c271d804e526d8cc0bea4b89b16612
Issue-ID: POLICY-955
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoadd scripts to measure performance of PDP-D 21/57721/11
Jim Hahn [Thu, 26 Jul 2018 14:46:26 +0000 (10:46 -0400)]
add scripts to measure performance of PDP-D

Also changed tabs to spaces in scripts.
Fix typo in script name: "performace" -> "performance".
Add comments to uebtime.sh.
Removed comments about "wait".
Added "mt" to report script name.
Updated comments in both scripts.
Renamed jmeter script.
Modified uebtime.sh to scan zipped network files, too, and then combined
uebtime.sh into generate.sh.
Removed commented-out code from generate.sh.
Ignore errors from "ls network*.zip" in generate.sh.
Restructured the network.log parser and included additional request types
in the list of times it extracts from the log.
Removed unused import.
Rebased.
Removed unneeded network.log match pattern.
Added comments about matching abatements.
Renamed script to use hyphens instead of underscores, and dropped the
".sh" extension.

Change-Id: I5f8e74cec3e83d5427be03f5e684c871a038f923
Issue-ID: POLICY-888
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agorename rule template from beijing to casablanca 91/58791/2
Jim Hahn [Thu, 2 Aug 2018 20:40:41 +0000 (16:40 -0400)]
rename rule template from beijing to casablanca

Changed assertTrue to assertEquals in CasablancaFeatureTest.

Change-Id: I3bec009ddde2f10468575b4b7bf9c08c24748aae
Issue-ID: POLICY-955
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agohttps configuration for amsterdam controller 37/57937/2
Jorge Hernandez [Sun, 29 Jul 2018 03:04:03 +0000 (22:04 -0500)]
https configuration for amsterdam controller

configuration set to false until unblocked by DMAAP-547.

Change-Id: I2efdafa8b143725fd73f05ec3d0a6a9ffc3b12c6
Issue-ID: POLICY-941
Signed-off-by: Jorge Hernandez <jh1730@att.com>
5 years agoCopy policy-endpoints from drools-pdp to common 55/57155/3
mmis [Mon, 23 Jul 2018 11:22:07 +0000 (12:22 +0100)]
Copy policy-endpoints from drools-pdp to common

Replaced references to classes deleted from drools-pdp with references to the
corresponding in policy-common

Issue-ID: POLICY-967
Change-Id: Ia9d2ac704e6b7c434e5a9e7aee6d7dcf9198e4f2
Signed-off-by: mmis <michael.morris@ericsson.com>
5 years agoUse refresh() instead of lock() in guard 35/56735/1
Jim Hahn [Mon, 16 Jul 2018 21:04:55 +0000 (17:04 -0400)]
Use refresh() instead of lock() in guard

This is the second step of separating the lock "refresh" operation
from the original "lock" operation.
Modified PolicyGuard to use refresh() to extend a lock.  Also removed
the host name from the owner String, as it will no be longer needed
(once the final step is done).

Change-Id: I3a498e6f81d9dba1bbdfd6f7388087355192bcf5
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Username & password should be optional for VFC"
Pamela Dragosh [Thu, 12 Jul 2018 12:20:17 +0000 (12:20 +0000)]
Merge "Username & password should be optional for VFC"

5 years agoUsername & password should be optional for VFC 19/56219/3
Jim Hahn [Wed, 11 Jul 2018 15:00:58 +0000 (11:00 -0400)]
Username & password should be optional for VFC

Also updated licenses.
Replace tabs with spaces in new junit method.
Updated licenses again.

Change-Id: Iebff19353c052e59bfd69da1677e9a05c44592a0
Issue-ID: POLICY-869
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoMerge "Include hostname as part of lock owner"
Jorge Hernandez [Wed, 11 Jul 2018 17:54:48 +0000 (17:54 +0000)]
Merge "Include hostname as part of lock owner"

5 years agoCatch exception from missing property in operation 39/56139/2
Jim Hahn [Tue, 10 Jul 2018 20:29:13 +0000 (16:29 -0400)]
Catch exception from missing property in operation

When a new operation is started it will throw an IllegalArgumentException
if a property is missing.  Modified the rules to catch this
exception, indicate the failure, and move on to the next operation.
Modified code to catch generic exception.

Change-Id: Ie8c24371eb84ee55ff0a0a5fcacda3670483efc5
Issue-ID: POLICY-869
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoInclude hostname as part of lock owner 01/56201/1
Jim Hahn [Wed, 11 Jul 2018 13:07:23 +0000 (09:07 -0400)]
Include hostname as part of lock owner

Because the lock owner string is constructed, using just the target type
and request ID, lock requests made by different ONSETs running on
different PDP-Ds may both succeed.  Added the hostname to the owner
string so that locks for ONSETs for the same request ID will be rejected
if the request is made on different PDP-Ds.

Change-Id: I1d45194cbb1c5b1a1f6000477fe51879a2fecc19
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoRemove Params for deleted rules 81/55981/1
Jim Hahn [Fri, 6 Jul 2018 19:10:45 +0000 (15:10 -0400)]
Remove Params for deleted rules

If rules are deleted, then no rule is left to retract the
associated Params object.  However, we can create more general
rules that will fire whenever rules are added, thus causing
clean-up of old Params at that time.
Implemented the above approach.

Change-Id: I207d493cc6924a4b34a8d0fa4915ed499ebc4a6e
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoClean up objects for deleted rules 97/55897/4
Jim Hahn [Thu, 5 Jul 2018 18:24:36 +0000 (14:24 -0400)]
Clean up objects for deleted rules

When rules for a closed loop are deleted, associated working memory
elements may be left around.
Modified the code to retract the various elements.
Re-added code to unlock when retracting TargetLock.
Add junit tests for new methods.
Forgot the junit test for request id.

Change-Id: Iec2805adbdb147a643f6163badee05ea353ada88
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agounlock should always return TargetLock 87/55887/1
Jim Hahn [Thu, 5 Jul 2018 14:36:49 +0000 (10:36 -0400)]
unlock should always return TargetLock

ControlLoopEventManager.unlock only returns the TargetLock if
the PolicyGuard.unlock operation is successful.  However, if
the lock has already expired, then PolicyGuard.unlock will return
false, and ControlLoopEventManager.unlock will then return null.
As a result, the rules do not retract the TargetLock.  (The rules
do, however, retract any left-over TargetLock objects during the
clean-up phase.  Nevertheless, the earlier rules should not have
to depend on the clean-up rules to do that.)
Modified the code to address this issue.

Change-Id: I2e6099a4e3511053d2e6e1373cae4b480798d1b6
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoAdd time limit to local guard locking facility 73/55573/2
Jim Hahn [Wed, 27 Jun 2018 15:04:11 +0000 (11:04 -0400)]
Add time limit to local guard locking facility

Modified the local policy guard locking facility to add
a time parameter.
Modified the control loop event manager to extend the lock
when lockCurrentOperation() is re-invoked.
Modified the rules to retract the lock if the lock request
was denied.
Reorder assertions in junit test.

Change-Id: Ic9b77acbb4881a5a516f30eb56664bad1a5c4d7e
Issue-ID: POLICY-872
Signed-off-by: Jim Hahn <jrh3@att.com>