aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org/onap/policy/drools/controller/internal/MavenDroolsController.java
AgeCommit message (Collapse)AuthorFilesLines
2024-02-09Removing deprecated DMAAP libraryadheli.tavares1-4/+2
Issue-ID: POLICY-4402 Change-Id: I4ce5b303cb3a775010683d3c7102b0bd065280ea Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-10-04Remove AAF from drools-pdpadheli.tavares1-17/+11
Issue-ID: POLICY-4592 Change-Id: Ibe7fb63017f862bdab4a80444a00324040b1ab87 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-08-05Use lombok in drools-pdpJim Hahn1-2/+2
Updated policy-management thru policy-utils. Issue-ID: POLICY-3397 Change-Id: Ie9498fe912e8338ddc32a40774c3cb63d84f079a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-16use lombok NonNull instead of other leaked importsjhh1-1/+1
Issue-ID: POLICY-3397 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ie0f2009e9c9d219405f5ccbdd648304c66460b1e
2021-05-07sonars policy-utils and feature-lifecyclejhh1-33/+21
Issue-ID: POLICY-3289 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaf7423f840fb39a27c3e5fd293159d1336d5557a
2021-02-10More sonars in drools-pdpJim Hahn1-2/+2
Addressed the following issues: - log user-controlled data; moved the "NOSONAR" to a different line - make constructors protected Issue-ID: POLICY-2909 Change-Id: Ic69c100af777779e791c38cc444dd2ea726258f2 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-28sonars - protected constructors and typecastingjhh1-2/+3
Issue-ID: POLICY-3017 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I7e7e384db26e244e2514aec3c3579b7b7f92f8a1
2021-01-14add methods to check if a fact exists.jhh1-14/+45
Issue-ID: POLICY-2762 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ic00d2a548dbc904e044d2310c7d5439a1cb708a5 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-07-20Remove jackson from drools-pdpJim Hahn1-6/+0
Issue-ID: POLICY-1528 Change-Id: I616c48d62c63f8f213ec012f8746509471c38f89 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-19Address checkstyle version issues in drools-pdpJim Hahn1-6/+4
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-04-07Address sonar issues in policy-managementJim Hahn1-7/+11
Addressed the following sonar issues: - modified code to specify the correct class name in the getLogger() call - use equals() instead of "==" for string comparison - remove deprecated code - use ',' instead of "," in indexOf - remove code that is commented out; typically bogus, so the comment was adjusted to satisfy sonar - missing assert in junits - use "{}" instead of concatenation when using logger - either log or rethrow - put arguments for assertEquals() in the correct order - remove "return" statements from the end of void methods - don't always return the same value; just disabled sonar as refactoring would have obfuscated the code - cognitive complexity; used eclipse auto-refactoring to extract out chunks of code into separate methods - don't pass array of classes to class.getDeclaredMethod(); use ellided arguments instead - fix argument count in logger calls - remove unnecessary casts - don't use "volatile" - make methods "synchronized" to match parent class definitions Issue-ID: POLICY-2305 Change-Id: Ie96418f696da4ae6c2ca8d4a914371469e695419 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-08-15Fix more sonar issues in drools-pdpJim Hahn1-68/+71
Addressed issues of cyclomatic complexity and deep nesting by refactoring code into separate methods. In some cases, had to refactor the code into nested classes to avoid passing too many parameters to the newly extracted methods. Addressed issue "too many conditionals" by breaking conditionals apart. Addressed issue "Remove usage of generic wildcard type" by eliminating "? extends" from return values. Addressed issue "Remove this use of 'Thread.sleep()'" in junit tests by introducing latches or using Awaitility. Note: this won't build until ApiUtils has been merged. Change-Id: I0d5596b4cb918a36bc22f426f426bd238195b458 Issue-ID: POLICY-1968 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-13Fix sonar issues in drools-pdpJim Hahn1-11/+16
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-25Add coverage to MavenDroolsControllerJim Hahn1-41/+52
Change-Id: I7234c0146ef77f685a9766bb03168e385090fd1b Issue-ID: POLICY-1772 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-24Add coverage to feature-active-standby-managementJim Hahn1-31/+11
Also removed some logger.isXxx() tests, which should reduce the number of branches that need to be tested. Removed unneeded objects and methods from feature-lifecyle. Change-Id: Ic3eb9c0b63a2ad5585846525eb0ebda81fc55d5e Issue-ID: POLICY-1772 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-11Fix checkstyle issues in policy-managementJim Hahn1-5/+5
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-06-17Change getCanonicalName() to getName() in drools-pdpJim Hahn1-5/+5
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-0/+24
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-04-09deploy and undeploy as audits.jhh1-0/+39
Change-Id: Iea1766d5d8075394e1dccc109f4477bd2c270c36 Issue-ID: POLICY-1624 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-04-08Initial support for deployjhh1-24/+21
This is a first pass, some functionality is missing (undeploy). Compile error fix from changes in policy/models repo. Change-Id: If448492ab665c135bace99d4d684d403e2a6be03 Issue-ID: POLICY-1624 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-03-01Add Controller Logging FeatureDaniel Cruz1-46/+72
This features provides a mechanism to extend the logback.xml properties to add controller specific loggers. The controller's logger will log messages from topics that the controller listens to in a controller specific network log. The original network log is preserved and still logs every message from every controller. Note that the way a logger is associated with a controller is by having the logger name match the controller's name. Any configuration file that has "logback-include-" prepended and a ".xml" extension will be added to the logback.xml and logback-eelf.xml files as extensions to the base configuration. Issue-ID: POLICY-1427 Change-Id: Iaeb823421eadb7ee413b6b03ae3dfe862f230612 Signed-off-by: Daniel Cruz <dc443y@att.com>
2019-02-15Test gson in policy-managementJim Hahn1-0/+6
Added jackson-like Gson annotations to policy-management classes. Also added tests to verify that the classes serialize the same with gson as with jackson. Removed some trailing spaces. Replaced tabs and adjusted spacing in json files. Removed trailing newlines. Updated license data per review comment. Fixed merge conflict. Added files that were inadvertently deleted. Change-Id: Ib546e70f9d9d83187a6a93ff5c634000c4d53da5 Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-14Remove jackson from policy codersJim Hahn1-19/+1
Coders came in pairs, one for GSON and one for Jackson. Replaced the pairs with a single coder for GSON. Simplified list copy. Removed multipleToolsetRetries flag. Removed additional jackson code. It had been removed, but the changes were somehow lost. Simplified another list copy. Updated license dates. Note: the date in PolicyEngineTest will be updated via a different review (mgmt-gson). Change-Id: Id3c7688c2389d194f66afcefa14303cf403ada16 Issue-ID: POLICY-1431 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-04Report KieBase names in rules artifacts.Jorge Hernandez1-2/+7
The rule writer at design time can embed the domain base model(s) supported at design time. This information can be extracted at runtime to match a controller with the domain/model functionality that it can support. Change-Id: I7f7f1320d7d601d50949d0cd09bc48982c222333 Issue-ID: POLICY-1500 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2018-11-16Modify decoder to use param objkris.jinka1-5/+9
Modify decoder to use param object for sonar issue fix Issue-ID: POLICY-1251 Change-Id: Iae68ba276f02be51058037b56d901a131b25838e Signed-off-by: kris.jinka <kris.jinka@samsung.com>
2018-11-15Modify event (en)coder to use param objskris.jinka1-5/+7
Use builder object to send params to event protocol coder and encoder methods to fix sonar issue Issue-ID: POLICY-1251 Change-Id: I6ca5823e1aa35d9aa3a05eb23ac159947efdde23 Signed-off-by: kris.jinka <kris.jinka@samsung.com>
2018-09-13Fix checkstyle in policy-managementPamela Dragosh1-801/+852
The submodule policy-management checkstyle fixes. There may be one or two sonar fixes in there. Issue-ID: POLICY-882 Change-Id: I9cb43c573c6811dd058943650ba1ea5f6dc880aa Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-07-25Copy policy-endpoints from drools-pdp to commonmmis1-1/+1
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-02-21Merge "interception of facts before injection"Pamela Dragosh1-15/+35
2018-02-20Sonar fixes to drools-pdpJim Hahn1-21/+37
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>
2018-02-19interception of facts before injectionJorge Hernandez1-15/+35
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>
2017-12-19Reduce tech debt in policy-managementMagnusen, Drew (dm741q)1-2/+2
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-08-20sonar criticals and some majorsJorge Hernandez1-118/+37
Issue-ID: POLICY-114 Change-Id: I5fe12b6538379a4d018bb76173247fe53fba21d7 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-02[POLICY-114] fix some sonar criticalsJorge Hernandez1-8/+5
Change-Id: Ic79b3d81ac814948ce3a956fe4c32b8a9b5c0009 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-07-28[POLICY-72] replace openecomp for drools-pdpGuo Ruijing1-0/+910
Change-Id: I8aa8e32d3ba10f7c655b50e97aaf6865514d4777 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>