summaryrefslogtreecommitdiffstats
path: root/feature-state-management/src
AgeCommit message (Collapse)AuthorFilesLines
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis1-3/+1
Issue-ID: POLICY-967 Change-Id: Ib19d3a89ffa328c39f7871bff59efb3dd1617f7a Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-25Copy policy-endpoints from drools-pdp to commonmmis2-467/+460
Removed policy-endpoints, and 3 classes from policy-core. Replaced refenences to the deleted classes with references to the corresponding classes in policy-common Issue-ID: POLICY-967 Change-Id: I547cde4894424b8f40b7ddd4e2342ebb729cb588 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-04-19Sonar cleanupMagnusen, Drew (dm741q)1-3/+4
More sonar cleanup. Resolved some of the simpler issues. Issue-ID: POLICY-728 Change-Id: If9c4718f10c6d3524239d2a05c09badb791ef2f0 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2018-03-21Fix bugs identified by Sonar on drools-pdpliamfallon2-5/+6
Three bugs fixed: 1. Set of static variable in DMaaPSimulatorJaxR 2. Use of opssibly null variable "output" in RepositoryAudit 3. Unreachable statement error in RepositoryAudit Change-Id: I72e028cfc51a82250afd02fb4109d3dea08072dc Issue-ID: POLICY-691 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-02-19Fix compilation issue due to generic ExceptionJim Hahn1-2/+2
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>
2018-02-06Fix sonar issues with RepositoryAuditJim Hahn1-2/+0
Per sonar, removed commented code from RepositoryAudit. Change-Id: Ia81780f7528bd4fc42062454728a2c215709ea45 Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
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>
2017-12-13Fix issues blocking election handler threadKevin McKiou2-4/+10
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-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-11-02Modify state-management propertiesv1.1.0Kevin McKiou6-112/+190
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-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-25Merge "Incr State Mgmt Code Coverage"Jorge Hernandez6-26/+111
2017-09-25Incr State Mgmt Code CoverageKevin McKiou6-27/+111
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>
2017-09-21Removed useless parenthesesrama-huawei3-39/+45
Added diamond symbol on RHS Issue-ID: POLICY-239 Change-Id: I24c138703047308c2e28fef2180a0bb64400c1c9 Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
2017-09-18Fix sonar blocker/criticalPamela Dragosh6-106/+73
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>
2017-09-14Addition of State Management FeatureMagnusen, Drew (dm741q)16-0/+2257
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>