policy/drools-pdp.git
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 "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>
6 years agoRemoved useless parentheses 05/14105/3
rama-huawei [Thu, 21 Sep 2017 05:53:23 +0000 (11:23 +0530)]
Removed useless parentheses

Added the diamond symbol on RHS side

Issue-ID: POLICY-239
Change-Id: Ie49d64124a3d314f0747f35e3627ec329338f0ff
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoRemoved useless parentheses 95/14095/2
rama-huawei [Thu, 21 Sep 2017 05:29:51 +0000 (10:59 +0530)]
Removed useless parentheses

Added the "@Override" annotation

Issue-ID: POLICY-239
Change-Id: I9896f3130b5f8ecaa557d5386c0118e9a09008d2
Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
6 years agoSonar Major 95/13895/2
amshegokar [Wed, 20 Sep 2017 13:34:56 +0000 (19:04 +0530)]
Sonar Major

Removed Useless parenthesis

Change-Id: I366f85922c4d4d290b320e0b88678c805de59873
Issue-ID: POLICY-250
Signed-off-by: amshegokar <AS00500801@techmahindra.com>
6 years agoload config files in ascending order by name 43/14043/1
Jorge Hernandez [Thu, 21 Sep 2017 04:07:21 +0000 (23:07 -0500)]
load config files in ascending order by name

adding predictibility for environment and controller files
loading

Change-Id: Id02ddca75dd0dc8da658b64b84e77bef9e82b37c
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoAdding JUnits for Configuration Classes 33/13433/1
Pamela Dragosh [Tue, 19 Sep 2017 11:34:04 +0000 (07:34 -0400)]
Adding JUnits for Configuration Classes

Also fixed some Sonar Major issues to help clean that up.

Issue-ID: POLICY-109
Change-Id: Ic8a0b8d97f2be1cc1f8e8e4e8b319c6117b231a4
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agofeature-state-management failing junits 05/13205/1
Jorge Hernandez [Mon, 18 Sep 2017 18:58:19 +0000 (13:58 -0500)]
feature-state-management failing junits

because junit library is not part of the pom.

Change-Id: I4e8c12edfe2e91dcdb90200b8d4f37e35109f448
Issue-ID: POLICY-155
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Fix sonar blocker/critical"
Jorge Hernandez [Mon, 18 Sep 2017 14:57:16 +0000 (14:57 +0000)]
Merge "Fix sonar blocker/critical"

6 years agoAdd Junit tests to 'policy-core' 43/13043/2
Ralph Straubs [Mon, 18 Sep 2017 08:37:28 +0000 (03:37 -0500)]
Add Junit tests to 'policy-core'

These tests focus on the following classes:
- PolicyContainer
- PolicySession
- PolicySessionFeatureAPI

'maven-invoker-plugin' was used to compile and install artifacts for
testing during the 'test-compile' phase. These aren't part of the
Maven project hierarchy, so they aren't visible to Sonar and SonarQube,
and they aren't deployed.

Change-Id: I67c122debbe5280f0153e7330248dc5d13c5b2c0
Issue-ID: POLICY-236
Signed-off-by: Ralph Straubs <rs8887@att.com>
6 years agoFix sonar blocker/critical 31/13131/1
Pamela Dragosh [Fri, 15 Sep 2017 22:27:29 +0000 (18:27 -0400)]
Fix sonar blocker/critical

Also add back .gitignore
Sonar blocker for change condition always true. Easier to re-write
this using try-with-resources.
Use synchronized static method to set a static variable.
Don't use e.printStackTrace it causes sonar critical to log exception
Log the bytes read. Ideally I would re-write this using Java 8 NIO

Issue-ID: POLICY-195
Change-Id: I080d1ad4c8bea91f87c3eca109325700e1589558
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoMerge "Added junit for feature-healthcheck"
Jorge Hernandez [Fri, 15 Sep 2017 20:36:06 +0000 (20:36 +0000)]
Merge "Added junit for feature-healthcheck"

6 years agoAdded junit for feature-healthcheck 83/11983/4
Magnusen, Drew (dm741q) [Tue, 12 Sep 2017 15:45:58 +0000 (10:45 -0500)]
Added junit for feature-healthcheck

Added a junit test increase coverage of the healthcheck feature.

Issue-ID: POLICY-227
Change-Id: I3f37e7fab15f2f3072b442b43b79b8241c61e306
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoMerge "Addition of State Management Feature"
Pamela Dragosh [Fri, 15 Sep 2017 16:16:58 +0000 (16:16 +0000)]
Merge "Addition of State Management Feature"

6 years agoFix sonar related to persistence-feature 99/12499/2
Pamela Dragosh [Thu, 14 Sep 2017 17:49:52 +0000 (13:49 -0400)]
Fix sonar related to persistence-feature

Sonar blocker for catchable:
I am not sure why this is wrapped with an exception.
Changing try-catch to use Exception | LinkageError per Jorge/Ralph.

Sonar critical for logging exceptions.

Sonar critical for casting to Long and reinterrupting thread.

Change-Id: I44d46f005d9aa30c434c22e479034107055277ce
Issue-ID: POLICY-195
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoSonar Major 53/12353/4
SwapnilPathak [Fri, 15 Sep 2017 05:54:06 +0000 (11:24 +0530)]
Sonar Major

Move the string literal on the left side of this string comparison.

Change-Id: I8086a6fc1dc24719c3ffd3785a12c086ab453ae7
Issue-ID: POLICY-230
Signed-off-by: SwapnilPathak <SP00494485@techmahindra.com>
6 years agoAddition of State Management Feature 55/11155/7
Magnusen, Drew (dm741q) [Thu, 7 Sep 2017 13:55:17 +0000 (08:55 -0500)]
Addition of State Management Feature

Patch 1:This commit adds the feature to provide node state management.
There are also a couple of very minor cleanup items in
feature-session-persistence which came up during review and testing.
Patch 2: Cleaned up some logging statements and exceptions per
comments by Pam Dragosh. Patch 3: Clean up per comments from
Jorge Hernandez. Patch4: Added a default to ignoreErrors in
RepositoryAudit. Patch 5: Rebase.  Patch 6: Removed
api-state-management/.gitignore

Issue-ID: POLICY-155
Change-Id: I4fbfa33314d488ff46764931ca965f802b6a26d5
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoMerge "Eliminate hanging when updating Drools containers"
Jorge Hernandez [Thu, 14 Sep 2017 18:13:51 +0000 (18:13 +0000)]
Merge "Eliminate hanging when updating Drools containers"

6 years agoEliminate hanging when updating Drools containers 91/12391/1
Ralph Straubs [Thu, 14 Sep 2017 08:51:45 +0000 (03:51 -0500)]
Eliminate hanging when updating Drools containers

'PolicyContainer.updateToVersion(...)' now hangs unless the Drools session
threads are stopped prior to the update. This wasn't an issue in the past,
and it isn't clear what causes it to happen now. It also happened in the
Junit tests I am currently working on.

In any case, the 'updateToVersion' method has now been changed to stop
the threads prior to an update attempt, do the update, and then restart
the threads.

Change-Id: I577a67c6e99a68bcbe3c2f476f93c0a72b93451a
Issue-ID: POLICY-234
Signed-off-by: Ralph Straubs <rs8887@att.com>
6 years agoadded "fetch timeout" backoff for UEB endpoints 77/12277/4
Jorge Hernandez [Wed, 13 Sep 2017 19:48:05 +0000 (14:48 -0500)]
added "fetch timeout" backoff for UEB endpoints

this prevents high frequency fruitless attempts to connect to an
unreachable (perhaps temporarily) UEB server.

added additional management apis for noop endpoints.

bump versions of jackson parsers so through snakeyaml library
throughtransitive dependencies is bump up from 1.15 as it is
resolved in the classpath at runtime to > 1.17
otherwise causes incompatibilities with the one used in
controlloops under their own classloaders, as they expect 1.17.

Change-Id: I936348c4b93a2c409c22568868c44ed330dc18f7
Issue-ID: POLICY-119
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agowait until port is open in HttpClient junit tests 87/12187/1
Jorge Hernandez [Wed, 13 Sep 2017 12:28:12 +0000 (07:28 -0500)]
wait until port is open in HttpClient junit tests

As a note, HttpServer tests have retries at the http level.

Hopefully this will resolve some timing issues and intermittent junits
failures in LF jenkins environment.

Issue-ID: POLICY-109
Change-Id: I44628b60d4912be5fc4639e0048791f5655bbd01
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "missing check for noop sinks"
Jorge Hernandez [Tue, 12 Sep 2017 21:21:00 +0000 (21:21 +0000)]
Merge "missing check for noop sinks"

6 years agoMerge "Added junits for policy-util classes"
Jorge Hernandez [Tue, 12 Sep 2017 20:20:14 +0000 (20:20 +0000)]
Merge "Added junits for policy-util classes"

6 years agoAdded junits for policy-util classes 57/10857/3
Magnusen, Drew (dm741q) [Thu, 7 Sep 2017 14:12:46 +0000 (09:12 -0500)]
Added junits for policy-util classes

Added junits to increase coverage of the policy-util module.
Patch 1: Moved Parent and Child class to within ReflectionUtilTest class.

Issue-ID: POLICY-214
Change-Id: Ic5882c02a65ba1c924ec1381901a2a971fe72911
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agomissing check for noop sinks 75/11975/1
Jorge Hernandez [Tue, 12 Sep 2017 15:27:08 +0000 (10:27 -0500)]
missing check for noop sinks

Change-Id: If7167415c361fad2478809ac6c41981beaadacd6
Issue-ID: POLICY-119
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoCleanup project's name in Sonar 23/11323/1
Jessica Wagantall [Fri, 8 Sep 2017 20:34:37 +0000 (13:34 -0700)]
Cleanup project's name in Sonar

The name parameter in the root pom.xml should
match the project name in gerrit to reflect consistency
in Sonar.

Change-Id: Ic266276a2cc9537897dba90b4887b38cd0efed4d
Issue-id: CIMAN-65
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
6 years agoSmall change to please sonar 33/10833/6
Magnusen, Drew (dm741q) [Thu, 7 Sep 2017 13:55:17 +0000 (08:55 -0500)]
Small change to please sonar

Added a 'Thread.currentThread().interrupt()' in a catch of the run method of TTControllerTask
at the direction of sonar.

Added dump of exception to logger.

Issue-ID: POLICY-213
Change-Id: I2bdd74eacedb6d1950c5c730430d7f723ce494bc
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoSupport environment configurations 03/10703/2
Jorge Hernandez [Thu, 7 Sep 2017 05:07:32 +0000 (00:07 -0500)]
Support environment configurations

This enables PDP-D to have knowledge of any installation
property or else configured via OS environment variable
or as an environment file.

This allows the user to query or set via REST API of programmatically
through PolicyEngine any environment variable.

It also provides a means to make data globally available to all
drools applications.

For example:

http://localhost:9696/policy/pdp/engine/environment> get
HTTP/1.1 200 OK
Content-Length: 749
Content-Type: application/json
Date: Wed, 06 Sep 2017 23:53:57 GMT
Server: Jetty(9.3.14.v20161028)

{
    "DCAE_SERVERS": "",
    "DCAE_TOPIC": "",
    "DMAAP_SERVERS": "",
    "ENGINE_MANAGEMENT_HOST": "0.0.0.0",
    "ENGINE_MANAGEMENT_PASSWORD": "",
    "ENGINE_MANAGEMENT_PORT": "9696",
    "ENGINE_MANAGEMENT_USER": "",
    "HEALTHCHECK_PASSWORD": "",
    "HEALTHCHECK_USER": "",
    "JAVA_HOME": "/usr/lib/jvm/java-8-oracle",
    "M2_HOME": "/usr/share/maven",
    "PAP_HOST": "",
    "PAP_PASSWORD": "",
    "PAP_USERNAME": "",
    "PDPD_CONFIGURATION_API_KEY": "",
    "PDPD_CONFIGURATION_API_SECRET": "",
    "PDPD_CONFIGURATION_CONSUMER_GROUP": "",
    "PDPD_CONFIGURATION_CONSUMER_INSTANCE": "",
    "PDPD_CONFIGURATION_PARTITION_KEY": "",
    "PDPD_CONFIGURATION_SERVERS": "",
    "PDPD_CONFIGURATION_TOPIC": "PDPD-CONFIGURATION",
    "PDP_HOST": "",
    "PDP_PASSWORD": "",
    "PDP_USERNAME": "",
    "POLICY_HOME": "/home/policy/snapshot",
    "SQL_HOST": "",
    "SQL_PASSWORD": "",
    "SQL_USER": ""
}

policy@newton:~/snapshot/config$ echo -n "http://one.com/aai" | http --verbose PUT :9696/policy/pdp/engine/environment/AAI_URL Content-Type:text/plain Accept:text/plain
PUT /policy/pdp/engine/environment/AAI_URL HTTP/1.1
Accept: text/plain
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 18
Content-Type: text/plain
Host: localhost:9696
User-Agent: HTTPie/0.9.2

http://one.com/aai

HTTP/1.1 200 OK
Content-Length: 0
Content-Type: text/plain
Date: Thu, 07 Sep 2017 00:05:05 GMT
Server: Jetty(9.3.14.v20161028)

policy@newton:~/snapshot/config$ echo -n "http://one.com/aai2" | http --verbose PUT :9696/policy/pdp/engine/environment/AAI_URL Content-Type:text/plain Accept:text/plain
PUT /policy/pdp/engine/environment/AAI_URL HTTP/1.1
Accept: text/plain
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 19
Content-Type: text/plain
Host: localhost:9696
User-Agent: HTTPie/0.9.2

http://one.com/aai2

HTTP/1.1 200 OK
Content-Length: 18
Content-Type: text/plain
Date: Thu, 07 Sep 2017 00:05:45 GMT
Server: Jetty(9.3.14.v20161028)

http://one.com/aai

policy@newton:~/snapshot/config$ http :9696/policy/pdp/engine/environment/AAI_URL

HTTP/1.1 200 OK
Content-Length: 19
Content-Type: application/json
Date: Thu, 07 Sep 2017 05:14:57 GMT
Server: Jetty(9.3.14.v20161028)

http://one.com/aai2

Change-Id: I1fcd610938af751977bb2db925b57b4e5b3f7ba4
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoAdded junit for test-transaction feature 11/10611/2
Magnusen, Drew (dm741q) [Wed, 6 Sep 2017 17:22:33 +0000 (12:22 -0500)]
Added junit for test-transaction feature

Single junit was added for test-transaction feature.
Junit does not test full functionality of the feature,
but does test some of the peripheral methods.

Also fixed small indentation error in assemble_zip.xml.

Issue-ID: POLICY-198
Change-Id: Iad7a98be45eb8ef6701bf8381aa764d2dd1ca9c7
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agoSupport Utils Libraries for CL Lab Integration 95/9595/2
Jorge Hernandez [Thu, 31 Aug 2017 05:09:45 +0000 (00:09 -0500)]
Support Utils Libraries for CL Lab Integration

There is a companion review in the drools-applications repo.

This also includes workarounds to the recent oparent dependency
introduction that breaks runtime (with the version-check-maven-plugin).

It manifested by loading control loops and failing to load some classes
due to different versions (in a lab environment).

The issue was that underlying drools libraries use 3.2.5 and oparent
has included a had dependency with transitive dependencies for some maven
libraries in 3.2.3 and lower version xml parsers.   Bottomoline, the
classpath at runtime was formed by the union of both, with some
libraries being resolved to the oparent one, and others to the drools
one.   These errors are very obscured to debug.

Additional clean up of dependencies versions and order of build
was introduced to avoid issues loading dependencies at runtime in a
lab environment (non-junit)..

Change-Id: If4f4201e08f7e6e1f3619f557434c1b2e23e47a5
Issue-ID: POLICY-162
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoAdded new test transaction feature 99/8799/7
Magnusen, Drew (dm741q) [Fri, 25 Aug 2017 15:20:46 +0000 (10:20 -0500)]
Added new test transaction feature

Added test transaction feature which is used to test the health
of policy controllers.

Issue-ID: POLICY-177
Change-Id: I9a966be73f040c01e208bffd1dd67e8d858c1d37
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
6 years agojunits in policy-management 65/8965/2
Jorge Hernandez [Mon, 28 Aug 2017 18:51:08 +0000 (13:51 -0500)]
junits in policy-management

- add additional junits for policy-management module
- allow for no configuration pdp-d start up.
- minor changes junits for policy-endpoints to avoid
  race conditions in jenkins environment, starting up, and
  shutting down servers.

Issue-ID: POLICY-109
Change-Id: Ibccefeb5d7cf762da27fe3282887df18d79db5df
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agorename scripts and clean up eclipse warnings 29/8629/1
Jorge Hernandez [Thu, 24 Aug 2017 14:24:33 +0000 (09:24 -0500)]
rename scripts and clean up eclipse warnings

rename scripts to follow convention that executable scripts should not
have file extensions.

clean up some warnings in eclipse

Issue-ID: POLICY-162
Change-Id: I82be87925c3a8264381795535d33cee04924ae92
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoAdd access.log to jetty server 27/8427/3
jrh3 [Wed, 23 Aug 2017 13:40:28 +0000 (09:40 -0400)]
Add access.log to jetty server

Added a single line to the code that creates the jetty server so that
it will log messages in access.log format.  Also added lines to various
logback.xml files to actually write the output from the jetty server
to the access.log.

Made some revisions per comments:
- removed spaces around parameters
- added "Out" suffix
- changed suffix of archived files
- changed size to 1MB

Modified logback*.xml files to include jetty "access log" content in
the already-existing network.log.

Issue-Id: POLICY-161
Change-Id: I3e3769c06a22aaffea0e09abbec3387cc62f246f
Signed-off-by: jrh3 <jrh3@att.com>
6 years agoAdd feature-session-persistence 39/8039/5
Kevin McKiou [Tue, 22 Aug 2017 21:08:06 +0000 (16:08 -0500)]
Add feature-session-persistence

This commit adds the feature-session-persistence module
which will persist drools session data to allow stateful
transactions which can persist across node restarts and
failovers. It also picks up recent changes to the master
branch to avoid merge conflicts.

Issue-ID: POLICY-133
Change-Id: Ifdcd8280ea6df07db79562f1b01fa90296a8b878
Signed-off-by: Kevin McKiou <km097d@att.com>
6 years agoAdding changes to resolve pom.xml 77/8277/2
Viswanath Kumar Skand Priya [Tue, 22 Aug 2017 11:54:33 +0000 (11:54 +0000)]
Adding changes to resolve pom.xml

Issue-ID: POLICY-175
Change-Id: I3be1db6fdc1e070aff98c99fa9089a946ef7d6a3
Signed-off-by: Viswanath KSP <viswanath.kumarskandpriya@verizon.com>
6 years agosonar criticals and some majors 11/8111/2
Jorge Hernandez [Sun, 20 Aug 2017 18:12:13 +0000 (13:12 -0500)]
sonar criticals and some majors

Issue-ID: POLICY-114
Change-Id: I5fe12b6538379a4d018bb76173247fe53fba21d7
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoExpand acces dependencies to ONAP repos. 43/8043/1
Jorge Hernandez [Fri, 18 Aug 2017 21:39:45 +0000 (16:39 -0500)]
Expand acces dependencies to ONAP repos.

Make public ONAP drools-applications repos at runtime or
during development testing to ensure that no dependencies
are missed, nor all of them need to be published in
the private nexus repository.

This will be benefitial at runtime and also during control
loop development as control loops archetypes could be
used from anywhere.

Change-Id: I787b5afaf5c525f83326e924d6b9bcf85f9a7662
Issue-ID: POLICY-159
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoRemove MojoHaus Maven plug-in from pom file 65/7865/1
Temoc Rodriguez [Thu, 17 Aug 2017 15:24:55 +0000 (08:24 -0700)]
Remove MojoHaus Maven plug-in from pom file

Remove MojoHaus License Maven plug-in from main pom.xml file.

Issue-ID: POLICY-116
Change-Id: I3acfba5a998733006e04c8109ba9821c0c0c9573
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
6 years agoMerge "Fix "critical" Sonar issue"
Jorge Hernandez [Wed, 16 Aug 2017 18:52:57 +0000 (18:52 +0000)]
Merge "Fix "critical" Sonar issue"

6 years agoadd hibernate JPA libraries in base 55/7755/2
Jorge Hernandez [Wed, 16 Aug 2017 17:41:11 +0000 (12:41 -0500)]
add hibernate JPA libraries in base

To make feature development easier for DB-enabled features

Change-Id: I7f69ecfbbfb9eaac92f698bdb787ce881eec39f0
Issue-ID: POLICY-96
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoFix "critical" Sonar issue 49/7749/1
Ralph Straubs [Wed, 16 Aug 2017 15:31:18 +0000 (10:31 -0500)]
Fix "critical" Sonar issue

Change-Id: I46e59d9a017722370cff4112250bcdfa0f0d0b23
Issue-ID: POLICY-160
Signed-off-by: Ralph Straubs <rs8887@att.com>
6 years agoadd persistence libraries in the installation base 71/7671/1
Jorge Hernandez [Wed, 16 Aug 2017 00:12:25 +0000 (19:12 -0500)]
add persistence libraries in the installation base

to make db-enabled features to not worry about their
packaging in the copy-dependencies plugin in the
pom.xml

Change-Id: Ie20a61978f75d4dbe82ac7aba5f6d259fb412f22
Issue-ID: POLICY-96
Signed-off-by: Jorge Hernandez <jh1730@att.com>
6 years agoMerge "Support of DB-enabled features"
Jorge Hernandez [Tue, 15 Aug 2017 15:13:30 +0000 (15:13 +0000)]
Merge "Support of DB-enabled features"

6 years agoSupport of DB-enabled features 77/7477/1
Jorge Hernandez [Mon, 14 Aug 2017 18:34:53 +0000 (13:34 -0500)]
Support of DB-enabled features

Isolation and data migration support overall and on a per
feature basis.

policy@drools:/opt/app/policy$ policy.sh status

[drools-pdp-controllers]
 L []: Policy Management (no pidfile) is NOT running
1 cron jobs installed.

[features]
name                 version         status
----                 -------         ------
eelf                 1.1.0           disabled
healthcheck          1.1.0           disabled
session-persistence  1.1.0           enabled

[migration]
session-persistence: upgrade out-of-sync: 0 -> 201702

policy@drools:/opt/app/policy$ features enable session-persistence
session-persistence: upgrade out-of-sync: 0 -> 201702

name                 version         status
----                 -------         ------
eelf                 1.1.0           disabled
healthcheck          1.1.0           disabled
session-persistence  1.1.0           enabled

policy@drools:/opt/app/policy$ db-migrator -s session-persistence -o upgrade
upgrade: 0 -> 201702

> upgrade 201701-blah.upgrade.sql
--------------
create table blah (a varchar(15), b varchar(20))
--------------

> upgrade 201702-blah2.upgrade.sql
--------------
create table blah2 (a varchar(15), b varchar(20))
--------------

session-persistence: OK: upgrade (201702)

policy@drools:/opt/app/policy$ db-migrator -s ALL -o report
+---------------------+---------+
| name                | version |
+---------------------+---------+
| session-persistence | 201702  |
+---------------------+---------+
+--------------------------+-----------+---------+---------------------+
| script                   | operation | success | atTime              |
+--------------------------+-----------+---------+---------------------+
| 201701-blah.upgrade.sql  | upgrade   | 1       | 2017-08-14 16:01:32 |
| 201702-blah2.upgrade.sql | upgrade   | 1       | 2017-08-14 16:01:32 |
+--------------------------+-----------+---------+---------------------+

policy@drools:/opt/app/policy$ features disable session-persistence

name                 version         status
----                 -------         ------
eelf                 1.1.0           disabled
healthcheck          1.1.0           disabled
session-persistence  1.1.0           disabled

policy@drools:/opt/app/policy$ db-migrator -s ALL -o downgrade
downgrade: 201702 -> 0

> downgrade 201702-blah2.downgrade.sql
--------------
drop table if exists blah2
--------------

> downgrade 201701-blah.downgrade.sql
--------------
drop table if exists blah
--------------

session-persistence: OK: downgrade (0)

policy@drools:/opt/app/policy$ db-migrator -s ALL -o report
+---------------------+---------+
| name                | version |
+---------------------+---------+
| session-persistence | 0       |
+---------------------+---------+
+----------------------------+-----------+---------+---------------------+
| script                     | operation | success | atTime              |
+----------------------------+-----------+---------+---------------------+
| 201701-blah.upgrade.sql    | upgrade   | 1       | 2017-08-14 16:01:32 |
| 201702-blah2.upgrade.sql   | upgrade   | 1       | 2017-08-14 16:01:32 |
| 201701-blah.downgrade.sql  | downgrade | 1       | 2017-08-14 16:13:49 |
| 201702-blah2.downgrade.sql | downgrade | 1       | 2017-08-14 16:13:49 |
+----------------------------+-----------+---------+---------------------+
session-persistence: OK @ 0

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