policy/drools-pdp.git
6 years agoSet default consumer instance to hostname 77/43777/1
Jim Hahn [Thu, 19 Apr 2018 20:08:20 +0000 (16:08 -0400)]
Set default consumer instance to hostname

Modified the code to generate a consumer instance via UUID,
when no consumer instance is provided.
Removed DEFAULT_CONSUMER_INSTANCE.
Set the consumer instance to the hostname instead of a UUID.

Change-Id: I143eb6d2ec51a7913536a46041de761d51222006
Issue-ID: POLICY-749
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoSonar cleanup 99/43399/8
Magnusen, Drew (dm741q) [Tue, 17 Apr 2018 16:59:43 +0000 (11:59 -0500)]
Sonar cleanup

More sonar cleanup. Resolved some of the simpler issues.

Issue-ID: POLICY-728
Change-Id: If9c4718f10c6d3524239d2a05c09badb791ef2f0
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoUpgrade 1.2.1 SNAPSHOT packages 45/43745/1
Pamela Dragosh [Thu, 19 Apr 2018 15:06:28 +0000 (11:06 -0400)]
Upgrade 1.2.1 SNAPSHOT packages

These were missed in the initial review
https://gerrit.onap.org/r/#/c/42783/

Issue-ID: POLICY-736
Change-Id: I63cc42f4cea4674e7f542bfeab262b1cd0c311fb
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agosupport for AAF provided trustore 99/43599/1
Jorge Hernandez [Wed, 18 Apr 2018 18:48:40 +0000 (13:48 -0500)]
support for AAF provided trustore

Change-Id: I20c5136636f922ee31a773b462e5c2318b2f222f
Issue-ID: POLICY-747
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agostrip timestamped versions in feature installs 21/43221/1
Jorge Hernandez [Tue, 17 Apr 2018 02:04:29 +0000 (21:04 -0500)]
strip timestamped versions in feature installs

This is to satisfy CSIT tests that contains
a mix of SNAPSHOT and timestamped versions while
running tests

Change-Id: I1fe426dcca9250d0fe2c9c5264f1acb1ffbde57b
Issue-ID: POLICY-745
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Sonar fixes to pooling"
Jorge Hernandez [Mon, 16 Apr 2018 23:12:22 +0000 (23:12 +0000)]
Merge "Sonar fixes to pooling"

6 years agoSonar fixes to pooling 35/41235/12
Jim Hahn [Thu, 5 Apr 2018 17:27:38 +0000 (13:27 -0400)]
Sonar fixes to pooling

Made various changes to the pooling feature to address some of the
sonar issues.
Remove duplicate classes, Pair & Triple.
Fix sonar issue about duplicate process(xxx) methods.
Remove extra items from pom.xml and add assembly builder.
Fix license text in pom.xml, inadvertently reformatted.
Fix a few typos in comments and change LinkedList to Queue.
Move assembly.xml to correct source directory.
Replace ScheduledFuture<?> with CancellableScheduledTask, to satisfy
sonar.
Eliminate "TODO" items: add logging, delay after sending Offline
message.
Add more logging in process(Message) methods.
Begin creating end-to-end junit test, fixed bugs found as a result.
Restore logback-test.xml to WARN.
Fix merge conflict - restored test properties file.

Change-Id: Ic70a8cee49678ea0fc3da309699aec1f6088fe70
Issue-ID: POLICY-728
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "Switch to cambria client 1.2.1-oss"
Pamela Dragosh [Mon, 16 Apr 2018 14:50:54 +0000 (14:50 +0000)]
Merge "Switch to cambria client 1.2.1-oss"

6 years agoMerge "Sonar cleanup"
Jorge Hernandez [Mon, 16 Apr 2018 14:06:32 +0000 (14:06 +0000)]
Merge "Sonar cleanup"

6 years agoAdd missing licenses 45/43045/1
Pamela Dragosh [Mon, 16 Apr 2018 13:40:04 +0000 (09:40 -0400)]
Add missing licenses

Adding missing licenses to files that should not harm
compilation, JUnit tests and instantiation.

Issue-ID: POLICY-741
Change-Id: I3075e3493676ee28693323f978c0b5b210b20a34
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoSwitch to cambria client 1.2.1-oss 23/42823/3
Jim Hahn [Fri, 13 Apr 2018 20:34:35 +0000 (16:34 -0400)]
Switch to cambria client 1.2.1-oss

Switched to new version of cambria client.
Added code to set cambria socket timeout.
Modified code to use cambria client instead of dmaap client.
Removed extra, unnecessary items that had been added to
the top-level pom.xml

Change-Id: If71d36f50da5423ec0cf21b30e66aff5b1c9222a
Issue-ID: POLICY-742
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoSonar cleanup 95/42795/2
Magnusen, Drew (dm741q) [Fri, 13 Apr 2018 18:53:49 +0000 (13:53 -0500)]
Sonar cleanup

Sonar cleanup for distributed-locking

Issue-ID: POLICY-728
Change-Id: I52523a0149436805509706a4a732d1da8a1b4511
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "Update SNAPSHOT to 1.2.1"
Jorge Hernandez [Fri, 13 Apr 2018 20:25:02 +0000 (20:25 +0000)]
Merge "Update SNAPSHOT to 1.2.1"

6 years agoUpdate SNAPSHOT to 1.2.1 83/42783/1
Pamela Dragosh [Fri, 13 Apr 2018 18:25:19 +0000 (14:25 -0400)]
Update SNAPSHOT to 1.2.1

Issue-ID: POLICY-736
Change-Id: Ic293a7347db4e5001a4084e1b98c5d44a145d16c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoSonar fixes for policy-core locks 61/42561/3
Jim Hahn [Thu, 12 Apr 2018 18:23:25 +0000 (14:23 -0400)]
Sonar fixes for policy-core locks

Made a number of changes to the locking code in policy-core, to address
sonar issues.  This entaileed changing some of the Lock API methods to
return OperResult instead of Boolean.
Updated distributed locking with the new API return types.
Simplified Thread creation using functional methods.

Change-Id: If32bf7a435d2aedb969de1b77c7e7e27e110ecb0
Issue-ID: POLICY-728
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "Distributed-locking feature sonar cleanup"
Jorge Hernandez [Thu, 12 Apr 2018 13:56:11 +0000 (13:56 +0000)]
Merge "Distributed-locking feature sonar cleanup"

6 years agoOptionally load available applications 27/41227/1 v1.2.0
Jorge Hernandez [Thu, 5 Apr 2018 17:19:21 +0000 (12:19 -0500)]
Optionally load available applications

During container instantiation, it will check
for available applications to preload, ie. control loop
or any other ones.   It will install them if available
or start with no applications loaded otherwise.

Change-Id: I6908d279cbe34e04bcabf830ed30480ba147598f
Issue-ID: POLICY-735
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoDistributed-locking feature sonar cleanup 45/41045/2
Magnusen, Drew (dm741q) [Wed, 4 Apr 2018 19:44:51 +0000 (14:44 -0500)]
Distributed-locking feature sonar cleanup

Code cleanup and some refactoring to resolve sonar issues.

Issue-ID: POLICY-728
Change-Id: I19051dcc8e1cec293d5d7104e63239fc2b89071e
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoSmall modification to resolve junit failures 97/40997/1
Magnusen, Drew (dm741q) [Wed, 4 Apr 2018 16:52:26 +0000 (11:52 -0500)]
Small modification to resolve junit failures

Added protected method to Heartbeat class that allowed for the passing
of a CountDown latch. This will resolve the timing-related junit
failures in Jenkins environment.

Issue-ID: POLICY-729
Change-Id: I3d2d8bddfb6d9f82be54a2f13bdcd7e1fc65a286
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "disable problematic private keystore"
Pamela Dragosh [Wed, 4 Apr 2018 01:12:07 +0000 (01:12 +0000)]
Merge "disable problematic private keystore"

6 years agoMerge "Add api-resource-locks feature"
Jorge Hernandez [Tue, 3 Apr 2018 21:33:29 +0000 (21:33 +0000)]
Merge "Add api-resource-locks feature"

6 years agoMerge "Add pooling capability"
Jorge Hernandez [Tue, 3 Apr 2018 21:32:51 +0000 (21:32 +0000)]
Merge "Add pooling capability"

6 years agoMerge "Implementation of distributed locking feature"
Jorge Hernandez [Tue, 3 Apr 2018 21:31:12 +0000 (21:31 +0000)]
Merge "Implementation of distributed locking feature"

6 years agodisable problematic private keystore 11/40811/1
Jorge Hernandez [Tue, 3 Apr 2018 21:16:48 +0000 (16:16 -0500)]
disable problematic private keystore

it causes bad interactions fetching dependencies with
nexus libraries, it has been disabled (at least for
the short term) and rely on the JVM one instead.

Change-Id: Ie9d1ae7fe304c06807e457c5bfcf34d07e8d83b8
Issue-ID: POLICY-720
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoImplementation of distributed locking feature 91/37591/26
Magnusen, Drew (dm741q) [Wed, 21 Mar 2018 21:44:45 +0000 (16:44 -0500)]
Implementation of distributed locking feature

This feature is a very basic implementation of a distributed locking
system.

Issue-ID: POLICY-699
Change-Id: I012fd37926ccbbdd87a3e4acb2788b53680115f0
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoAdd api-resource-locks feature 53/40253/8
Jim Hahn [Thu, 29 Mar 2018 19:07:36 +0000 (15:07 -0400)]
Add api-resource-locks feature

Added ResourceLockFeatureAPI, to provide an interface for PolicyGuard
to use to access other locking mechanisms.
Move lock API to policy-core.
Changed the interface and added Callback support.  Added a class to
invoke the API implementers.
Changed to set a future instead of expecting the callback to implement
the future interface. Also refactored, creating "lock" sub-package.
Add junit tests.
Increase junit coverage.
IsLocked & isLockedBy should check all arguments.
Make ImplFuture protected instead of public.
Simplify locking - move callback support to an optional feature.
Move Reference class to policy-utils.
Return plain Future instead of LockRequestFuture.

Change-Id: I65154d33833914b4332e02d1ef2512f4c5f09b16
Issue-ID: POLICY-577
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoCompanion changes to apps startup improvements 81/40581/1
Jorge Hernandez [Mon, 2 Apr 2018 22:53:09 +0000 (17:53 -0500)]
Companion changes to apps startup improvements

see https://gerrit.onap.org/r/40577 for reference

Change-Id: I76eb0d791a012d1ad2046ef27ec9f8b181cf3cb3
Issue-ID: POLICY-534
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Update docker tag convention"
Pamela Dragosh [Thu, 29 Mar 2018 14:31:49 +0000 (14:31 +0000)]
Merge "Update docker tag convention"

6 years agoMerge "persit controller configuration upon restarts"
Pamela Dragosh [Thu, 29 Mar 2018 14:08:10 +0000 (14:08 +0000)]
Merge "persit controller configuration upon restarts"

6 years agoUpdate docker tag convention 05/40105/1
mmis [Thu, 29 Mar 2018 08:47:04 +0000 (09:47 +0100)]
Update docker tag convention

Update docker scripts to comply with ONAP docker standard tag format

$VERSION-STAGING-YYYYMMDDTHHMMSSZ

Issue-ID: CIMAN-132
Change-Id: I7e40c6769612842dceae7698279abc7cbda3ed3f
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoAdd pooling capability 27/38727/3
Jim Hahn [Mon, 26 Mar 2018 20:48:31 +0000 (16:48 -0400)]
Add pooling capability

Add an optional feature that that supports session pooling, wherein
more than one host can be active at a time.
Use beforeInsert() instead of beforeOffer(), where possible.
Move request-id-extraction from policy-managment to feature-pooling.
Combined AdditionalProperties into PoolingProperties.
Finished junit tests for DmaapManager.
Adjusted filters for all XxxState classes, and added testGetFilter to
all XxxStateTest classes.
Always publish Offline message when the internal topic fails.
Remove DelayedExtractor, as it isn't needed.
Renamed ExtractorMap to ClassExtractors, and added property name prefix
to the constructor to give more control over property naming to invokers.
Remove State copy constructor.
Use class name instead of class in ClassExtractors map.
Remove BucketAssignments from ProcessingState.
Remove some TODO items.
Add META-INF for implemented feature APIs.
Fix ClassExtractor bug where it can't find a field in a superclass,
and add a test for classes defined in another file.
Add assembly and rename project directory.
Add more junit coverage.

Change-Id: I7f132f84a7b284a58ab09c9069db19b853acd7e9
Issue-ID: POLICY-577
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoUpgrade jackson 2.9.5 91/39891/1
Pamela Dragosh [Thu, 29 Mar 2018 00:11:44 +0000 (17:11 -0700)]
Upgrade jackson 2.9.5

May not clear the security issue yet as this was just
released.

Issue-ID: POLICY-506
Change-Id: I61eaac9edfb3802c5508a9812d685a1464585af2
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agopersit controller configuration upon restarts 85/39885/1
Jorge Hernandez [Wed, 28 Mar 2018 23:38:53 +0000 (18:38 -0500)]
persit controller configuration upon restarts

case of drools containers restarts or pulling new images.

Change-Id: I30747a605bf1cb5ae351cd1359263728d82afcca
Issue-ID: POLICY-575
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoRemove ECOMP trademark 71/39771/1
Pamela Dragosh [Wed, 28 Mar 2018 18:21:14 +0000 (11:21 -0700)]
Remove ECOMP trademark

Issue-ID: POLICY-696
Change-Id: I98e06bb466c5bae985e55a4a1192b69acae06e89
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "Support server-side filtering for UEB"
Jorge Hernandez [Tue, 27 Mar 2018 15:10:33 +0000 (15:10 +0000)]
Merge "Support server-side filtering for UEB"

6 years agoSupport server-side filtering for UEB 61/38661/2
Jim Hahn [Mon, 26 Mar 2018 20:06:57 +0000 (16:06 -0400)]
Support server-side filtering for UEB

Cambria client supports server-side filtering.  Enhanced the TopicSource
classes that use cambria client to support server-side filtering.
Updated license date in one of the files.

Change-Id: Ia56d73c7a5f3ab960418709c1ea7f1e73aa4ba87
Issue-ID: POLICY-577
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agol2 management maturity pdp-d 51/38351/3
Jorge Hernandez [Mon, 26 Mar 2018 04:34:27 +0000 (23:34 -0500)]
l2 management maturity pdp-d

configurable log location
metric/audit log for transaction metrics conforming to
new field definition.
support metrics/audits records with custom logback filters
so they are not intrusive with developer log testing.

Change-Id: I7a4dcc6790b85539e613ad8705e731e7298ce106
Issue-ID: POLICY-533
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoFix bugs identified by Sonar on drools-pdp 97/37197/2
liamfallon [Tue, 20 Mar 2018 17:28:29 +0000 (17:28 +0000)]
Fix bugs identified by Sonar on drools-pdp

Three bugs fixed:
1. Set of static variable in DMaaPSimulatorJaxR
2. Use of opssibly null variable "output" in RepositoryAudit
3. Unreachable statement error in RepositoryAudit

Change-Id: I72e028cfc51a82250afd02fb4109d3dea08072dc
Issue-ID: POLICY-691
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
6 years agoMerge "Renamed policy-drools docker image"
Pamela Dragosh [Fri, 16 Mar 2018 12:46:41 +0000 (12:46 +0000)]
Merge "Renamed policy-drools docker image"

6 years agoUpdate oparent version to 1.1.0 37/35837/1
liamfallon [Wed, 14 Mar 2018 21:39:40 +0000 (21:39 +0000)]
Update oparent version to 1.1.0

Directive from ONAP project that all repos should be
updated. Change vierified with a build with .m2 /org/onap
cleared.

Change-Id: I19d3554bdc9aef4576de1917d5258f23a4ec42d9
Issue-ID: POLICY-693
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
6 years agoRenamed policy-drools docker image 77/35777/2
mmis [Wed, 14 Mar 2018 12:10:52 +0000 (12:10 +0000)]
Renamed policy-drools docker image

Renamed from:
onap/policy/policy-drools
to
onap/policy-drools
to enable consistent naming across nexus and docker hub

Issue-ID: POLICY-674
Change-Id: Ib0b9df97f398c5c1715f736f11f6481cf6d8427f
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoUnit test modified to be order independent 73/35773/1
liamfallon [Wed, 14 Mar 2018 13:41:17 +0000 (13:41 +0000)]
Unit test modified to be order independent

The change of dmaap version caused the order of execution of unit tests to
change. This triggered an assertion fail in this test. The test has been redesigned
to be independent of test invocation order.

Also some small Sonar issues fixed.

Change-Id: I3b3a5b1cb69785c69f818eab2473fdbfbb85dbd1
Issue-ID: POLICY-694
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
6 years agoUpgrade dmaap release 1.1.3 45/35745/1
Pamela Dragosh [Wed, 14 Mar 2018 12:18:29 +0000 (08:18 -0400)]
Upgrade dmaap release 1.1.3

Dmaap released this dependency, the snapshot is no longer
available.

Issue-ID: POLICY-694
Change-Id: Ia376af2e457ae95d5f16a90e6c6f3a08653f4b37
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "configurable logs dir and creation as root"
Pamela Dragosh [Fri, 9 Mar 2018 14:20:37 +0000 (14:20 +0000)]
Merge "configurable logs dir and creation as root"

6 years agoconfigurable logs dir and creation as root 75/34675/3
Jorge Hernandez [Thu, 8 Mar 2018 06:17:33 +0000 (00:17 -0600)]
configurable logs dir and creation as root

Change-Id: Ib23ee897372f0911394441739da5c7b9e7398910
Issue-ID: POLICY-554
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoRemove filtering from packages/docker/pom 63/34763/1
mmis [Thu, 8 Mar 2018 12:16:33 +0000 (12:16 +0000)]
Remove filtering from packages/docker/pom

Filtering should not be applied in the maven-resources-plugin execution as
this incorecttly modifes the scripts copied by this plugin

Issue-ID: POLICY-652
Change-Id: I57595711c4a6f4522d679016370012e0dc8833d6
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoCopy files for docker image in packages/docker/pom 27/34327/2
mmis [Tue, 6 Mar 2018 17:48:31 +0000 (17:48 +0000)]
Copy files for docker image in packages/docker/pom

Copying the files in the pom removes the need to do the copying in various
locations the docker build is executed from and allows the docker image be
built without building the entire repo (as the install.zip can be pulled
from nexus)

Issue-ID: POLICY-652
Change-Id: I77d0f76bd1c11261b3d4d8bdd60572e545a98aa1
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoMerge "Update Dockerfile to remove policy-base, policy-os"
Pamela Dragosh [Mon, 5 Mar 2018 18:51:25 +0000 (18:51 +0000)]
Merge "Update Dockerfile to remove policy-base, policy-os"

6 years agoUpdate Dockerfile to remove policy-base, policy-os 03/34103/1
mmis [Mon, 5 Mar 2018 18:05:19 +0000 (18:05 +0000)]
Update Dockerfile to remove policy-base, policy-os

Correction to previous commit "Move docker_*.sh scripts into
policy/engine" as attempt to build docker image will result in failure to
pull the policy-base image from nexus
The policy-base and policy-os images are removed in favour of including
the contents of those images directly in the policy-pe image

Issue-ID: POLICY-651
Change-Id: I46f4ac0d529fc95ea702809eee466af3d1121717
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoMerge "Upgrade dmaap client"
Jorge Hernandez [Fri, 2 Mar 2018 21:46:14 +0000 (21:46 +0000)]
Merge "Upgrade dmaap client"

6 years agoUpgrade dmaap client 45/33845/1
Pamela Dragosh [Fri, 2 Mar 2018 20:15:53 +0000 (15:15 -0500)]
Upgrade dmaap client

This should have security fixes

Issue-ID: POLICY-619
Change-Id: I8636117f3f599e0fb86ded8b292112205f5d8c7c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMove docker_*.sh scripts in policy/drools-pdp 31/33831/1
mmis [Fri, 2 Mar 2018 18:04:48 +0000 (18:04 +0000)]
Move docker_*.sh scripts in policy/drools-pdp

Added files for building policy-drools docker image

Issue-ID: POLICY-623
Change-Id: If335653d6ede74ae808c3fddf84ee96d88a75727
Signed-off-by: mmis <michael.morris@ericsson.com>
6 years agoForce dependency upgrade and exclusions 93/32593/1
Pamela Dragosh [Thu, 22 Feb 2018 16:58:47 +0000 (11:58 -0500)]
Force dependency upgrade and exclusions

LCM security issues are identified with plexus-utils and xstream. There
is no clear upgrade to the org.kie.* dependencies with a fix for both of
these. We will determine via testing as to whether these exclusions will
result in failure.

Issue-ID: POLICY-506
Change-Id: I9cefb814bb11a9babc4e4a2e47071ab74a46c011
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "interception of facts before injection"
Pamela Dragosh [Wed, 21 Feb 2018 12:52:41 +0000 (12:52 +0000)]
Merge "interception of facts before injection"

6 years agoSonar fixes to drools-pdp 39/32139/3
Jim Hahn [Mon, 19 Feb 2018 21:56:06 +0000 (16:56 -0500)]
Sonar fixes to drools-pdp

Fixed most of the instances of the following sonar issues:
Moved array designator
Used diamond operator
Changed System.out/err to use a logger
Changed several Thread.sleep() in test code to a single sleep()
Useless assignments
Replaced comparison with "" to string.isEmpty()
Merged if's
Replaced ArrayList with List in method returns
Reordered type modifiers
Reordered constructor methods
Defined constants for literals, or replaced them with method calls
Removed "throws Xxx" for subclasses of RuntimeException
Combined identical "catch" blocks
Re-interrupted the current thread after catching an InterruptedException
Removed tests against the literal "false"

Fix indentation of new makeTopicOperError() method.
Fix exception variable name in new methods, logNoUebEncoder()
and logNoDmaapEncoder().

Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94
Issue-ID: POLICY-336
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agointerception of facts before injection 11/32111/3
Jorge Hernandez [Mon, 19 Feb 2018 16:16:02 +0000 (10:16 -0600)]
interception of facts before injection

Added interceptor to drools controller, post-decoding and
pre/after injection into kie sessions.   The decoded
object is passed as is.   The set of hooks will be
expanded in the future.

This is added in the context of logging for POLICY-558
to track control loop transactions, per logging requirements.
The idea is that VirtualControlLoopNotifications on the
drools-applications area will use it to track control loop
transactions, times, etc .. to satisfy logging requirements.
This approach also reliefs the drools applications logic, (.drl)
for dealing with this.   The logic therefore will be isolated into
a single feature.

Change-Id: Idf840c528e6175be4aaee3bf114091c203b37bc8
Issue-ID: POLICY-558
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoFix compilation issue due to generic Exception 15/32115/1
Jim Hahn [Mon, 19 Feb 2018 16:17:19 +0000 (11:17 -0500)]
Fix compilation issue due to generic Exception

After modifying common to remove generic Exceptions, drools-pdp would
no longer compile.  Had to modify drools-pdp to accomodate the
specific exception.

Change-Id: Ib804da2ebfc7dbf5f4035ba3d48832ffe541f902
Issue-ID: POLICY-246
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoModify sonar settings to include all sub-modules 79/31979/2
Pamela Dragosh [Fri, 16 Feb 2018 15:30:56 +0000 (10:30 -0500)]
Modify sonar settings to include all sub-modules

We are now including all the sub-modules coverage into one file.
This will now reflect correct statistics for any sub-module that
tests code located in another sub-module.

Issue-ID: POLICY-634
Change-Id: I916d90c27b316837284a635087665130dee5437b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoReplace bitronix and eclipselink in persistence 69/31769/1
Jim Hahn [Wed, 14 Feb 2018 17:52:31 +0000 (12:52 -0500)]
Replace bitronix and eclipselink in persistence

Replaced bitronix transaction manager, which is not intended for production,
with jboss transaction manager.
Eliminated eclipselink so that only hibernate is used for
persistence for both JPA and drools-persistence.
Added more test cases to EntityMgrTrans to provide coverage for
various exception types.
Moved object store to features/session-persistence/jta.
Wrapped RuntimeException in specific type.
Modified test to throw specific exception type.
Converted GenSchema from an @Test to a main().
Logged caught exceptions in junit tests.

Change-Id: I4b02efc8da43d20b2dbb3c0b25adc382e80474ec
Issue-ID: POLICY-191
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoprotocol coder and null drools controller junits 13/31613/1
Jorge Hernandez [Tue, 13 Feb 2018 16:32:30 +0000 (10:32 -0600)]
protocol coder and null drools controller junits

Change-Id: Ie26a8cd44a39007e38c9dc8c28418e988df70c77
Issue-ID: POLICY-583
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoUpgrade Jetty to remove security warning 83/31083/1
Pamela Dragosh [Fri, 9 Feb 2018 14:22:23 +0000 (09:22 -0500)]
Upgrade Jetty to remove security warning

This may not be red status, but I felt it was worthwhile to
upgrade this. It resolves a timing issue when checking passwords.

Issue-ID: POLICY-506
Change-Id: I926d2ee90529130d0c74285f4c4876083eb78f1f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "protocol coder junits"
Jorge Hernandez [Thu, 8 Feb 2018 21:31:43 +0000 (21:31 +0000)]
Merge "protocol coder junits"

6 years agoprotocol coder junits 15/30915/1
Jorge Hernandez [Thu, 8 Feb 2018 19:46:28 +0000 (13:46 -0600)]
protocol coder junits

Change-Id: I7a02a8767dbb19724715e057b1da82f7045d6a44
Issue-ID: POLICY-583
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoprogramatic install of rules artifacts for junits 13/30913/1
Jorge Hernandez [Thu, 8 Feb 2018 19:35:44 +0000 (13:35 -0600)]
programatic install of rules artifacts for junits

instead of relying on pom.xml, build settings.
since jenkins jobs that generate sonars don't
seem to go through a build phase anymore, therefore
the preceding artifacts are not available in the
local repository, which is required by the tests.

Change-Id: Icfd14b2f8a6c6e1ac7d986bd6eb977b2a83b044d
Issue-ID: POLICY-621
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "expose immutable list of filters to its users"
Pamela Dragosh [Thu, 8 Feb 2018 16:19:57 +0000 (16:19 +0000)]
Merge "expose immutable list of filters to its users"

6 years agoSecurity issue with jackson-databind 73/30873/1
Pamela Dragosh [Thu, 8 Feb 2018 12:45:28 +0000 (07:45 -0500)]
Security issue with jackson-databind

I should have upgraded to 2.9.4, my mistake. This has the
actual fix in it for the security issue.

Issue-ID: POLICY-506
Change-Id: I11d22b83a60789160852e17204ac3c03cb44f6c1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoexpose immutable list of filters to its users 15/30715/2
Jorge Hernandez [Wed, 7 Feb 2018 21:36:34 +0000 (15:36 -0600)]
expose immutable list of filters to its users

+ additional related junits

Change-Id: I00293cd9aa911dfb3d658cad4ee0441ad3410e9c
Issue-ID: POLICY-164
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoUpgrade dependencies to solve security issues 99/30699/2
Pamela Dragosh [Wed, 7 Feb 2018 18:02:32 +0000 (13:02 -0500)]
Upgrade dependencies to solve security issues

Not guaranteed, but these are dependencies that we can fix that will hopefully
close some of the security issues flagged by LF.

Issue-ID: POLICY-506
Change-Id: I2ddd5254e53241159f9483b5442cac6f8a1bdbab
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoFix sonar issues with RepositoryAudit 07/30307/2
Jim Hahn [Mon, 5 Feb 2018 15:52:07 +0000 (10:52 -0500)]
Fix sonar issues with RepositoryAudit

Per sonar, removed commented code from RepositoryAudit.

Change-Id: Ia81780f7528bd4fc42062454728a2c215709ea45
Issue-ID: POLICY-469
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoReduce technical debt add coverage 51/30051/2
Pamela Dragosh [Thu, 1 Feb 2018 20:10:57 +0000 (15:10 -0500)]
Reduce technical debt add coverage

* add empty constructor message
* remove unnecessary exception declaration
* add @FunctionalInterface declaration
* switched around public static per java conventions
* fixed up JUnit ordering
* added some trivial JUnit tests to bump coverage > 70%

Issue-ID: POLICY-460
Change-Id: I13b6de29f66d692143b06180feed76dd6332d6cf
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "Fix sonar issues in feature-state-management"
Jorge Hernandez [Thu, 1 Feb 2018 17:21:46 +0000 (17:21 +0000)]
Merge "Fix sonar issues in feature-state-management"

6 years agoMerge "Fix sonar code issues for api-state-management"
Jorge Hernandez [Thu, 1 Feb 2018 15:16:28 +0000 (15:16 +0000)]
Merge "Fix sonar code issues for api-state-management"

6 years agoMerge "junits+utils to generate/test rules applications"
Jorge Hernandez [Thu, 1 Feb 2018 15:05:17 +0000 (15:05 +0000)]
Merge "junits+utils to generate/test rules applications"

6 years agofix typo when configuring fetch-limit parameter 41/29941/1
Jorge Hernandez [Thu, 1 Feb 2018 05:56:20 +0000 (23:56 -0600)]
fix typo when configuring fetch-limit parameter

Change-Id: Iea108fe035bea14e2ecd12db68b331dd2d546591
Issue-ID: POLICY-596
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoFix sonar issues in feature-state-management 93/29893/1
Jim Hahn [Wed, 31 Jan 2018 22:49:08 +0000 (17:49 -0500)]
Fix sonar issues in feature-state-management

DroolsPDPIntegrityMonitor.java:
Modified init() to throw just IntegrityMonitorException.
Modified DroolsPDPIntegrityMonitor init() method to throw specific
types of exceptions.

StateManagementFeature.java:
Sonar complained about needing to merge "if" statements, but chose
to eliminate the "if(logger.isDebugEnabled())" instead - did this
through-out the source file.
Removed extra runtime exception from "throws" declaration.

DbAudit.java:
Fixed sonar issue regarding setting a static variable from within
a non-static method.
Removed logger.isDebugEnabled() tests where method calls are not involed.
Simplified invoke() method complexity as reported by sonar.

DroolsPDPIntegrityMonitor.java:
Reduced init() complexity reported by sonar.

Change-Id: Ib2722b21bbf3aad130af46c8790f40d8777e36be
Issue-ID: POLICY-469
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoFix sonar code issues for api-state-management 91/29891/1
Jim Hahn [Wed, 31 Jan 2018 22:16:13 +0000 (17:16 -0500)]
Fix sonar code issues for api-state-management

Renamed constants, adding "DO_" prefix or "_STATE" suffix.
Removed spurious exceptions from "throws" clauses.

Change-Id: I0abd74d736009480614f0653fe5aaf1ddbe77b08
Issue-ID: POLICY-468
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agojunits+utils to generate/test rules applications 77/29877/2
Jorge Hernandez [Wed, 31 Jan 2018 18:31:05 +0000 (12:31 -0600)]
junits+utils to generate/test rules applications

1. utilities to generate rules applications and installing
in local maven repository programmatically.

2. using these utilities, use policy abstractions, ie.
controllers, containers, .. to junit test it.

Change-Id: I13c35e631a1120fad503feef2593d32a99e3358f
Issue-ID: POLICY-583
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoResolve bug in DroolsPDPIntegrityMonitor 87/28587/1
Magnusen, Drew (dm741q) [Thu, 18 Jan 2018 21:20:59 +0000 (15:20 -0600)]
Resolve bug in DroolsPDPIntegrityMonitor

This fix ensures that the testServices, testRestClasses, tesManaged, and
testSwagger properties are all populated in the stateManagementProperties
object within DroolsPDPIntegrityMonitor class.

Issue-ID: POLICY-564
Change-Id: Ie517b19f61ab084416ce1e6f8418d69dc9e4f85d
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoInitialize allSeemsWell Correctly 73/27673/1
Kevin McKiou [Mon, 8 Jan 2018 22:35:43 +0000 (16:35 -0600)]
Initialize allSeemsWell Correctly

Patch 1:
Correctly initialize DroolsPdpsElectionHandler.allSeemsWell upon
the first call to checkWaitTimer().

Issue-ID: POLICY-519
Change-Id: I0b9ad0bfba211d705c2d9f9305694956ca3951b6
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoMerge "Fix issues blocking election handler thread"
Jorge Hernandez [Thu, 21 Dec 2017 18:13:51 +0000 (18:13 +0000)]
Merge "Fix issues blocking election handler thread"

6 years agoMerge "Reduce tech debt in policy-management"
Jorge Hernandez [Thu, 21 Dec 2017 18:09:32 +0000 (18:09 +0000)]
Merge "Reduce tech debt in policy-management"

6 years agoReduce tech debt in policy-management 41/26341/3
Magnusen, Drew (dm741q) [Thu, 14 Dec 2017 21:29:07 +0000 (15:29 -0600)]
Reduce tech debt in policy-management

Changes to reduce tech debt in the policy-management module.

Issue-ID: POLICY-463
Change-Id: I41f6b66d25a805706e5c9ed2cef2eda256153a37
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoAdd a DMaaP simulator 29/26329/2
Charles Cole [Thu, 14 Dec 2017 14:59:26 +0000 (08:59 -0600)]
Add a DMaaP simulator

Added a DMaaP simulator for testing applications.  One current
limitation is that the simulator does not support multiple "subscribers"
on the same topic; if someone gets a message, that message cannot be
subsequently retrieved by anyone else.  The simulator has also not been
tested for concurrent getting and posting.

Also added a way to set the response code DMaaP would return for a get
to test that policy can gracefully handle errors.

It may need some work to become truely its own "feature"

Issue-ID: POLICY-489
Change-Id: I524981bdf5e4e825f13e6197dda11d9498e4f4bf
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoFix issues blocking election handler thread 63/26263/1
Kevin McKiou [Wed, 13 Dec 2017 21:26:59 +0000 (15:26 -0600)]
Fix issues blocking election handler thread

This bug tracks the AT&T bug 355533.  The symptom was that drools
pdps that were backing each other up were becoming stuck in a
standby state.  The cause was that the election handler thread was
being hung by a call to PolicyEngine.manager.deactivate which shuts
down the topic endpoints when the drools pdp operational state
transitions to disabled. Related problems were that the election
handler heartbeat was NOT blocked when the main thread was blocked
and the IntegrityMonitor forward progress counter was NOT blocked
from incrementing when the election handler thread was blocked.
This prevented the correct failover of the drools pdp to another
healthy one. This change fixes the two causes of the thread blockage,
moves the election handler heartbeat to the main thread and adds an
interface (AllSeemsWell) which is called when the election handler
has stalled/resumed. The AllSeemsWell interface will block forward
progress counter increments when ALLNOTWELL and will resume forward
progress counter increments when ALLSEEMSWELL. In addition, it reduces
the run time of the StandbyStateManagementTest from approximately 8
minutes to approximately 2 minutes. Since this changes classes also
changed by POLICY-444, this change must be merged before POLICY-444
can be merged.

Issue-ID: POLICY-501
Change-Id: I7b8180d11077ccf59b21b6484cb58b5522a3df8f
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoMerge "Multiple small changes to reduce technical debt."
Jorge Hernandez [Fri, 8 Dec 2017 19:03:05 +0000 (19:03 +0000)]
Merge "Multiple small changes to reduce technical debt."

6 years agoMultiple small changes to reduce technical debt. 81/25281/2
Magnusen, Drew (dm741q) [Thu, 30 Nov 2017 19:38:37 +0000 (13:38 -0600)]
Multiple small changes to reduce technical debt.

Made multiple changes across several classes to reduce technical debt in
policy-endpoints project.

Issue-ID: POLICY-462
Change-Id: I0338b9e98dd5a39492f3880c2e3a5d35b3957811
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agofeature-healthcheck technical debt 05/25605/1
Magnusen, Drew (dm741q) [Tue, 5 Dec 2017 20:56:32 +0000 (14:56 -0600)]
feature-healthcheck technical debt

Made multiple changes to feature-healthcheck module to reduce technical
debt identified by sonar.

Issue-ID: POLICY-464
Change-Id: Ie168821611db5c0b171114e4fdd90411ce38a796
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "Modified state mgmt to fix some sonar issues"
Jorge Hernandez [Fri, 1 Dec 2017 22:11:12 +0000 (22:11 +0000)]
Merge "Modified state mgmt to fix some sonar issues"

6 years agoModified state mgmt to fix some sonar issues 91/25191/4
Jim Hahn [Wed, 29 Nov 2017 22:01:15 +0000 (17:01 -0500)]
Modified state mgmt to fix some sonar issues

Reordered modifiers.
Reordered variables, methods, and constructors.
Removed useless parentheses.
Removed unneeded "catch" clauses.
Extracted nested try blocks into their own method.
Replaced a string with a constant.
Removed extra thrown exceptions when they are unnecessary (i.e., they're
subclasses of RuntimeException, or the method is already declared to
throw an Exception).
Replaced a large anonymous class with a named, nested class.
Separated variable declarations onto individual lines.
Changed "String args[]" to "String[] args".
Replaced if-then-else by single return statement.
Invoked super() inside empty, default constructor.
Removed Thread.sleep() calls from junit test per comments on 11/29.

Commented out Thread.sleep() in junit tests, as they don't appear to
be necessary.  If that turns out to be untrue, then CountdownLatch.await()
can be used instead.

Sonar complained about useless assignments to "phase", but those did
not appear to be useless.
Did not remove commented-out lines, as they may be needed when debugging.

Change-Id: I90ba6f7317a18a10ce1b881cfc6d21a602171ff5
Issue-ID: POLICY-469
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoFix sonar-maven-plugin version mismatch 35/25335/1
Hockla, Ali (ah999m) [Fri, 1 Dec 2017 20:08:51 +0000 (14:08 -0600)]
Fix sonar-maven-plugin version mismatch

Removed the sonar-maven-plugin tag from drools-pdp/pom.xml as it contained
a different groupId than the one in oparent.

Change-Id: Ibb8e798a4360eaa78c7e2430a398a1b71b9174f6
Issue-ID: POLICY-485
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
6 years agoMerge "make volatile access to alive and locked flags"
Jorge Hernandez [Fri, 1 Dec 2017 16:48:58 +0000 (16:48 +0000)]
Merge "make volatile access to alive and locked flags"

6 years agomake volatile access to alive and locked flags 25/25225/1
Jorge Hernandez [Thu, 30 Nov 2017 16:12:33 +0000 (10:12 -0600)]
make volatile access to alive and locked flags

instead of synchronized read access

Change-Id: I3f4457f798d6f4d4a013bf023ed2d9c1b75d4f1f
Issue-ID: POLICY-487
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Refactored code to reduce technical debt."
Pamela Dragosh [Thu, 30 Nov 2017 15:26:33 +0000 (15:26 +0000)]
Merge "Refactored code to reduce technical debt."

6 years agoRefactored code to reduce technical debt. 81/25181/2
Magnusen, Drew (dm741q) [Wed, 29 Nov 2017 20:01:06 +0000 (14:01 -0600)]
Refactored code to reduce technical debt.

Major changes in this commit include the refactoring of the run method in
TestTransaction.java to reduce the amount of technical debt identified by
sonar. Other small changes were also made.

Issue-ID: POLICY-467
Change-Id: I2522f690de58e3c6f4cc894e6dea47277404d745
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "Made some changes per sonar"
Pamela Dragosh [Thu, 30 Nov 2017 13:52:15 +0000 (13:52 +0000)]
Merge "Made some changes per sonar"

6 years agoMade some changes per sonar 87/25187/1
Jim Hahn [Wed, 29 Nov 2017 20:25:38 +0000 (15:25 -0500)]
Made some changes per sonar

Reordered modifiers.
Used diamond operator.

Change-Id: Iba3a2e035dd233574058f426744d1722a30083f7
Issue-ID: POLICY-468
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoFix Sonar issues in policy-core 79/25179/1
Charles Cole [Tue, 28 Nov 2017 22:20:32 +0000 (16:20 -0600)]
Fix Sonar issues in policy-core

Fixed the Sonar issues in policy-core that required minimal refactoring
of the code.

Issue-ID: POLICY-461
Change-Id: I3d0f7c4411855b2c75d5ae6968665753b50bde75
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoFix Sonar issues in policy-utils 03/25103/2
Charles Cole [Tue, 28 Nov 2017 15:58:37 +0000 (09:58 -0600)]
Fix Sonar issues in policy-utils

Fixed the Sonar issues in policy-utils that required minimal
refactoring of the code.

Issue-ID: POLICY-460
Change-Id: Ie88fb1d819f343c8c0bc4d0b73e41089d79cdb6c
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agoElection Handler Cleanup 51/24751/1
Kevin McKiou [Tue, 21 Nov 2017 19:29:49 +0000 (13:29 -0600)]
Election Handler Cleanup

Under stress, the election handler in feature-active-standby-management
may not get a chance to run within the allowed window causing the
"watcher" thread to kill it and restart it.  The run window is
expanded.  Also the pdp.updateInterval and pdp.checkInterval
parameter values are increased appropriately in the properties file.

Issue-ID: POLICY-484
Change-Id: I0c1c2d4fdfbc408be929c56e451b92fc7ad4464a
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoMerge "Fix fortify issues identified in drools"
Pamela Dragosh [Tue, 21 Nov 2017 17:40:58 +0000 (17:40 +0000)]
Merge "Fix fortify issues identified in drools"