aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org/onap/policy/drools/system
AgeCommit message (Collapse)AuthorFilesLines
2024-04-24Fix topic configurations.adheli.tavares2-9/+7
- adjust kafka configurations - remove UEB references Issue-ID: POLICY-4955 Change-Id: Ie3ff62a0ba5531ae4c0d123f214a50bb7f721807 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-04-10Dependency management updateadheli.tavares1-1/+2
- including dependencies to pom.xml files only where they are used, avoiding extra dependencies being added in all packages. Issue-ID: POLICY-4945 Change-Id: I376ea0763190d55f254dc8f88b6fa5b89354e8b9 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-02-09Removing deprecated DMAAP libraryadheli.tavares1-6/+1
Issue-ID: POLICY-4402 Change-Id: I4ce5b303cb3a775010683d3c7102b0bd065280ea Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-09-22Upgrade java-17 in drools-pdpadheli.tavares1-1/+1
Issue-ID: POLICY-4676 Change-Id: I85a0f6303b30cd0405d63be003c9288f59a9d6b7 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-01-31Upgrade and clean up dependenciesliamfallon1-1/+1
- Upgrade Hibernate - Upgrade Mockito - Upgrade Mockserver - Remove Powermock (no longer supported) and replace with spring-test ReflectionTestUtils - Upgrade Spring Framework - Add spring-security to allow authentication on unit tests using MockMVC Minor clean-up - Replace deprecated authorization configuraiton on spring boot applications with SecurityFilterChain bean - Change @LocalPort include on tests to use test include rather than runtime include - Remove unused imports - Remove unused constants and variables - Add deprecation annotations where required Issue-ID: POLICY-4482 Change-Id: Ibc2097f6d832a893c9e99a01b79121c28ba878ad Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-10-31Remove lombok public access in locking gettersjhh1-6/+6
Issue-ID: POLICY-4428 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I3c0be2c6e5ad4b723424f20eb39acb654605b235
2022-10-19Support optional cluster name in policy enginejhh3-8/+43
This allows also for correlation with running pod hostnames in the case of multiple drools pdp flavors coexist. Issue-ID: POLICY-4403 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I81affeeec622e6c0e9627651bf34c0775a796827 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2022-02-09add policy_executions_latency_seconds summaryjhh1-1/+34
Issue-ID: POLICY-3761 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I9867472784d8f153b6955ce95b34de250f60f558
2021-08-26Fix sonars in drools-pdpJim Hahn2-2/+0
Fixed sonars: - use "var" - override "equals" - unused imports Also changed some of the JPA queries to make them typed queries. Issue-ID: POLICY-3289 Change-Id: Ib3a00be322d8d00ba492673708439cacfe2c7fc4 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-06Use slf4j Marker from common repoTaka Cho2-7/+9
using slf4j Marker from common repo Issue-ID: POLICY-3087 Change-Id: Iefbd6fa9ab2dfa6388508cb6ffd6cf1358b45ccc Signed-off-by: Taka Cho <takamune.cho@att.com>
2021-08-05Use lombok in drools-pdpJim Hahn7-97/+45
Updated policy-management thru policy-utils. Issue-ID: POLICY-3397 Change-Id: Ie9498fe912e8338ddc32a40774c3cb63d84f079a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-29Use unique name in drools PdpMessagesJim Hahn1-2/+8
Also modified distributed locking to use the unique name, in case the DB is shared. Issue-ID: POLICY-3410 Change-Id: I046a9ffdcb62f3d84d7d388a1e64bcf025fbbf75 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-18Fix new checkstyle issues in drools-pdpJim Hahn1-4/+4
The new version of checkstyle identified new issues. Fixed those. Also addressed sonar "var" issues. Issue-ID: POLICY-3289 Change-Id: I3a18d3988202dca6f3c87f2aa1810bf803a9d14d Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-14Use re2j pattern for sonar vulnerabilitiesjhh1-8/+8
Issue-ID: POLICY-3289 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Id6d58b5c8ac5f7715286f21274ccf5eea9155fd2
2021-05-07sonars policy-utils and feature-lifecyclejhh2-12/+11
Issue-ID: POLICY-3289 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaf7423f840fb39a27c3e5fd293159d1336d5557a
2021-03-09add no locking featurejhh1-0/+3
It provides an interface to applications for locking purposes that always succeeds. It does not deny acquiring resource locks. Issue-ID: POLICY-3114 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I6aebb5f40e4176e0ff7b0e6c6d4042a79dd0b7a3 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2021-02-19remove TransMetric - not neededjhh2-8/+8
Issue-ID: POLICY-3033 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I626de45b528bb891c79900085bfe783fe248b3fa Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2021-02-11support transaction reports in enginejhh2-13/+60
Issue-ID: POLICY-3033 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Id1f02c86be491d5145e74725f76953e294e2975c Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2021-01-28sonars - protected constructors and typecastingjhh2-4/+4
Issue-ID: POLICY-3017 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I7e7e384db26e244e2514aec3c3579b7b7f92f8a1
2021-01-04Changed identifiers to concept identifiersliamfallon2-10/+12
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: I677cc1f8730001b300ab2041f2d57c2485cbc4ed Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-08-31Fix more sonars in drools-pdpJim Hahn1-1/+3
Fixed more sonars in drools-pdp: - remove commented code - don't throw generic Exception - unused field (made it protected instead of private) - log conditionally - cognitive complexity - too many break/continue - return empty list instead of null - Random() is not secure Fixed more eclipse warnings: - parameterize generic types Issue-ID: POLICY-2616-sonars3 Change-Id: Ia5ad769b2ea763568cfae3d81807926d89153b09 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-25Address more sonars in drools-pdpJim Hahn1-16/+8
Addressed the following sonars: - either log or rethrow - call "remove()" for thread-local-storage - use assertEquals - only one method call in exception test - swap arguments in assertEquals - add assertion to assertThatThrownBy() - explain @Ignore Also addressed eclipse warnings: - unused fields and methods Issue-ID: POLICY-2616 Change-Id: I6590c0d2b103885bc933014d48bf5fd92401cd80 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-24exit jvm when detecting configuration problemsjhh2-2/+60
It follows the same approach that in other policy components by throwing a runtime-exception vs System.exit(x). Issue-ID: POLICY-2752 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iba508fc7095b060373742849e394c8fdd2a2334f Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-07-21Merge "Support multiple Policy/Controller types using 'controller.type' ↵Jorge Hernandez2-7/+36
property"
2020-07-21Support multiple Policy/Controller types using 'controller.type' propertyStraubs, Ralph (rs8887)2-7/+36
It provides a feature base to allow for custom Policy and Drools Controllers. Issue-ID: POLICY-2415 Change-Id: Ibe3f11e3ecd925537ffd03d2420bb3b8214029c9 Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com> Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-07-20Remove jackson from drools-pdpJim Hahn3-14/+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 Hahn2-6/+5
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-09Disable sonar main args for drools-pdpJim Hahn1-1/+6
Issue-ID: POLICY-2305 Change-Id: If056c7e9179e245fafd6badc70ff9eee78fb23b3 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-08Address more sonar issues in drools-pdpJim Hahn2-3/+3
Addressed the following sonar issues: - use of "synchronized" - use Files.delete() instead of File.delete() Issue-ID: POLICY-2305 Change-Id: Id55628fe12d9d764616e57321382a70cb5704ba1 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-07Address sonar issues in policy-managementJim Hahn6-67/+71
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>
2020-04-01Sync controller capabilities as controllers bouncejhh1-2/+2
As native policies introduce temporality in policy types supported as they are removed and added, the associated policy types that can be honored at a a given time, may need to adjust. A significan portion of this review is dedicated to multi-policy junits and telemetry instrumentation. Issue-ID: POLICY-2459 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I62bbc03411446849eaa55c9b1524220dc13c2cb0 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-03-26native policy use engine for top-down processingjhh1-18/+24
This will ensure proper invocation of all feature hooks. Issue-ID: POLICY-2388 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I8d1666bb5e9526faa588e4f613674e080181d4ba Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-03-10policy routing and reorg into policy-domainsjhh1-1/+2
- Native Drools Controller Policy support. - Move domain policies into the policy-domains project. - Route legacy/compliant operational policies to one or all controller supporting the policy's policy type. - Enhancements to scripts to invoke commands external to the container. Issue-ID: POLICY-2388 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Id41f04d10a28d2ea86bdd41334e499c28d0438ae Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-03-02http server/client managementjhh2-9/+55
This is to support the new actor architecture configuration. Issue-ID: POLICY-1625 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ieda56be38b8572d75a5fbb3775067ab537310aa1
2020-02-26Undeploy support for native rules PDP-D policies.jhh2-8/+16
Issue-ID: POLICY-2388 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaaf5e13a5db286928952bcb3e4cc0f526b0b133c
2020-02-06Store DomainMaker in PolicyEngine.jhh2-3/+22
Since this is going to be used in drools-applications, better to have it globally, reusing underlying "schema resources" rather than maintaining one or more instances in drools-applications. Issue-ID: POLICY-2345 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I0e339e77ea6281308be00381c7eda2cc9f4d6ac1
2020-01-13policy/drools-pdp jdk11 upgradesHockla, Ali (ah999m)1-2/+3
Issue-ID: POLICY-1589 Change-Id: I0ed05c6e471a7da6658e02a4ba3115d3a117cedd Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2019-11-14Invoke lock callback in session threadJim Hahn3-29/+33
Injects the callback as a DroolsRunnable into the session, if there is one. Otherwise, it invokes it via the engine's thread pool. Issue-ID: POLICY-2246 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I214480ae675d89e7335dde4eb4abe2684f7ef8ab Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-08Miscellaneous code clean upjhh2-4/+4
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-11-01Merge "Refactor duplicate code from lock managers"Jorge Hernandez3-168/+449
2019-10-31Refactor duplicate code from lock managersJim Hahn3-168/+449
Change-Id: I8910a1a4267d824f064b52c6ad08945590bd9617 Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-31upgrade to 7.28.0.Final drools librariesjhh1-1/+1
commons-lang does not seem to be packaged anymore (commons-lang3 still does, which is the desired one). There are some @SupressWarning that seem to have no effect that were removed. Some libraries that were explicitly added are transitively used now in the latest version of drools, hence some rework in the dependency and exclude sections. We will need to generate a clm report to verify. Issue-ID: POLICY-1407 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I44e09183caca72f5f33bdec0b8fa88b0b4793055 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-10-30Fix more sonar issues in drools-pdpJim Hahn1-1/+1
Sonar issue fixed: - log or rethrow exception - empty code block; moved the comment inside the empty "synchronized" block Change-Id: I55ca87a321b3a1e4079dae6d5a4d44b651cb3086 Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-24Allow encrypted property valuesjhh1-0/+9
Issue-ID: POLICY-1945 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I0317a6de838d99b579638252859e42fc49cedfa8 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-10-17Reimplement Lock API using Lock objectsJim Hahn5-3/+681
Modified PolicyResourceLockManager to just return a feature, deferring the lock() call/method to the feature, itself. The manager was also modified so that, if it can't find an enabled provider, it will return a default provider, whose lock() methods always fail. Once a feature has been identified, the manager will cache it for use thereafter. Modified the feature API to return lock objects and simplified the interface to remove the beforeXxx and afterXxx methods. Moved the unlock and refresh methods from the feature API into the lock class, renaming them to free and extend, respectively. Added a separate, feature-simple-locking project, which implements a simple version of the locking feature, over a single JVM. Extensively revised the distributed locking feature to fit in with the new API. Added support for persistence so that the various LockImpl classes can be serialized and still function correctly when they are deserialized back into new feature instances Added default implementations of free & extend to LockImpl. Modified API to take the ownerKey string, instead of the owner object. Removed Extractor as unneeded - may add via another review, if still useful. Updates per review comments: - Updated licenses in feature-simple-locking - Added beforeCreateLock & afterCreateLock to feature API - Moved SimpleLockingFeature into policy-management so that it's always available - Moved the executor service, "exsvc", into PolicyEngine - Moved Extrator into policy-utils - Changed Extractor logging level for exceptions - Fixed feature sequence numbers - Fixed mixing of seconds and milliseconds - Renamed exsvc - Modified to use property method with default value - Configured scheduled executor - Added suffix to Extractor.register() - Eliminated Feature Api and tied lock manager into engine - Added non-null checks to LockImpl parameters - Added non-null checks to createLock() parameters - Checked that lockManager is initialized Change-Id: Iddba38157ddc5f7277656979c0e679e5489eb7b1 Issue-ID: POLICY-2113 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-04Split Engine start method into "start" and "open"jhh3-14/+52
"open" meaning to open external configuration interfaces to external provisioning systems. Issue-ID: POLICY-2055 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ic984f0ebccd088503b6b13620c3b80ed8e640899 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-08-15Fix more sonar issues in drools-pdpJim Hahn3-590/+379
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 Hahn8-81/+163
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-16Fix checkstyle issues in policy-utilsJim Hahn2-7/+7
Also deleted the checkstyle suppression file. Change-Id: I51c69bce644204435fa8131c14132e0384b4e886 Issue-ID: POLICY-1909 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-11Fix checkstyle issues in policy-managementJim Hahn5-1686/+1740
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>