summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-01-31Fix sonar issues in feature-state-managementJim Hahn4-184/+198
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>
2018-01-18Resolve bug in DroolsPDPIntegrityMonitorMagnusen, Drew (dm741q)1-8/+20
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>
2018-01-08Initialize allSeemsWell CorrectlyKevin McKiou1-3/+8
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>
2017-12-21Merge "Fix issues blocking election handler thread"Jorge Hernandez10-141/+548
2017-12-21Merge "Reduce tech debt in policy-management"Jorge Hernandez11-118/+189
2017-12-19Reduce tech debt in policy-managementMagnusen, Drew (dm741q)11-118/+189
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>
2017-12-14Add a DMaaP simulatorCharles Cole4-0/+541
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>
2017-12-13Fix issues blocking election handler threadKevin McKiou10-141/+548
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>
2017-12-08Merge "Multiple small changes to reduce technical debt."Jorge Hernandez9-38/+42
2017-12-07Multiple small changes to reduce technical debt.Magnusen, Drew (dm741q)9-38/+42
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>
2017-12-05feature-healthcheck technical debtMagnusen, Drew (dm741q)2-49/+119
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>
2017-12-01Merge "Modified state mgmt to fix some sonar issues"Jorge Hernandez6-159/+198
2017-12-01Modified state mgmt to fix some sonar issuesJim Hahn6-159/+198
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>
2017-12-01Fix sonar-maven-plugin version mismatchHockla, Ali (ah999m)1-4/+0
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>
2017-12-01Merge "make volatile access to alive and locked flags"Jorge Hernandez2-9/+5
2017-11-30make volatile access to alive and locked flagsJorge Hernandez2-9/+5
instead of synchronized read access Change-Id: I3f4457f798d6f4d4a013bf023ed2d9c1b75d4f1f Issue-ID: POLICY-487 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-11-30Merge "Refactored code to reduce technical debt."Pamela Dragosh2-33/+40
2017-11-30Refactored code to reduce technical debt.Magnusen, Drew (dm741q)2-33/+40
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>
2017-11-30Merge "Made some changes per sonar"Pamela Dragosh1-2/+2
2017-11-29Made some changes per sonarJim Hahn1-2/+2
Reordered modifiers. Used diamond operator. Change-Id: Iba3a2e035dd233574058f426744d1722a30083f7 Issue-ID: POLICY-468 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-11-29Fix Sonar issues in policy-coreCharles Cole3-22/+24
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>
2017-11-29Fix Sonar issues in policy-utilsCharles Cole3-31/+35
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>
2017-11-21Election Handler CleanupKevin McKiou2-6/+6
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>
2017-11-21Merge "Fix fortify issues identified in drools"Pamela Dragosh2-10/+7
2017-11-21Merge "Modified dmaapClient dependency GroupId/Version"Pamela Dragosh2-3/+3
2017-11-21Modified dmaapClient dependency GroupId/VersionMagnusen, Drew (dm741q)2-3/+3
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>
2017-11-21Bump minor versionJessica Wagantall17-18/+18
Bump minor version in preparation for Amsterdam branching. Change-Id: I7a10894837580ae898573156e47e31f32ae0d041 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
2017-11-15Update to 1.1.2-SNAPSHOTPamela Dragosh1-1/+1
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>
2017-11-15Update to 1.1.2-SNAPSHOTPamela Dragosh16-16/+16
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>
2017-11-10Fix release processv1.1.11.0.0-ONAP1.0.0-AmsterdamPamela Dragosh1-0/+25
Missing staging repo Issue-ID: POLICY-441 Change-Id: I09aeda29fe3838cf6f4cd2ed01009af541b1566d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-10Fix fortify issues identified in droolsJoseph Chou2-10/+7
Fix code identified by Fortify as Privacy Violation Issue-ID: POLICY-442 Change-Id: I6097fb203a53a9643c4c4c38185515b1c8a90282 Signed-off-by: Joseph Chou <jc2555@att.com>
2017-11-08Update SNAPSHOT versionPamela Dragosh17-17/+17
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>
2017-11-02Modify state-management propertiesv1.1.0Kevin McKiou7-113/+197
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>
2017-10-30clean leftover items in parent pom pre-releaseJorge Hernandez4-31/+9
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>
2017-10-25shutdown to guarantee terminationJorge Hernandez1-32/+43
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>
2017-10-19fix migration when iterating through DBsJorge Hernandez1-2/+4
Change-Id: Ib243572c2395c9e122af3bff24d1fd8b89300166 Issue-ID: POLICY-357 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-18Resolved bug present in building ueb sink.Magnusen, Drew (dm741q)1-2/+2
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>
2017-10-10Merge "sessioninfo to mediumblob"Jorge Hernandez1-1/+1
2017-10-09Register a gson type adapter for InstantCharles Cole1-2/+4
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>
2017-10-09sessioninfo to mediumblobKevin McKiou1-1/+1
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>
2017-10-09send messages directly through topicJorge Hernandez6-637/+669
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>
2017-10-06Apply review changes, and correct warningsMike Babinski1-0/+184
Issue-ID: POLICY-109 Change-Id: I3a221351e5c68514413c5744334b8c80578c3a02 Signed-off-by: Mike Babinski <mb1915@att.com>
2017-09-28policy-engine.properties to be honored if existsJorge Hernandez1-1/+1
Change-Id: I9c8c7d56a1087a0514f4d53be293e287a26ae1bf Issue-ID: POLICY-265 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-28Merge "Additional RestManager junits"Jorge Hernandez1-124/+351
2017-09-27SonarCube Critical IssueKevin McKiou2-4/+14
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>
2017-09-27Additional RestManager junitsMagnusen, Drew (dm741q)1-124/+351
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>
2017-09-27Upgrade to release oparentPamela Dragosh3-11/+3
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>
2017-09-25junits fixesJorge Hernandez8-781/+895
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>
2017-09-25Merge "Remove sonar blocker and critical"Jorge Hernandez5-25/+35
2017-09-25Merge "Incr State Mgmt Code Coverage"Jorge Hernandez6-26/+111