summaryrefslogtreecommitdiffstats
path: root/policy-management
AgeCommit message (Collapse)AuthorFilesLines
2020-06-19Address checkstyle version issues in drools-pdpJim Hahn5-16/+12
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-19drools-pdp sonar issue fixesTaka Cho7-46/+46
fix all assert statements to comply with sonar issue Issue-ID: POLICY-2616 Change-Id: Ia36e3eab7c74d8dfb1ab3fa1395b1f64b173e09a Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-05Change metrics and transactions layout in logback.xmlJoseph Chou1-5/+4
Update logging code to compliant with logging standard Issue-ID: POLICY-2578 Change-Id: I98decce81eae95c006d6485bf3440ac9119b2bf5 Signed-off-by: Joseph Chou <jc2555@att.com>
2020-05-26Tests must specify serialization providerJim Hahn1-0/+6
When GSON is made the default serialization provider, several junits break. Modified them to specify the GsonJackson provider, which is what the REST classes use in production. Issue-ID: POLICY-1526 Change-Id: If1bcb955d7411cf747a14a0bf1dc069b02e2f2ea Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-21Bump Drools-Pdp to 1.7.0aditya.puthuparambil1-1/+1
Issue-ID: POLICY-2514 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: Ib18f045a621ce15f8381607ba87639dd188887e5
2020-05-21Bump Drools-Pdp to 1.6.4aditya.puthuparambil1-1/+1
Issue-ID: POLICY-2514 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: Icb874f6b91488c5003e9d22460ce57e37b11dc30
2020-04-24Bump drools-pdp 1.6.3-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2510 Change-Id: Ic6ce8069e65c9b7606ab3529ee6291bc772a4191 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-14bump to 1.6.2-SNAPSHOTjhh1-1/+1
Issue-ID: POLICY-2378 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I75d0acdc4bfb4f2c1870d3c01591e81ada2b7a5f
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 Hahn26-184/+191
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 bouncejhh2-4/+7
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 processingjhh2-21/+50
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-24Bump drools-pdp to 1.6.1-SNAPSHOTPeyton Puckett1-1/+1
Issue-ID: POLICY-2378 Change-Id: I59fb1860178cc7960f7aa553557d83d60b686ac6 Signed-off-by: Peyton Puckett <peyton.puckett@att.com>
2020-03-10policy routing and reorg into policy-domainsjhh13-191/+57
- 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-03Merge "http server/client management"Jorge Hernandez6-31/+360
2020-03-03use policy/parent awaitilityPamela Dragosh1-1/+0
This upgrades the version, but seems to work fine. Issue-ID: POLICY-2381 Change-Id: I1f9b930b28c4fdce67921fd31269724a29c26fd6 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-02http server/client managementjhh6-31/+360
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.jhh5-14/+21
Issue-ID: POLICY-2388 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iaaf5e13a5db286928952bcb3e4cc0f526b0b133c
2020-02-11Move model base classes outside feature-lifecyclejhh3-0/+138
So, it can be used in drools-application without a feature dependency. Issue-ID: POLICY-2360 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I1cf75bdd8739c35ea9b590896b177a519363e3d5
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-31Double quote local variables in drools tooling scriptRashmi Pujar1-7/+7
Addressing the last minor comment from Jorge on https://gerrit.onap.org/r/#/c/policy/drools-pdp/+/100774/. Tested OK with and without proxy settings. Issue-ID: POLICY-2330 Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca> Change-Id: Ied9e0324b0f64684ccdefd20d8bed958f468bb72
2020-01-29Parameterize mvn repo urls and proxy settingsRashmi Pujar1-6/+47
This allows the users to build the docker images for drools-pdp and drools-application using their own CI pipelines if needed. Issue-ID: POLICY-2330 Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca> Change-Id: I9ea0161b45d504be4e65a21c95e48dee4a78de3a
2020-01-13policy/drools-pdp jdk11 upgradesHockla, Ali (ah999m)13-37/+38
Issue-ID: POLICY-1589 Change-Id: I0ed05c6e471a7da6658e02a4ba3115d3a117cedd Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2020-01-08Enabling logback file to be loaded using oom configmapa.sreekumar1-2/+2
Change-Id: I4828559ff62ffc3ee41f89448a6f7e9914a2a0ba Issue-ID: POLICY-2308 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-12-09base changes to support offline pdpdjhh3-105/+384
Issue-ID: POLICY-2191 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I6f8029c1c771905357971331988a9b8408a93f10 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-11-22Ocasional race condition in upgrade junitsjhh1-2/+2
Issue-ID: POLICY-2158 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I5b1295508a291338d0ea668f598ce038304a35bc
2019-11-14Invoke lock callback in session threadJim Hahn6-79/+134
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-14Merge "Add 'DroolsRunnable' class"Jorge Hernandez1-3/+3
2019-11-14Add 'DroolsRunnable' classStraubs, Ralph (rs8887)1-3/+3
This provides a simple way to run arbitrary Java code within the Drools thread. This change also includes a general way to specify Drools rules that are automatically added to every Drools session. Change-Id: I5ddcca4c807dc552fbcbd4a19dce311a4d358279 Issue-ID: POLICY-1948 Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
2019-11-12Dispose drools controllers in junit testsjhh1-9/+30
Issue-ID: POLICY-1407 Change-Id: I4db3489c242a6cdd39444de19c9c8da83559bee4 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-11-11Add drools factory clean up statements to junitsjhh5-149/+278
An attempt to tackle some intermittent junit errors experienced by team mates. Issue-ID: POLICY-1407 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I68a90dc50fe2fa5bfc7214aa26e2e5f78f1e6c23 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-11-08Miscellaneous code clean upjhh9-45/+44
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-08Merge "Fix new sonar issues in RestManager"Pamela Dragosh1-31/+31
2019-11-06Fix new sonar issues in RestManagerJim Hahn1-31/+31
Eliminated duplicate code issues. Unfortunately, introduced new sonar issues with lambda expressions. Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ib5853fab6135d2177da449ef6261a352ee4f203e
2019-11-06Drools Controller upgrades Testsjhh8-33/+339
Issue-ID: POLICY-1407 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I6963fced5608b62a41b73fef5070c21cf45d6fbe Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-11-06Merge "Fix duplicate code in drools-pdp RestManager"Liam Fallon1-342/+222
2019-11-06Address drools-pdp sonar issuesJim Hahn3-73/+57
Addressed more sonar issues in drools-pdp: - unwrap multiple instances of the same annotation (NamedQuery) - use lambda instead of anonymous class - duplicate code; addressed by using annotation instead of toString. This still leaves other duplicate code. Issue-ID: POLICY-2203 Change-Id: I8c6ff6562820af638044f134eb8a6725a5f05e8e Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-06Fix duplicate code in drools-pdp RestManagerJim Hahn1-342/+222
Change-Id: I22821a5027d01f0965c54b60389d3988ac53ed5c Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-04Use jersey dependencies from policy-endpointsliamfallon1-21/+0
There is no need to ahve Jersey dependencies in the PDP POMs as they are inherited fromt he policy-endpoints POM. Issue-ID: POLICY-2209 Change-Id: Iaa51995864eec0bf5b4134719c32e956295084a1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-01Add common Jersey versionliamfallon1-8/+1
Add a common version of Jersey for all Policy Framework components. Issue-ID: POLICY-2209 Change-Id: Iab5a62475eb73b5e4db8a02cfa029002a7f5f8ea Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-01Merge "Refactor duplicate code from lock managers"Jorge Hernandez6-264/+1144
2019-10-31Refactor duplicate code from lock managersJim Hahn6-264/+1144
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 Hahn2-5/+5
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-29Cleanup eclipse warnings in drools-pdpJim Hahn1-1/+0
Issue-ID: POLICY-2203 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I3e854b1ea1986cd4992dc2ff84d799e970e443a9
2019-10-24Allow encrypted property valuesjhh3-16/+30
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 Hahn9-4/+1683
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-16Add YAML support to drools-pdp rest servletsJim Hahn2-4/+6
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-09-10Bump versions for drools-pdp masterJim Hahn1-1/+1
Change-Id: I9882ab12334dc4b548de527ab2d7dbfc22177113 Issue-ID: POLICY-2045 Signed-off-by: Jim Hahn <jrh3@att.com>