policy/drools-applications.git
6 years agoFix Target Entity Lock 87/19387/1
daniel [Tue, 17 Oct 2017 22:56:08 +0000 (17:56 -0500)]
Fix Target Entity Lock

This fix enables the pdp to stop events with
different requestId's/controlLoopNames from
being processed if the target entity specified is
already being processed by another event/controlloop.

The lock timeout rule is removed to stop the event from
waiting to obtain a lock if it was not already required.

Handling of the lock denied case is taken care of in the
event manager rule instead of in a seperate rule to avoid
further unneccessary computation.

A new control loop test case was created that is for testing
general control loop errors. The test case included is for
testing that the lock will deny a request with a duplicate
target entity.

Issue-ID: POLICY-341
Change-Id: Ib62286eff74ec22b2c645f32f385cb331fb1dff3
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoMerge "Fix operation history DB properties for Junits"
Jorge Hernandez [Tue, 17 Oct 2017 20:58:39 +0000 (20:58 +0000)]
Merge "Fix operation history DB properties for Junits"

6 years agoMerge "Update SO Interface AAI NQ response from v8 to v11"
Jorge Hernandez [Tue, 17 Oct 2017 20:58:14 +0000 (20:58 +0000)]
Merge "Update SO Interface AAI NQ response from v8 to v11"

6 years agoUpdate SO Interface AAI NQ response from v8 to v11 13/19113/6
Hockla, Ali (ah999m) [Mon, 16 Oct 2017 17:15:03 +0000 (12:15 -0500)]
Update SO Interface AAI NQ response from v8 to v11

- Removed nonBaseIndex since there is only base vf Module in v11 response
- Reverted to checkExtractedFields()
- Modified the AAI Simulator to return the v11 response
- If AAI NQ fails then the SO Request will not be constructed. In this
  case, we are retracting objects from the transaction and inserting policyResult.FAILURE into current operation to
  prevent null values in finishOperation

Issue-ID: POLICY-339
Change-Id: I1c48fac4f9a51467ad54b0706543f5d1baa70389
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agoFix operation history DB properties for Junits 37/19137/3
Temoc Rodriguez [Mon, 16 Oct 2017 20:37:05 +0000 (13:37 -0700)]
Fix operation history DB properties for Junits

Removed operation_history.properties / operations-history.properties.
Changed the properties in persistence.xml
so that it uses the correct values. Previously junit would never write
to db because the "guard.disabled" property was not set. Set this property.
Additionally the operationshistory10 table was trying to be created even
though it exists. These values work in junit code. Not tested on
rackspace yet.

Issue-ID: POLICY-345
Change-Id: Id755b3152ae6ac4991ea9c314154592ea0105070
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoUpdate abatement=false and add Abated event 25/19125/1
Pamela Dragosh [Mon, 16 Oct 2017 18:51:47 +0000 (14:51 -0400)]
Update abatement=false and add Abated event

Missing abatement=false for Use Cases other than vCPE. Added DCAE
Control Loop Event message for ABATED.

Issue-ID: POLICY-346
Change-Id: Ic8890dd81607ff8657a6f9e49cd9be51cb410fe1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoEnable junits to work with the archetype template 37/18337/2
Charles Cole [Fri, 6 Oct 2017 14:18:45 +0000 (09:18 -0500)]
Enable junits to work with the archetype template

Control loop junits now use the actual PolicyEngine instead of a
simulation, allowing them to work with the archetype template

Issue-ID: POLICY-101
Change-Id: I910961996aaf831f4e91b7d7173d05fdfdd77683
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoMerge "Fix nullPointerException non-200 guard response."
Jorge Hernandez [Wed, 11 Oct 2017 15:40:41 +0000 (15:40 +0000)]
Merge "Fix nullPointerException non-200 guard response."

6 years agoFix nullPointerException non-200 guard response. 71/18071/2
Temoc Rodriguez [Tue, 10 Oct 2017 22:26:10 +0000 (15:26 -0700)]
Fix nullPointerException non-200 guard response.

Added a check for when the guard response from pdp-x is not
200. When the response is unauthorized or forbidden, it will
have an empty body, try to convert to json, and throw an
exception. Added a null check on the response and returns
indeterminate in the case of an empty body.

Issue-ID: POLICY-280
Change-Id: I9d384472e230495130bd41d377e25b74fe9ea9bd
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoset LCM Common Header api-vers to 2.0 67/18067/1
Jorge Hernandez [Tue, 10 Oct 2017 22:16:28 +0000 (17:16 -0500)]
set LCM Common Header api-vers to 2.0

per Scott's feedback, see JIRA ticket notes

Change-Id: I5e9a5a6f98fceabc58911a3673d1b889604b5a92
Issue-ID: POLICY-300
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoadd structure only for PAP rule management 49/18049/3
Jorge Hernandez [Tue, 10 Oct 2017 20:28:55 +0000 (15:28 -0500)]
add structure only for PAP rule management

PAP currently generates a set up rule that inserts a Params object
when the session is loaded.   Since the official template also
has an equivalent rule that is used by the drools applications
team to perform initializations tasks, at runtime we end up with
2 Params objects with the same control loop data.   This has
sideeffects where the same rule becomes true for 2 Params objects
therefore performing duplicated actions which introduces somewhat
anomalous behavior.

The PapParams is introduced to satisfy current PAP needs for
management of rules.  The structure is included here only for
those purposes but it carries no significance at runtime during
drools executions since the rules go by Params instead of PapParams.

In the near future, the plan is to have the PAP not generating
SET UP rules.

There is a companion review on the PAP side to refer to PapParams
instead of Params to fulfill the resolution of POLICY-302.

Change-Id: I2f9ed3cee3d5d5209eecd43823cfc44a4b937600
Issue-ID: POLICY-302
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agostrengthen APPC Response Cleanup Rules 75/17675/1
Jorge Hernandez [Mon, 9 Oct 2017 13:24:23 +0000 (08:24 -0500)]
strengthen APPC Response Cleanup Rules

The existing APPC Response Cleanup Rules will drop responses
that are not specific for that control loop.   For example
vDNS control loop will drop LCM Response for vCPE control loops
preventing progress of the use cases.

This only happens when the control loops coexist with the
current set of rules.

Change-Id: I5a9ae26e39ecce8dd7f1098d02b6c6b97650b67a
Issue-ID: POLICY-298
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Fix Artifact POM"
Jorge Hernandez [Fri, 6 Oct 2017 18:27:31 +0000 (18:27 +0000)]
Merge "Fix Artifact POM"

6 years agoFix Artifact POM 99/17499/1
daniel [Fri, 6 Oct 2017 18:01:36 +0000 (13:01 -0500)]
Fix Artifact POM

Removed a lingering dependency on the "demo" project
that is causing build errors.

Issue-ID: POLICY-291
Change-Id: If1870ebba33c4ff29a0bd5bcdaa39d9b61f62436
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoMerge "Fix Build Errors"
Jorge Hernandez [Fri, 6 Oct 2017 16:38:24 +0000 (16:38 +0000)]
Merge "Fix Build Errors"

6 years agoFix Build Errors 75/17475/1
daniel [Fri, 6 Oct 2017 15:08:21 +0000 (10:08 -0500)]
Fix Build Errors

Removing the legacy "demo" project as this uses obsolete
code. The operation and control loop timeouts were increased
to allow more time for the simulators to respond.

Issue-Id: POLICY-291
Change-Id: I1143352cefaf9749ca0eca55927960535b2599b8
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoAdd fix for guard db on disable 89/17389/2
Temoc Rodriguez [Fri, 6 Oct 2017 14:57:02 +0000 (07:57 -0700)]
Add fix for guard db on disable

Added a fix so that the guard database is not attempted to be accessed
while guard is set to disabled. The guard db access is done in the
operations manager which has no context of guardat the moment. Because
of this separation, the boolean must be grabbed from the PolicyEngine
properties. We should consider some guard refactoring.

Issue-ID: POLICY-296
Change-Id: Ida7a2a7c19e568b076731e0f04bdc8a9fd0fcb26
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoMerge "Fix JUnit Race Conditions"
Jorge Hernandez [Fri, 6 Oct 2017 01:29:06 +0000 (01:29 +0000)]
Merge "Fix JUnit Race Conditions"

6 years agoFix JUnit Race Conditions 51/17251/2
daniel [Wed, 4 Oct 2017 15:09:37 +0000 (10:09 -0500)]
Fix JUnit Race Conditions

This fix now implements the observer pattern for the
PolicyEngineJUnitImpl so that the test cases can be
notified when an event is available to be pulled.
This eliminates the need to sleep the thread for
some arbitrary time to let the rules process events.

Issue-ID: POLICY-291
Change-Id: I884c959c20b95a1b58f357602099d8a01c8d2e3c
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoFixed Sonar blockers/criticals 57/17257/1
Hockla, Ali (ah999m) [Wed, 4 Oct 2017 16:58:13 +0000 (11:58 -0500)]
Fixed Sonar blockers/criticals

Issue-ID: POLICY-292

Change-Id: Id53e9d3b6ba23b20d7e45d4d3b39f8092f126333
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agomissing $ in guard expansion variables 35/16535/3
Jorge Hernandez [Thu, 28 Sep 2017 23:52:46 +0000 (18:52 -0500)]
missing $ in guard expansion variables

Change-Id: I05c577e8760f5b4b8e6375f50a327c9dde575e06
Issue-ID: POLICY-260
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMake Guard Configurable 19/16519/1
daniel [Thu, 28 Sep 2017 21:17:04 +0000 (16:17 -0500)]
Make Guard Configurable

This allows the user to disable or enable guard
through the .properties.environment file. Verified
and tested in a pdp. Properties were added to the
simulators properties file for the simulators to
work out of the box.

Issue-ID: POLICY-259
Change-Id: I0027a5d28f1b30e81bdbe42fa17621b36a61c850
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoMerge "Fix Sonar Criticals"
Jorge Hernandez [Thu, 28 Sep 2017 20:21:15 +0000 (20:21 +0000)]
Merge "Fix Sonar Criticals"

6 years agoFix Sonar Criticals 97/16497/1
Hockla, Ali (ah999m) [Thu, 28 Sep 2017 18:44:26 +0000 (13:44 -0500)]
Fix Sonar Criticals

Made MSBServiceFactory serializable

Issue-ID: POLICY-115

Change-Id: I8c8abdf656a49bc20ecefb42a7f4f7bacde57726
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agoDelete ControlLoopXacmlGuardTest.java 79/16479/2
Temoc Rodriguez [Thu, 28 Sep 2017 17:33:40 +0000 (10:33 -0700)]
Delete ControlLoopXacmlGuardTest.java

Deleted ControlLoopXacmlGuardTest.java so avoid sonar blockers. This
junit will reduce coverage a bit but is not significant. This junit is
already covered by the other use case junit files in template demo. A
more robust junit is in need to test guard permit, deny, and pdp-x
misconnecion in relation to the drl operations and rules. For now, this
file does not add useful testing.

Issue-ID: POLICY-260
Change-Id: Iaed0ad62f72ddc5b9a6b7626a037c26d6fd1ca52
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoMerge "Fix Sonar criticals"
Jorge Hernandez [Thu, 28 Sep 2017 18:14:53 +0000 (18:14 +0000)]
Merge "Fix Sonar criticals"

6 years agoFix Sonar criticals 07/15707/5
Charles Cole [Tue, 26 Sep 2017 19:43:58 +0000 (14:43 -0500)]
Fix Sonar criticals

Fixed two Sonar criticals.  Changed VFC actor service provider to
eliminate redundant AAI queries.

Issue-ID: POLICY-115
Change-Id: Ic4993b5d498a1cb3d3fc51ce1d2b4e90bb26353d
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoFix Retries for Policies 39/16439/2
daniel [Thu, 28 Sep 2017 15:01:21 +0000 (10:01 -0500)]
Fix Retries for Policies

This applies changes to make retries work properly
for all control loops. The current design was ignoring
the upper bound of the retries and retrying until either
a success or control loop timeout occured. This is now
fixed to only do retries until the limit is reached that
is specified from the policy.

The operation is now started in the GUARD.PERMITTED rule.
I think this is better because it stops Policy from doing
extra processing if there is a guard deny. This is also
needed so that we can properly do retries for all cases.

The notifications sent in GUARD_NOT_YET_QUERIED and
GUARD.RESPONSE are now more informative with the
message specifying the actor and recipe. The not queried
rule has a message stating that we are sending a query
to guard and the guard response message in the guard
response rule specifices the result from guard.

During a retest of vDNS it appeared that the archetype
template was no longer working, this was because there
were changes in the JUnit template that were not
reflected in the archetype template. These were added
to archetype and vDNS is verified to work again.

Another small fix needed was making sure the action for
vCPE is "Restart" instead of "restart". APPC will
reject our request if "Restart" is not sent as the
action.

Issue-ID: POLICY-259
Change-Id: I28dd3c9a629d297b408775a01afadd5c19351e37
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoMerge "Add missing auth headers to guard request"
Jorge Hernandez [Thu, 28 Sep 2017 15:27:50 +0000 (15:27 +0000)]
Merge "Add missing auth headers to guard request"

6 years agoAdd missing auth headers to guard request 45/15745/5
Temoc Rodriguez [Tue, 26 Sep 2017 23:03:34 +0000 (16:03 -0700)]
Add missing auth headers to guard request

Added guard authentication, client authentication, and environment http
headers to the pdp-x guard restful request. Properties are set to
PolicyEngine.manager. Property getter, setter, and properties in
guard/.../Util.java. Test properties defined in junits themselves. Added
code from GuardContext.java to grab the properties and make restful request.
PolicyGuardXacmlHelper now closely resembles GuardContext in order to mimic
functionality. Guard url no longer is passed into CallGuardTask, it is now
a property.

Issue-ID: POLICY-260
Change-Id: I5b144764828b6da0e7b738a578e4f6596a0f4f36
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoMerge "Fix major sonar issues"
Pamela Dragosh [Thu, 28 Sep 2017 04:40:23 +0000 (04:40 +0000)]
Merge "Fix major sonar issues"

6 years agoMerge "Use MSB for service discovery"
Pamela Dragosh [Thu, 28 Sep 2017 04:38:36 +0000 (04:38 +0000)]
Merge "Use MSB for service discovery"

6 years agoMerge "Fix major sonar issues"
Jorge Hernandez [Thu, 28 Sep 2017 03:51:49 +0000 (03:51 +0000)]
Merge "Fix major sonar issues"

6 years agoMerge "Add functionality for VFC request retries"
Jorge Hernandez [Thu, 28 Sep 2017 02:51:54 +0000 (02:51 +0000)]
Merge "Add functionality for VFC request retries"

6 years agoMerge "Cleanup for VFC Actor code"
Jorge Hernandez [Thu, 28 Sep 2017 02:49:17 +0000 (02:49 +0000)]
Merge "Cleanup for VFC Actor code"

6 years agoMerge "Added @Override annotation to method signature"
Jorge Hernandez [Wed, 27 Sep 2017 20:16:00 +0000 (20:16 +0000)]
Merge "Added @Override annotation to method signature"

6 years agoMerge "Create common object to consolidate AAI response"
Jorge Hernandez [Wed, 27 Sep 2017 17:54:23 +0000 (17:54 +0000)]
Merge "Create common object to consolidate AAI response"

6 years agoAdded changes for SO Request retries 13/16013/2
Hockla, Ali (ah999m) [Wed, 27 Sep 2017 14:40:07 +0000 (09:40 -0500)]
Added changes for SO Request retries

This change will allow the control loop to increment the operation
attempts in the case of an SO failure in order to retry the
operation if defined in the yaml.

Issue-ID: POLICY-268

Change-Id: I1fee2ce64524e58fc3068f19c5cf31ed91159e0f
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agoAdd functionality for VFC request retries 69/16069/1
Ritu Sood [Wed, 27 Sep 2017 10:19:57 +0000 (03:19 -0700)]
Add functionality for VFC request retries

This allows the control loop to track operation
attempts in case of VFC failures. This will
allow retries of the operation if required in the
YAML file.

Issue-ID: POLICY-270
Change-Id: Ieeaf6770a8d03fa4eecc976535301d9236d19972
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
6 years agoCleanup for VFC Actor code 55/16055/2
Ritu Sood [Wed, 27 Sep 2017 09:47:57 +0000 (02:47 -0700)]
Cleanup for VFC Actor code

Fix some sonar critical issues and
other clean up

Issue-ID: POLICY-57
Change-Id: Iec9b94ff238ea6a65cfe39fd5cdfb200c773c1a9
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
6 years agoFix major sonar issues 51/15451/4
shashikanth [Tue, 26 Sep 2017 10:41:41 +0000 (16:11 +0530)]
Fix major sonar issues

Fix major sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR|rules=squid%3AS1161

Added "@Override" annotation above this method signature.

Issue-Id:POLICY-239
Change-Id: I578d0e740a6c04ba02df400a3abc99f9b774908a
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
6 years agoAdded @Override annotation to method signature 45/15445/4
shashikanth [Tue, 26 Sep 2017 10:22:47 +0000 (15:52 +0530)]
Added @Override annotation to method signature

Fix major sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR|rules=squid%3AS1161

Added the "@Override" annotation above this method signature.

Issue-Id:POLICY-239
Change-Id: Ibb71db82d78b0df02d5d6416ac3f3f00a3780695
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
6 years agoFix major sonar issues 37/15437/5
shashikanth [Tue, 26 Sep 2017 10:06:17 +0000 (15:36 +0530)]
Fix major sonar issues

Fix major sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR|rules=squid%3AS1132

Fixed string literal comparison for for SO and VF Module Create and few optimizations.

Issue-Id:POLICY-239
Change-Id: I8e228463ebc7f3114e5caba9b423552bb84dd52d
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
6 years agoCreate common object to consolidate AAI response 79/15679/2
Joseph Chou [Tue, 26 Sep 2017 19:55:47 +0000 (15:55 -0400)]
Create common object to consolidate AAI response

Remove duplicate/obsolete code (NQF199)

Change-Id: Ibe0d4d958a1fe5ae0bae93f740e8b32196a3b07b
Issue-ID: POLICY-228
Signed-off-by: Joseph Chou <jc2555@att.com>
6 years agoFix Use Case Template 31/15731/2
daniel [Tue, 26 Sep 2017 21:21:02 +0000 (16:21 -0500)]
Fix Use Case Template

This is a WIP for getting guard to work. Currently
the A&AI GET and named queries are connecting to
the simulator and working in the labs. Guard is not
connecting to simulator and needs further analysis.

Issue-ID: POLICY-259
Change-Id: If9875bfd83cbd82dcae04a876b3818ec9c07b1f7
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoforce maven dependency plugin version to latest 75/15675/2
Jorge Hernandez [Tue, 26 Sep 2017 19:50:03 +0000 (14:50 -0500)]
force maven dependency plugin version to latest

the 2.1 version that comes with the ubuntu installation
have problems with the maven repositoryUrls.

disable asserts in fact counts, it seems almost impossible
to get clean builds in jenkins server because these
junit failures.

Change-Id: I551f00a4a927f87a5e6294d936e9b9c926f21880
Issue-ID: POLICY-265
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoFix TestSO properties 61/15661/1
Temoc Rodriguez [Tue, 26 Sep 2017 17:28:40 +0000 (10:28 -0700)]
Fix TestSO properties

TestSO was missing the environment properties for AAI and SO url, user,
and pass. Set SO and AAI properties in TestSO.java. If this is not set,
then the response will be null and the junit will fail. Moved setting
properties to Util.java to promote code reuse.

Issue-ID: POLICY-259
Change-Id: Id73611abab900675a1f2b543f71566baa05318b2
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoUse MSB for service discovery 01/15301/1
wangxinyuan10113332 [Tue, 26 Sep 2017 03:01:49 +0000 (11:01 +0800)]
Use MSB for service discovery

Change-Id: I524946a1c352b5e9225b7fb37d35fa03a3f77e82
Issue-ID: POLICY-172
Signed-off-by: wangxinyuan10113332 <wang.xinyuan1@zte.com.cn>
6 years agoMerge "Create common object to consolidate AAI response"
Jorge Hernandez [Mon, 25 Sep 2017 22:39:40 +0000 (22:39 +0000)]
Merge "Create common object to consolidate AAI response"

6 years agoMerge "Fix Usecase Template for VoLTE"
Jorge Hernandez [Mon, 25 Sep 2017 21:25:04 +0000 (21:25 +0000)]
Merge "Fix Usecase Template for VoLTE"

6 years agoFix Usecase Template for VoLTE 09/15209/1
daniel [Mon, 25 Sep 2017 20:50:33 +0000 (15:50 -0500)]
Fix Usecase Template for VoLTE

This includes VoLTE support for the amsterdam template.
As of right now all use cases are able to get a final
success with guard disabled and no A&AI GET queries.
Currently, the GET query is not working in the lab.
I will address this in another pull request.

Issue-ID: POLICY-259
Change-Id: I216aa84daaa1e93ab12c56ee53283b4cb413a7c3
Signed-off-by: Daniel Cruz<dc443y@att.com>
6 years agooverride guard url when simulator feature enabled 91/15191/1
Jorge Hernandez [Mon, 25 Sep 2017 20:17:44 +0000 (15:17 -0500)]
override guard url when simulator feature enabled

Change-Id: I6af04238d043b95960a29484bcfbb08d2eab5b13
Issue-ID: POLICY-256
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoadd guard simulator to pdp-d feature for labs 81/15181/1
Jorge Hernandez [Mon, 25 Sep 2017 19:42:02 +0000 (14:42 -0500)]
add guard simulator to pdp-d feature for labs

Change-Id: Id1852e55c3b03cf2c9e3800e40067806c6b9be5e
Issue-ID: POLICY-256
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agostand up amsterdam controller at initialization 55/15155/1
Jorge Hernandez [Mon, 25 Sep 2017 17:16:04 +0000 (12:16 -0500)]
stand up amsterdam controller at initialization

Change-Id: I9bcbaf50e802fceb07c0db3bf13df8f8403a6dea
Issue-ID: POLICY-265
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoCreate common object to consolidate AAI response 53/15153/1
Joseph Chou [Mon, 25 Sep 2017 17:11:51 +0000 (13:11 -0400)]
Create common object to consolidate AAI response

Add Junit test to improve sonar coverage

Change-Id: I32688dad756d2cba80559cd1d090e334ebf77aa3
Issue-ID: POLICY-228
Signed-off-by: Joseph Chou <jc2555@att.com>
6 years agoapps environment properties for pdp-x client auth 47/15147/1
Jorge Hernandez [Mon, 25 Sep 2017 16:36:08 +0000 (11:36 -0500)]
apps environment properties for pdp-x client auth

Change-Id: I23d2e8d16abe6ccbfda6f7d1a3e3d69b209d5b20
Issue-ID: POLICY-260
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Added the Override annotation"
Jorge Hernandez [Mon, 25 Sep 2017 14:04:40 +0000 (14:04 +0000)]
Merge "Added the Override annotation"

6 years agoMerge "Fix Blocker/Critical sonar issues"
Jorge Hernandez [Mon, 25 Sep 2017 13:54:48 +0000 (13:54 +0000)]
Merge "Fix Blocker/Critical sonar issues"

6 years agoAdded the Override annotation 85/15085/1
rama-huawei [Mon, 25 Sep 2017 13:37:04 +0000 (19:07 +0530)]
Added the Override annotation

Added diamond symbol on RHS side

Change-Id: I3945e5f2217f74b71fa143b128f271e48b4882a7
Issue-ID: POLICY-239
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoMerge "Added Override annotation"
Jorge Hernandez [Mon, 25 Sep 2017 13:16:03 +0000 (13:16 +0000)]
Merge "Added Override annotation"

6 years agoMerge "Added private constructor"
Jorge Hernandez [Mon, 25 Sep 2017 13:15:32 +0000 (13:15 +0000)]
Merge "Added private constructor"

6 years agoMerge "Fix for Sonar major issues"
Jorge Hernandez [Mon, 25 Sep 2017 13:14:45 +0000 (13:14 +0000)]
Merge "Fix for Sonar major issues"

6 years agoMerge "Fix for Sonar major issues"
Jorge Hernandez [Mon, 25 Sep 2017 13:13:24 +0000 (13:13 +0000)]
Merge "Fix for Sonar major issues"

6 years agoAdded Override annotation 09/15009/2
ramanjaneya [Mon, 25 Sep 2017 10:12:01 +0000 (15:42 +0530)]
Added Override annotation

Issue-ID: POLICY-239
Change-Id: Ia84e5656744289be52cf22b1b68d870a03b85404
Signed-off-by: ramanjaneya <ramanjaneya.palleti@huawei.com>
6 years agoAdded private constructor 13/15013/2
ramanjaneya [Mon, 25 Sep 2017 10:25:29 +0000 (15:55 +0530)]
Added private constructor

Reorder the modifiers to comply with the Java Language Specification

Issue-ID: POLICY-239
Change-Id: I1c156dd420d27c45d496b07841f6375aec1b8de3
Signed-off-by: ramanjaneya <ramanjaneya.palleti@huawei.com>
6 years agoMerge "Added private constructor"
Pamela Dragosh [Fri, 22 Sep 2017 23:41:07 +0000 (23:41 +0000)]
Merge "Added private constructor"

6 years agoMerge "Add simple JUnit test for LCMResponse"
Pamela Dragosh [Fri, 22 Sep 2017 22:30:27 +0000 (22:30 +0000)]
Merge "Add simple JUnit test for LCMResponse"

6 years agoAdd simple JUnit test for LCMResponse 17/14717/1
Pamela Dragosh [Fri, 22 Sep 2017 20:08:57 +0000 (16:08 -0400)]
Add simple JUnit test for LCMResponse

This covers all the methods

Issue-ID: POLICY-32
Change-Id: I6da6c54c257f6254f5116c99a64c02dbf0c77e05
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "Fix Use Case Testing"
Jorge Hernandez [Fri, 22 Sep 2017 19:48:18 +0000 (19:48 +0000)]
Merge "Fix Use Case Testing"

6 years agoAdded private constructor 89/14589/2
ramanjaneya [Fri, 22 Sep 2017 11:51:58 +0000 (17:21 +0530)]
Added private constructor

Issue-ID: POLICY-239

Change-Id: I2ed90fc27c70ae03a772913bf3fefd28b692cec7
Signed-off-by: ramanjaneya <ramanjaneya.palleti@huawei.com>
6 years agoAdded private constructor 83/14583/2
ramanjaneya [Fri, 22 Sep 2017 11:23:13 +0000 (16:53 +0530)]
Added private constructor

Issue-ID: POLICY-239

Change-Id: I261d3aa1b9f67c3e78e1016a84ed64924e306f43
Signed-off-by: ramanjaneya <ramanjaneya.palleti@huawei.com>
6 years agoFix Use Case Testing 93/14693/1
daniel [Thu, 21 Sep 2017 19:29:07 +0000 (14:29 -0500)]
Fix Use Case Testing

These changes are necessary to get the use cases working
on an actual PDP. So far vCPE, vFW, and vDNS have been tested
successfully on a pdp. These are priliminary tests to just
test a FINAL SUCCESS without A&AI GET queries being used.
A&AI named queries for vFW and vDNS have been verified to
work.

Changes in the template were made for SO as there were
changes in the JUnit template that did not get reflected
in the archetype template.

Changes in the code were made in various places to use
the environment properties for REST urls, usernames, and
passwords. Due to VoLTE not being tested yet, the url
for VFC is still hard coded and will be changed later.

It has been confirmed with APPC that LCM will have two
topics: APPC-LCM-READ and APPC-LCM-WRITE. Policy needs
to sink to APPC-LCM-READ and pull from source
APPC-LCM-WRITE. This has been reflected in the controller
properties file.

Issue-ID: POLICY-259
Change-Id: Ib9a8df07ae5ad9d3052c88907c1e522952af474d
Signed-off-by: Daniel Cruz <dc443y@att.com>
6 years agoCreate common object to consolidate AAI response 59/14659/1
Joseph Chou [Fri, 22 Sep 2017 15:37:03 +0000 (11:37 -0400)]
Create common object to consolidate AAI response

Create base object for AAI GET query

Change-Id: I874b10f89054d8adcc28b1e601e9ff15ee884784
Issue-ID: POLICY-228
Signed-off-by: Joseph Chou <jc2555@att.com>
6 years agoMerge "Add VFC Response in Working Memory & JUNIT"
Pamela Dragosh [Fri, 22 Sep 2017 15:08:34 +0000 (15:08 +0000)]
Merge "Add VFC Response in Working Memory & JUNIT"

6 years agoAdd guard simulator and multiple AAI responses 71/14371/2
Charles Cole [Thu, 21 Sep 2017 19:20:42 +0000 (14:20 -0500)]
Add guard simulator and multiple AAI responses

Added a guard simulator that can permit or deny (it sends a deny if the
clname is denyGuard).  Added responses to the AAI simulator to set the
is-closed-loop-disabled to true (use a get query with a key of
disableClosedLoop). Changed the content-type of all responses to
application/json.

Issue-ID: POLICY-256
Change-Id: If84813968d3ea59d9ebe029caa69f444a1f413c8
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoMerge "ONAP AAI GET QUERY code to support ONAP project"
Jorge Hernandez [Thu, 21 Sep 2017 19:38:11 +0000 (19:38 +0000)]
Merge "ONAP AAI GET QUERY code to support ONAP project"

6 years agoONAP AAI GET QUERY code to support ONAP project 55/13155/17
Joseph Chou [Tue, 19 Sep 2017 20:39:56 +0000 (16:39 -0400)]
ONAP AAI GET QUERY code to support ONAP project

check in code to use simulator url

Issue-ID: POLICY-103
Change-Id: I352140dd3cb3159fc2c5738bf02dbb6272de48bc
Signed-off-by: Joseph Chou <jc2555@att.com>
6 years agoMerge "Implement restful call to xacml pdp guard"
Jorge Hernandez [Thu, 21 Sep 2017 17:49:29 +0000 (17:49 +0000)]
Merge "Implement restful call to xacml pdp guard"

6 years agoMerge "Upgrade to oparent release version"
Jorge Hernandez [Thu, 21 Sep 2017 17:30:13 +0000 (17:30 +0000)]
Merge "Upgrade to oparent release version"

6 years agopdp-d feature to simulate aai/mso/vfc in lab 53/14053/2
Jorge Hernandez [Thu, 21 Sep 2017 04:12:27 +0000 (23:12 -0500)]
pdp-d feature to simulate aai/mso/vfc in lab

implemented as an optional loadable feature, this
capability enables to bring up simulators used by
junits in a pdp-d lab configuration.

After lab installation, perform:

1. features enable controlloop-util
2. policy start

Now the simulators are opened at ports 6666, 6667, and 6668.

netstat output:
tcp6       0      0 127.0.0.1:6666          :::*                    LISTEN      21562/java
tcp6       0      0 127.0.0.1:6667          :::*                    LISTEN      21562/java
tcp6       0      0 127.0.0.1:6668          :::*                    LISTEN      21562/java

21562 is the pdp-d PID in the lab.

curl http://localhost:6666/aai/v11/network/generic-vnfs/generic-vnf/vnfIdA
{ "vnf-id": "5e49ca06-2972-4532-9ed4-6d071588d792", ... }

Change-Id: I3f05333ce5549b2274eb967b2b8866189b7f8843
Issue-ID: POLICY-259
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoUpgrade to oparent release version 05/14305/1
Pamela Dragosh [Thu, 21 Sep 2017 15:23:35 +0000 (11:23 -0400)]
Upgrade to oparent release version

Following independent release and versioning process guidelines.

Issue-ID: POLICY-225
Change-Id: If679e4002690bb7614c72fb846c383eb265fb2e0
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoImplement restful call to xacml pdp guard 57/13557/10
Temoc Rodriguez [Tue, 19 Sep 2017 18:13:34 +0000 (11:13 -0700)]
Implement restful call to xacml pdp guard

Removed the embedded guard decision and replace with restful call to
xacml pdp to restore guard functionality. Set guard URL with PolicyEngine env properties. Modified templates accordingly.

Issue-Id: POLICY-260
Change-Id: Ic1558a6ebdd5f6d1b74a748f69433f6213dbf984
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agoAdd VFC Response in Working Memory & JUNIT 55/11855/10
Ritu Sood [Mon, 11 Sep 2017 21:20:13 +0000 (14:20 -0700)]
Add VFC Response in Working Memory & JUNIT

Adding code to insert VFC reponse in working
memory and handling that response. Also adding
JUNIT and yaml file for VoLTE usecase.

Issue-Id: POLICY-212
Change-Id: I74a13272ccd931478d27d80715d8c3ac756fb5c7
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
6 years agoMerge "Fix for Sonar major issues"
Jorge Hernandez [Wed, 20 Sep 2017 21:06:10 +0000 (21:06 +0000)]
Merge "Fix for Sonar major issues"

6 years agoFix for Sonar major issues 71/13871/1
SwapnilPathak [Wed, 20 Sep 2017 12:17:33 +0000 (17:47 +0530)]
Fix for Sonar major issues

Add override annotation above the method signature.

Issue-ID: POLICY-248
Change-Id: I8086a6fc1dc24719c3ffd3785a12c086ab556ae9
Signed-off-by: SwapnilPathak <SP00494485@techmahindra.com>
6 years agoFix for Sonar major issues 67/13867/1
SwapnilPathak [Wed, 20 Sep 2017 12:00:07 +0000 (17:30 +0530)]
Fix for Sonar major issues

Move the String literal on left side of string comparison.

Issue-ID: POLICY-249
Change-Id: I8086a6fc1dc24719c3ffd3785a12c086ab555ae9
Signed-off-by: SwapnilPathak <SP00494485@techmahindra.com>
6 years agoMerge "Fixing VFC simulator for junit tests"
Pamela Dragosh [Wed, 20 Sep 2017 11:20:28 +0000 (11:20 +0000)]
Merge "Fixing VFC simulator for junit tests"

6 years agoMerge "Fix Major sonar issues"
Pamela Dragosh [Wed, 20 Sep 2017 10:54:52 +0000 (10:54 +0000)]
Merge "Fix Major sonar issues"

6 years agoFix for Sonar major issues 37/13737/2
SwapnilPathak [Wed, 20 Sep 2017 07:34:50 +0000 (13:04 +0530)]
Fix for Sonar major issues

Add override annotation above the method signature.

Issue-ID: POLICY-248
Change-Id: I8086a6fc1dc24719c3ffd3785a12c086ab453ae9
Signed-off-by: SwapnilPathak <SP00494485@techmahindra.com>
6 years agoFix Major sonar issues 57/13357/2
shashikanth [Tue, 19 Sep 2017 08:39:45 +0000 (14:09 +0530)]
Fix Major sonar issues

Fix Major sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR

Add the "@Override" annotation above this method signature
"value" is already a string, there's no need to call "toString()" on it

Issue-Id:POLICY-239
Change-Id: Ia64ac87c13d88c5d961b943e0b2286b273bd4831
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
6 years agotest tooling to generate vcpe use case in lab 21/13621/1
Jorge Hernandez [Wed, 20 Sep 2017 00:55:42 +0000 (19:55 -0500)]
test tooling to generate vcpe use case in lab

run successully vcpe case in lab in 2 steps:

1.  docker-install load
2.  run create-cl-amsterdam (with defaults)
3.  injecting dcae.onset and appc.success packaged
    with archetypes

Change-Id: Idb20c0078228da962510dbf36dae96aceb43546c
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Adding reading service-id from AA&I"
Jorge Hernandez [Tue, 19 Sep 2017 19:11:51 +0000 (19:11 +0000)]
Merge "Adding reading service-id from AA&I"

6 years agoenhancements to archetype and apps packaging 93/13493/1
Jorge Hernandez [Tue, 19 Sep 2017 14:09:05 +0000 (09:09 -0500)]
enhancements to archetype and apps packaging

Change-Id: I3e659d35d3cb397c011657f39ef12b10b0564fc9
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoRemove sonar blocker and unused import 65/13465/1
Pamela Dragosh [Tue, 19 Sep 2017 13:03:19 +0000 (09:03 -0400)]
Remove sonar blocker and unused import

Remove the 3 sonar blockers and unused import in AAI code.

Issue-ID: POLICY-111
Change-Id: I73001a06810ecff3f22da627583a0238c4a09967
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoFix Blocker/Critical sonar issues 77/13377/2
shashikanth [Tue, 19 Sep 2017 09:27:58 +0000 (14:57 +0530)]
Fix Blocker/Critical sonar issues

Fix Blocker/Critical sonar issues in policy/drools-applications module
https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=CRITICAL%2CMAJOR

Fixed 2 issues,
Used isEmpty() to check whether the collection is empty or not.
getActor returns a string, there's no need to call toString()

Issue-Id:POLICY-111
Change-Id: I645420ee370ceb5fca959f870e76db2390e19929
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
6 years agoInherit guard install env properties for cl. 79/13179/1
Jorge Hernandez [Mon, 18 Sep 2017 16:26:58 +0000 (11:26 -0500)]
Inherit guard install env properties for cl.

Clean up a few "mso" references.
Disable 1.0.0 template build for now (note that some
references are still pointing to old mso).
Ie., see
https://git.onap.org/policy/drools-applications/tree/controlloop
       /templates/template.demo.v1.0.0/template.demo
       /src/test/java/org/onap/policy/template/demo/TestSO.java

Since this
is going away, rather than maintaining it, and changing this
code, disabling it for the build.
It will be deleted within the next few days.

Issue-ID: POLICY-162
Change-Id: Ibb819a318fbbb2b7f3aa14cdf76155bdec321024
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Fix sonar critical"
Jorge Hernandez [Mon, 18 Sep 2017 13:52:01 +0000 (13:52 +0000)]
Merge "Fix sonar critical"

6 years agoFixing VFC simulator for junit tests 99/13199/1
Ritu Sood [Mon, 18 Sep 2017 10:01:54 +0000 (03:01 -0700)]
Fixing VFC simulator for junit tests

Added response type to post and removed
response id as it is unused.
Breaking up from the junit patch for ease of
review.

Issue-id: POLICY-212
Change-Id: I0c6b0c02b240cfe81246587184fe6a589dcc2367
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
6 years agoAdding reading service-id from AA&I 07/13007/2
Ritu Sood [Sun, 17 Sep 2017 22:34:16 +0000 (15:34 -0700)]
Adding reading service-id from AA&I

For VFC adding getting service-id from AA&I.

Issue-Id: POLICY-57
Change-Id: I740c7749bfb2d395851cbd5eb3e486bf4eb9b560
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
6 years agoFix sonar critical 07/12807/1
Pamela Dragosh [Fri, 15 Sep 2017 21:05:44 +0000 (17:05 -0400)]
Fix sonar critical

Last transient/serializable issues.
Throw a dedicated exception for DateUtil class
Unused imports
Make the enclosing method "static" or remove this set.

Issue-ID: POLICY-115
Change-Id: I366f85922c4d4d290b320e0b88678c805de59872
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>