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

6 years agoMerge "Modified dmaapClient dependency GroupId/Version"
Pamela Dragosh [Tue, 21 Nov 2017 17:40:19 +0000 (17:40 +0000)]
Merge "Modified dmaapClient dependency GroupId/Version"

6 years agoModified dmaapClient dependency GroupId/Version 33/24733/1
Magnusen, Drew (dm741q) [Tue, 21 Nov 2017 16:56:05 +0000 (10:56 -0600)]
Modified dmaapClient dependency GroupId/Version

Changed GroupId of dmaapClient dependency to
org.onap.dmaap.messagerouter.mirroragent and version to 1.0.0.

Issue-Id: POLICY-370
Change-Id: I165d6f0b4a64a80f344646ea1972654718ebbf96
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoBump minor version 93/24293/2
Jessica Wagantall [Sun, 19 Nov 2017 02:47:57 +0000 (18:47 -0800)]
Bump minor version

Bump minor version in preparation for Amsterdam
branching.

Change-Id: I7a10894837580ae898573156e47e31f32ae0d041
Issue-ID: CIMAN-120
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
6 years agoUpdate to 1.1.2-SNAPSHOT 81/23681/1
Pamela Dragosh [Wed, 15 Nov 2017 20:15:07 +0000 (15:15 -0500)]
Update to 1.1.2-SNAPSHOT

One last file was forgotten - released 1.1.1. Bump patch to 1.1.2

Issue-ID: POLICY-436
Change-Id: I509efb33da9aa49b8c6b47927fca0c056d5401e2
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoUpdate to 1.1.2-SNAPSHOT 47/23647/1
Pamela Dragosh [Wed, 15 Nov 2017 16:58:28 +0000 (11:58 -0500)]
Update to 1.1.2-SNAPSHOT

Released 1.1.1, bump patch to 1.1.2

Issue-ID: POLICY-436
Change-Id: Idc58c1dc0cd66243ca1b94cce2ef4254ef2d87c8
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoFix release process 03/23203/2 1.0.0-Amsterdam 1.0.0-ONAP v1.1.1
Pamela Dragosh [Sat, 11 Nov 2017 01:07:52 +0000 (20:07 -0500)]
Fix release process

Missing staging repo

Issue-ID: POLICY-441
Change-Id: I09aeda29fe3838cf6f4cd2ed01009af541b1566d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoFix fortify issues identified in drools 65/23165/1
Joseph Chou [Fri, 10 Nov 2017 18:15:23 +0000 (13:15 -0500)]
Fix fortify issues identified in drools

Fix code identified by Fortify as Privacy Violation

Issue-ID: POLICY-442

Change-Id: I6097fb203a53a9643c4c4c38185515b1c8a90282
Signed-off-by: Joseph Chou <jc2555@att.com>
6 years agoUpdate SNAPSHOT version 25/22625/3
Pamela Dragosh [Wed, 8 Nov 2017 02:11:27 +0000 (21:11 -0500)]
Update SNAPSHOT version

Releasing v1.1.0 so we need to update SNAPSHOT

Issue-ID: POLICY-436
Change-Id: I0c24b0c9a5bd67471ad0fb8b8c17b77e5b70b44f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoModify state-management properties 55/21055/3 v1.1.0
Kevin McKiou [Wed, 1 Nov 2017 19:18:12 +0000 (14:18 -0500)]
Modify state-management properties

Patch 1:
Removed hostPort and added server.TEST properties from
feature-state-management.properties and modified associated
code in IntegrityMonitor and properties in associated JUnit tests.
Patch 2:
Modified in response to comments from Jorge Hernandez.  Including
adding contant usage instead of strings and replacing generic exceptions
with specific exceptions.
Patch 3:
Tied property constants to PolicyProperties. Added default property
contants.  Added error/warning log statemeents when something other
than expected value is used.  Add logging of all constant values
for inspection in debugging.

Issue-ID: POLICY-369
Change-Id: Ie2218b68761e0338642a2ed28ef840b1b6ece1a4
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoclean leftover items in parent pom pre-release 89/21389/3
Jorge Hernandez [Mon, 30 Oct 2017 22:27:08 +0000 (17:27 -0500)]
clean leftover items in parent pom pre-release

snapshot dependencies are not permitted
it should an actual released version, or project.version
if the plan is to release it at the same time.

the maven version plugin was also left over from
previous oparent work

documenting accepted version of xml-apis.

Change-Id: I8b76bd9befdf69674aafe7b14bfbcc7d2f938062
Issue-ID: POLICY-404
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoshutdown to guarantee termination 91/20691/4
Jorge Hernandez [Thu, 26 Oct 2017 04:04:42 +0000 (23:04 -0500)]
shutdown to guarantee termination

This method will ensure that once the shutdown sequence is
started, it terminates either gracefully or forcefully after
the grace time period expiration.

It has been occassionally observed that the shutdown
sequence gets stuck in the shutdown sequence of a subcomponent,
such as a drools applications.   This will guarantee that
the shutdown completes regardless.

Change-Id: I8379eea5f0b80fe6a5aed6da2f2bfbfcb1f24bc0
Issue-ID: POLICY-386
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agofix migration when iterating through DBs 87/19787/1
Jorge Hernandez [Thu, 19 Oct 2017 19:09:51 +0000 (14:09 -0500)]
fix migration when iterating through DBs

Change-Id: Ib243572c2395c9e122af3bff24d1fd8b89300166
Issue-ID: POLICY-357
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoResolved bug present in building ueb sink. 69/19569/1
Magnusen, Drew (dm741q) [Wed, 18 Oct 2017 16:51:09 +0000 (11:51 -0500)]
Resolved bug present in building ueb sink.

Logic inside the build method for IndexedUebTopicSinkFactory attempts
to retrieve the https property for the sink using the UEB_SOURCE_TOPICS
prefix, rather than the UEB_SINK_TOPICS prefix.

Issue-ID: POLICY-353
Change-Id: I7207d10bb7309555f49250d1eb99e91470c2f3bb
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "sessioninfo to mediumblob"
Jorge Hernandez [Tue, 10 Oct 2017 02:29:32 +0000 (02:29 +0000)]
Merge "sessioninfo to mediumblob"

6 years agoRegister a gson type adapter for Instant 23/17723/2
Charles Cole [Mon, 9 Oct 2017 19:50:36 +0000 (14:50 -0500)]
Register a gson type adapter for Instant

Added a type adapter to the encoder used without a custom encoder so
that it properly serializes Instant types.

Issue-ID: POLICY-101
Change-Id: Ic1517505d50b81abc840a1591c7fb4a75f80a126
Signed-off-by: Charles Cole <cc847m@att.com>
6 years agosessioninfo to mediumblob 33/17733/1
Kevin McKiou [Mon, 9 Oct 2017 21:11:57 +0000 (16:11 -0500)]
sessioninfo to mediumblob

The sessioninfo is currently defined as a blob which is
too small in practice.  This changes the definition to
a mediumblob.

Issue-ID: POLICY-301
Change-Id: I482cf08a4c4a34c4e1b7e07876984e5e3b8b1c63
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agosend messages directly through topic 69/17669/1
Jorge Hernandez [Mon, 9 Oct 2017 13:07:36 +0000 (08:07 -0500)]
send messages directly through topic

This work is needed for consolidating the amsterdam templates used
both for junits and the official one from the archetype into one,
so junits can run in the official one.

This work revisits the functionality of when a drools controller
cannot be found to check state before delivering a message from
the drools application, it will use a standalone enconder
(previously configured to do so).

This was intended to work like this originally, but never tested
nor used as all deliveries are send through the controllers so
locked/alive state is checked (but there may ocassions where we
want to take this default action).

Change-Id: Ie23e4e13323f3ab9fd207f8a396c1af6564b7edf
Issue-ID: POLICY-101
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoApply review changes, and correct warnings 71/16671/6
Mike Babinski [Thu, 28 Sep 2017 22:15:32 +0000 (22:15 +0000)]
Apply review changes, and  correct  warnings

Issue-ID: POLICY-109
Change-Id: I3a221351e5c68514413c5744334b8c80578c3a02
Signed-off-by: Mike Babinski <mb1915@att.com>
6 years agopolicy-engine.properties to be honored if exists 23/16423/1
Jorge Hernandez [Thu, 28 Sep 2017 14:07:04 +0000 (09:07 -0500)]
policy-engine.properties to be  honored if exists

Change-Id: I9c8c7d56a1087a0514f4d53be293e287a26ae1bf
Issue-ID: POLICY-265
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Additional RestManager junits"
Jorge Hernandez [Thu, 28 Sep 2017 04:01:21 +0000 (04:01 +0000)]
Merge "Additional RestManager junits"

6 years agoSonarCube Critical Issue 09/16109/1
Kevin McKiou [Wed, 27 Sep 2017 21:06:33 +0000 (16:06 -0500)]
SonarCube Critical Issue

Patch 1: Modifying DbAudit to access isJunit variable
to, hopefully, satisfy SonarCube on a critical issue.

Issue-ID: POLICY-261
Change-Id: Ibc1a2876bdf08377798c503110b05e79a0986c38
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoAdditional RestManager junits 95/16095/1
Magnusen, Drew (dm741q) [Wed, 27 Sep 2017 18:52:59 +0000 (13:52 -0500)]
Additional RestManager junits

Added more junits to RestManagerTest.java to increase coverage
of the RestManger class to >29%.

Also cleaned up the RestManagerTest class.

Issue-Id: POLICY-109
Change-Id: I16885a945579f6aac203b47cf05294396bba2b15
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoUpgrade to release oparent 25/14325/2
Pamela Dragosh [Thu, 21 Sep 2017 17:35:23 +0000 (13:35 -0400)]
Upgrade to release oparent

Following independent release and versioning process guidelines.

Removed 'parent' from 'drools-artifact1' pom.xml files --
hopefully, this will get around the build problems.

Issue-ID: POLICY-225
Change-Id: I27af13edd1a39daee09c8bca6ff726881144212e
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agojunits fixes 07/15307/2
Jorge Hernandez [Tue, 26 Sep 2017 02:49:31 +0000 (21:49 -0500)]
junits fixes

I found multiple issues from latest junit submissions when I built in
my local that I tried to fix.

1.  feature-test-transaction - prone to race conditions as we have
    experienced in some jenkins builds.   There is an assert that checks
    if the thread is alive that monitors a policy controller kiesession
    sanity.  The thread is very short-lived as it will exit right away
    since it detects that the underlying "drools session"
    does not have an attached rules artifact (brainless).
    Removed that check to fix the race condition.

2.  With the increment of junits in the PolicyEngine.manager for
    multiple packages, it seems that the static instance is reused
    across junits (which surprised me), so configuration files that
    are not supposed to be read in junits for a package are
    read, and for example the lock state could propagate across junits.
    I tried to clean all that up to make sure that each junit deals with
    what is has created and state does not propagate to other junits.

3.  feature-active-standy-management had a missing "junit" dependency.
    I generated the effective pom, and indeed did not show, some junits
    failed to compile in the test phase.  Adding the test dependency
    fixed the problem.

As a note, the feature-active-standy-management junits, take over 20 minutes to run.
This time is excessive (see below):

logs$ head -1 debug.log

2017-09-25 21:24:21.630 [main] DEBUG o.o.p.d.c.t.StandbyStateManagementTest.setUpClass(111) - setUpClass: userDir=/media/sf_jh1730/dev/open/LF/git/master/policy/drools-pdp/feature-active-standby-management

logs$ tail -1 debug.log

2017-09-25 21:46:29.801 [Timer-46] DEBUG o.o.p.d.a.DroolsPdpsElectionHandler.run(919) - TimerUpdateClass.run.exit

Change-Id: Ie3167e5f784f35f98fa08997e624c51f976b6501
Issue-ID: POLICY-109
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Remove sonar blocker and critical"
Jorge Hernandez [Mon, 25 Sep 2017 19:29:12 +0000 (19:29 +0000)]
Merge "Remove sonar blocker and critical"

6 years agoMerge "Incr State Mgmt Code Coverage"
Jorge Hernandez [Mon, 25 Sep 2017 19:28:23 +0000 (19:28 +0000)]
Merge "Incr State Mgmt Code Coverage"

6 years agoMerge "Added junits to cover PUT/DELETE in RestManager"
Jorge Hernandez [Mon, 25 Sep 2017 19:26:58 +0000 (19:26 +0000)]
Merge "Added junits to cover PUT/DELETE in RestManager"

6 years agoIncr State Mgmt Code Coverage 39/14739/6
Kevin McKiou [Fri, 22 Sep 2017 22:08:15 +0000 (17:08 -0500)]
Incr State Mgmt Code Coverage

Patch 1: Added JUnit tests to feature-state-management
to increase coverage. Estimated coverage is now 48%.
Patch 2: Trivial change to force a rebuild. Patch 3:
Tweaking the JUnit to try and account for the difference
between the LF environment and my local environment.
Patch 4: Something caused the policy endpoints JUnits
to fail - unrelated to these changes.  Made a trival
change to force a rebuild. Patch 5: Trivial change to
force rebuild. Patch 6: Minor changes in response to
Jorge Hernandez comments.

Issue-ID; POLICY-266
Change-Id: I7979c200ab18d5861ba20e0d5f23bd0083193daa
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoAdded junits to cover PUT/DELETE in RestManager 21/14721/2
Magnusen, Drew (dm741q) [Fri, 22 Sep 2017 20:15:10 +0000 (15:15 -0500)]
Added junits to cover PUT/DELETE in RestManager

Added some more junits that cover some of the PUT/DELETE methods
in the RestManager class. Not all are covered yet.

Issue-Id: POLICY-109
Change-Id: I7d7ac9656338c6ba0b3ffb76221fde5a90637236
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoRemove sonar blocker and critical 65/14865/1
Pamela Dragosh [Sun, 24 Sep 2017 12:34:24 +0000 (08:34 -0400)]
Remove sonar blocker and critical

Removed unused import
Null pointer exception
Does not evaluate to true
override hashCode
log exception
cast long
public static final

Issue-ID: POLICY-261
Change-Id: I2d90f8503fcc5ed7d13aff31143b8fb69c689e18
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoAdded @Override method 27/14527/5
rama-huawei [Fri, 22 Sep 2017 08:59:14 +0000 (14:29 +0530)]
Added @Override method

Added diamond symbol on RHS
Removed useless parentheses

Issue-ID: POLICY-239
Change-Id: I1c3360a9c7242ff0ee23ab5599352d36bdf8ad9c
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoAdded more junit coverage for RestManager class 95/14695/1
Magnusen, Drew (dm741q) [Fri, 22 Sep 2017 17:20:26 +0000 (12:20 -0500)]
Added more junit coverage for RestManager class

More logic to GETTest which provides coverage for all
GET methods in RestManager class.

Issue-ID: POLICY-109
Change-Id: Ic5840b8baab73b1e3b440ca6f0b9909dd273c9fa
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "Sonar Major"
Pamela Dragosh [Fri, 22 Sep 2017 13:36:40 +0000 (13:36 +0000)]
Merge "Sonar Major"

6 years agoMerge "Removed useless parentheses"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:57 +0000 (13:30 +0000)]
Merge "Removed useless parentheses"

6 years agoMerge "Added @Override method"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:49 +0000 (13:30 +0000)]
Merge "Added @Override method"

6 years agoMerge "Added diamond symbol on RHS"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:44 +0000 (13:30 +0000)]
Merge "Added diamond symbol on RHS"

6 years agoMerge "Removed useless parentheses"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:34 +0000 (13:30 +0000)]
Merge "Removed useless parentheses"

6 years agoMerge "Removed useless parentheses"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:26 +0000 (13:30 +0000)]
Merge "Removed useless parentheses"

6 years agoMerge "Removed useless parentheses"
Pamela Dragosh [Fri, 22 Sep 2017 13:30:07 +0000 (13:30 +0000)]
Merge "Removed useless parentheses"

6 years agoMerge "Added junits to cover configuration classes"
Jorge Hernandez [Fri, 22 Sep 2017 02:33:29 +0000 (02:33 +0000)]
Merge "Added junits to cover configuration classes"

6 years agoMerge "Addition of Active-Standby Feature"
Jorge Hernandez [Fri, 22 Sep 2017 01:20:13 +0000 (01:20 +0000)]
Merge "Addition of Active-Standby Feature"

6 years agoMerge "Added junit for policy-management"
Jorge Hernandez [Fri, 22 Sep 2017 01:17:16 +0000 (01:17 +0000)]
Merge "Added junit for policy-management"

6 years agoAdded junit for policy-management 49/14249/2
Magnusen, Drew (dm741q) [Fri, 15 Sep 2017 19:41:44 +0000 (14:41 -0500)]
Added junit for policy-management

Junits were added to cover the FileSystemPersistence
and RestManager classes

Patch 2: Merged some test functionality from FileSystemPersistenceTest
class into SystemPersistenceTest class. Deleted FileSystemPersistenceTest
class.

Issue-ID: POLICY-109
Change-Id: Ifd058b9988db30f6b5bc49ae54e5060c67f4ad5e
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoAddition of Active-Standby Feature 89/12489/3
Kevin McKiou [Thu, 14 Sep 2017 17:31:02 +0000 (12:31 -0500)]
Addition of Active-Standby Feature

Patch 1: Adds the active-standby feature to drools-pdp.
This feature provides the state control of the
drools-pdp nodes controlling failover with a site
and across sites. Patch 2: Resolve merge conflict in
packages/install/pom.xml and pom.xml. Patch 3: Resolved
comments from Pamela Dragosh and Jorge Hernandez.

Issue-ID: POLICY-156
Change-Id: I922b3d5d8a464006e9675924bcbc7409d68c08d5
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoAdded junits to cover configuration classes 31/14331/1
Magnusen, Drew (dm741q) [Thu, 21 Sep 2017 18:11:55 +0000 (13:11 -0500)]
Added junits to cover configuration classes

Added junits to cover DroolsConfiguration and ControllerConfiguration
classes.

Issue-Id: POLICY-262
Change-Id: Ie6cf4b15f8b08220a93b4469cc6fd4eda9299138
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoLog exception 65/14265/1
Pamela Dragosh [Thu, 21 Sep 2017 13:59:01 +0000 (09:59 -0400)]
Log exception

Logging as trace since it is an acceptable exception.

Change-Id: Ie93e60aeb95ece9b142c87f20eeb21ef56507dc4
Issue-ID: POLICY-261
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoRemoved useless parentheses 41/14241/3
rama-huawei [Thu, 21 Sep 2017 12:50:13 +0000 (18:20 +0530)]
Removed useless parentheses

Added diamond symbol on RHS

Issue-ID: POLICY-239
Change-Id: I24c138703047308c2e28fef2180a0bb64400c1c9
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoAdded @Override method 01/14201/5
rama-huawei [Thu, 21 Sep 2017 10:10:11 +0000 (15:40 +0530)]
Added @Override method

Added diamond symbol on RHS
Removed useless parentheses

Issue-ID: POLICY-239
Change-Id: Ie20319a5a7298c70a18cc3773ec47f235dbdae41
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoAdded diamond symbol on RHS 83/14183/4
rama-huawei [Thu, 21 Sep 2017 09:26:51 +0000 (14:56 +0530)]
Added diamond symbol on RHS

Removed useless parentheses

Issue-ID: POLICY-239
Change-Id: Icad445f49cc619d71f71ef913f2592d5c7ebf29c
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoRemoved useless parentheses 27/14127/5
rama-huawei [Thu, 21 Sep 2017 06:34:26 +0000 (12:04 +0530)]
Removed useless parentheses

Added the diamond symbol on RHS side

Issue-ID: POLICY-239
Change-Id: I6f8516d4beedd94f4ff8801d51d368f436fe570c
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>