aboutsummaryrefslogtreecommitdiffstats
path: root/feature-healthcheck/src
AgeCommit message (Collapse)AuthorFilesLines
2020-06-19Address checkstyle version issues in drools-pdpJim Hahn1-1/+0
Also added serializationId to several classes to address eclipse warnings. Issue-ID: POLICY-2188 Change-Id: I3df5e8abaad8da9261c0d5cd19a93ed68dceb870 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-15reduce sonar issue - 2 revTaka Cho1-3/+4
In some conditions for assertTrue, sonarcloud recommends using assertEquals Assert.assertTrue(a.equals(b)); Assert.assertTrue(a == b); Assert.assertTrue(a == null); Assert.assertTrue(a != null); Assert.assertFalse(a.equals(b)); Compliant Solution Assert.assertEquals(a, b); Assert.assertSame(a, b); Assert.assertNull(a); Assert.assertNotNull(a); Assert.assertNotEquals(a, b); Issue-ID: POLICY-2616 Change-Id: Ib362573bd865d1b561916bf64640c8ddeaa02546 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-04-06Address sonar issues in drools-pdpJim Hahn1-2/+2
Addressed the following sonar issues: - add "final" to public static fields - commented code; some were bogus - just updated the comments so sonar is happy - use "{}" instead of string concatenation - junit should assert something - when using logger, invoke compute-intensive tasks conditionally - use superclass name instead of subclass name to access static fields - don't always return the same value - remove "transient" from fields of classes that aren't Serializable - don't nest try/catch blocks - use appropriate class name in Logger.getLogger() - use Predicate<T> instead of Function<T,Boolean> - remove unused parameters from private methods - either log or throw - remove duplicate methods - use remove() TLS instead of set(null) - null check is implicit in instanceof check - do something with return value - don't use volatile - don't return "null" list; used Optional instead - add no-arg constructor to non-Serializable superclass - add callSuper=true for EqualsAndHashCode - don't declare "throws XXX" where XXX is a subclass of RuntimeException - remove serialVersionUID field if the class isn't Serializable Also addressed some eclipse warnings: - unused fields - suppress generic typic cast warnings Issue-ID: POLICY-2305 Change-Id: I906d5bf71c1f86531423e23b3667a585cdba45e1 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-08Miscellaneous code clean upjhh1-1/+1
Issue-ID: POLICY-2203 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I5731d4636bd2aaecbc486406298bcba1b19e8f4d Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-09-16Add YAML support to drools-pdp rest servletsJim Hahn3-12/+11
Drools-pdp depends on some of the GsonJackson annotations that cannot be easily worked around via standard gson. Consequently, this continues to use the JacksonHandler for json-encoding, thus it uses the YamlJacksonHandler for yaml-encoding. Added YAML to swagger "consumes" list. Change-Id: Ic70c68bb274222db571b3515cbf1ab22d9ff2366 Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-13Fix sonar issues in drools-pdpJim Hahn7-45/+79
Address sonar issue, "Move constants to a class or enum", by moving them from interfaces to classes: ActiveStandbyFeatureApi StateManagementFeatureApi PolicyResourceLockFeatureApi PolicySessionFeatureApi DroolsController DroolsControllerFeatureApi PolicyControllerFeatureApi PolicyEngineFeatureApi HealthCheck SystemPersistence EventProtocolCoder PolicyController PolicyEngine TestTransaction MdcTransaction Address sonar issue, "Move constants to a class or enum", by change the interface to a class: DroolsProperties Address sonar issue, "Override the "equals" method in this class", by adding equals & hashCode to: DroolsPdpEntity DroolsPdpImpl Use lombok for a number of getters & setters. Address sonar issue, "Define a constant instead of duplicating this literal" in: DroolsPdpsElectionHandler JpaDroolsPdpsConnector MavenDroolsController GenericEventProtocolCoder GsonProtocolCoderToolset RestManager Address sonar issue, "Remove the parentheses around the parameter" in: MavenDroolsController Address sonar issue, "Replace this lambda with a method reference" in: LifecycleFsm Address sonar issue, "Move this constructor to comply with Java Code Conventions" in: LifecycleStateRunning Address sonar issue, "Replace this 'switch' statement by 'if' statements to increase readability", as specified in: PolicyEngineManager Address sonar issue, "Rename field to prevent any misunderstanding/clash with field" in: MdcTransactionImpl Address sonar issue, "Either log or rethrow this exception", in: RestManager Address sonar issue, "Rename this constant name to" uppercase, by replacing enums with static lists in: RestManager Addressed review comments: Fixed license dates. Renamed getSiteName/setSiteName methods to getSite/setSite in the interface to match the field names in the implementation classes. Renamed *Instance classes to *Constants. Next round of review comments. Change-Id: I1c26af9f194833dd773f2b25dc5f60cde163201c Issue-ID: POLICY-1968 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-16Merge "Fix checkstyle issues in policy-management"Jorge Hernandez2-3/+3
2019-07-11Fix checkstyle issues in policy-managementJim Hahn2-3/+3
Also deleted the checkstyle suppression file. Moved classes into their own source files per checkstyle. Change-Id: I586223aac0e5b7623cfd7b0acfceca4742ecc013 Issue-ID: POLICY-1908-mgmt-style Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-10Fix checkstyle issues in feature-healthcheckJim Hahn2-214/+250
Also deleted the checkstyle suppression file. Change-Id: I44b5eaac4b75a7fc2186066d2bb109752a9e2e0f Issue-ID: POLICY-1904 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-08Fix drools-pdp due to sonar changes in commonJim Hahn1-4/+4
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I26a38340707b2903e089350c31c5dfdb5c019ee0 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Change getCanonicalName() to getName() in drools-pdpJim Hahn1-2/+2
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: I28df56b3dfd0382239960d7f0f6e1131d702b2ab Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-08Track policies when active.jhh1-20/+0
Do not honor group/subgroup changes with status messages. When no present group/subgroups in update messages, assume that they have to be reset. Keep the policy cache of non-installed policies tracking them when in passive state besides active. Wait until go active to enable them. Remove legacy PAP and PDP-X healtchecks as it was basically testing reachability. There are conflicts with maintaining 2 different sets of PAPs and PDPs, trying to avoid it. Alternative healtchecks are being placed on the robot test framework. What to healtcheck should be considered more carefully in the near future. Change-Id: I574f30bb5899faf521123c79046793d16b4a46e0 Issue-ID: POLICY-1748 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-02-21Moving hard install config to environment varsJorge Hernandez1-9/+9
Change-Id: I01e0cf2e2399ec81337961e0a2b3a349c34f55c4 Issue-ID: POLICY-1517 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-02-15Change properties to use gsonJim Hahn1-1/+4
Modified property files to use gson instead of jackson for REST calls, for both clients and servers. Change-Id: Ib836886df33cd585b4c2d227e9cc496cc165fc2c Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-26Enable Authorization AAF Filter programmatically3.0.0-ONAPJorge Hernandez2-2/+4
The intent is to reduce configuration options and automatically set up the authorization filter (that will complement the authentication filter that the policy-endpoints common framework automatically provides). Previously to enable the AAF authorization filter, it will need the configuration had to kept track of AAF flag, and the "filterClasses" property configuration, make a bit more difficult to keep them sync, and easily turn on/off AAF. Change-Id: I3d59de6fa83986c5dcb6b3d38077278b8e75689a Issue-ID: POLICY-1216 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2018-10-03Add more coverage to drools-pdp health checkJim Hahn2-18/+300
Added getProperties() method to Factory, as the system properties could not be found in the jenkins build, for some reason. Removed Factory, as not needed for junit testing. Change-Id: I5070b9502ae06be6995cccbb005653928591512c Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-02Add junit coverage to drools-pdpJim Hahn3-28/+174
Added coverage to distributed locking. Added coverage to test-transaction - still more to do. Added coverage to healthcheck - still more to do. Also fixed "code smell" in pooling. Also fixed "code smell" in session persistence. Fixed typo in comment. Removed unneeded setUp() method from test. Fixed new checkstyle errors. Fixed another new checkstyle error. Change-Id: I0d2ab13fcbd64486af88affb02e114e624c6a3d1 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-01Set drools-pdp checkstyle configPamela Dragosh4-8/+8
Fixed last remaining checkstyle issues along with setting the pom.xml to the correct path setting. Fixed forbidden summary fragments, not allowed to prepend summary with "This method returns" Issue-ID: POLICY-1153 Change-Id: I267842080494132a7b5507731e14f027a3f6fe44 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-19AAF Configuration in PDP-DJorge Hernandez4-6/+100
AAF is disabled by default until pairwise testing is completed. Change-Id: Ica83873a2605742689ed0c2e06dfade20bef8bf0 Signed-off-by: Jorge Hernandez <jh1730@att.com> Issue-ID: POLICY-1043 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-09-13Fix checkstyle for features submodules.Pamela Dragosh5-88/+98
These are the remaining submodules that have checkstyle. Pretty clean compile after this. There were a couple of sonar fixes in there also. Issue-ID: POLICY-882 Change-Id: I8191ea1aa261f4a7b9d3d21c108572fd31db1b8c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-11disable http for healthchecksJorge Hernandez1-0/+1
Change-Id: If1d6d86e7622432d4f8b4de6b1f86bd212adc233 Signed-off-by: Jorge Hernandez <jh1730@att.com> Issue-ID: POLICY-1108
2018-08-28Fixed feature-healthcheck issueMichael Mokry1-3/+3
Modified properties to true for https on PAP and PDP Found a minor typo in do-start.sh that is benign currently but could cause an issue in the future so figured I would clean it up now. Change-Id: I06385d36d69955d49cabeb39b09d75ffeaec2fdc Issue-ID: POLICY-781 Signed-off-by: Michael Mokry <mm117s@att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis1-4/+2
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-357/+350
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-2/+2
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-02-20Sonar fixes to drools-pdpJim Hahn1-11/+11
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>
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-09-21Added diamond symbol on RHSrama-huawei1-2/+3
Removed useless parentheses Issue-ID: POLICY-239 Change-Id: Icad445f49cc619d71f71ef913f2592d5c7ebf29c Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
2017-09-18Fix sonar blocker/criticalPamela Dragosh1-8/+0
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-15Added junit for feature-healthcheckMagnusen, Drew (dm741q)2-0/+239
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>
2017-08-22Add feature-session-persistenceKevin McKiou2-2/+2
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>
2017-08-02[POLICY-114] fix some sonar criticalsJorge Hernandez1-1/+4
Change-Id: Ic79b3d81ac814948ce3a956fe4c32b8a9b5c0009 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-02Merge "[POLICY-66] healtcheck feature config and db prep"Pamela Dragosh1-0/+2
2017-08-02[POLICY-66] healtcheck feature config and db prepJorge Hernandez1-0/+2
initial commit pre-intro of db support on per feature basis Change-Id: Ie790764bc58f773da381ae88b6f7476fbd2af2e5 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-01[POLICY-145] fix typo in features filesJorge Hernandez1-0/+0
Change-Id: Idb9d40e5818dbd2b3f4633888df413ffc077c89d Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-07-28[POLICY-72] replace openecomp for drools-pdpGuo Ruijing6-13/+13
Change-Id: I8aa8e32d3ba10f7c655b50e97aaf6865514d4777 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
2017-07-18[POLICY-66] self-contained features supportJorge Hernandez2-28/+62
installation/enable/disable of self contained package features: Feature 3rd party dependencies, configuration files, and custom installation scripts do not need to be packaged within the policy core base to be used. Change-Id: I35a472e63bd0f9f7aa6cd0c112d41d2b4604a892 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-06-30[POLICY-66] rename of policy-healthcheckJorge Hernandez5-0/+518
using "feature-" naming convention. Change-Id: I13d6b75750d369ed9e61f3c9c9408b31eac6bb2d Signed-off-by: Jorge Hernandez <jh1730@att.com>