aboutsummaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org/onap
AgeCommit message (Collapse)AuthorFilesLines
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis3-70/+45
Issue-ID: POLICY-967 Change-Id: Ib19d3a89ffa328c39f7871bff59efb3dd1617f7a Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-25Copy policy-endpoints from drools-pdp to commonmmis11-4632/+4515
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-1/+1
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-26l2 management maturity pdp-dJorge Hernandez3-29/+65
configurable log location metric/audit log for transaction metrics conforming to new field definition. support metrics/audits records with custom logback filters so they are not intrusive with developer log testing. Change-Id: I7a4dcc6790b85539e613ad8705e731e7298ce106 Issue-ID: POLICY-533 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-02-21Merge "interception of facts before injection"Pamela Dragosh2-15/+91
2018-02-20Sonar fixes to drools-pdpJim Hahn21-468/+429
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 Hernandez2-15/+91
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>
2018-02-07expose immutable list of filters to its usersJorge Hernandez3-103/+149
+ additional related junits Change-Id: I00293cd9aa911dfb3d658cad4ee0441ad3410e9c Issue-ID: POLICY-164 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-01-31junits+utils to generate/test rules applicationsJorge Hernandez1-1/+1
1. utilities to generate rules applications and installing in local maven repository programmatically. 2. using these utilities, use policy abstractions, ie. controllers, containers, .. to junit test it. Change-Id: I13c35e631a1120fad503feef2593d32a99e3358f Issue-ID: POLICY-583 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-12-19Reduce tech debt in policy-managementMagnusen, Drew (dm741q)11-118/+189
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-11-30make volatile access to alive and locked flagsJorge Hernandez1-4/+4
instead of synchronized read access Change-Id: I3f4457f798d6f4d4a013bf023ed2d9c1b75d4f1f Issue-ID: POLICY-487 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-25shutdown to guarantee terminationJorge Hernandez1-32/+43
This method will ensure that once the shutdown sequence is started, it terminates either gracefully or forcefully after the grace time period expiration. It has been occassionally observed that the shutdown sequence gets stuck in the shutdown sequence of a subcomponent, such as a drools applications. This will guarantee that the shutdown completes regardless. Change-Id: I8379eea5f0b80fe6a5aed6da2f2bfbfcb1f24bc0 Issue-ID: POLICY-386 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-09Register a gson type adapter for InstantCharles Cole1-2/+4
Added a type adapter to the encoder used without a custom encoder so that it properly serializes Instant types. Issue-ID: POLICY-101 Change-Id: Ic1517505d50b81abc840a1591c7fb4a75f80a126 Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-09send messages directly through topicJorge Hernandez2-622/+619
This work is needed for consolidating the amsterdam templates used both for junits and the official one from the archetype into one, so junits can run in the official one. This work revisits the functionality of when a drools controller cannot be found to check state before delivering a message from the drools application, it will use a standalone enconder (previously configured to do so). This was intended to work like this originally, but never tested nor used as all deliveries are send through the controllers so locked/alive state is checked (but there may ocassions where we want to take this default action). Change-Id: Ie23e4e13323f3ab9fd207f8a396c1af6564b7edf Issue-ID: POLICY-101 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-28policy-engine.properties to be honored if existsJorge Hernandez1-1/+1
Change-Id: I9c8c7d56a1087a0514f4d53be293e287a26ae1bf Issue-ID: POLICY-265 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-22Merge "Removed useless parentheses"Pamela Dragosh1-4/+4
2017-09-22Merge "Added @Override method"Pamela Dragosh3-19/+20
2017-09-21Log exceptionPamela Dragosh1-0/+1
Logging as trace since it is an acceptable exception. Change-Id: Ie93e60aeb95ece9b142c87f20eeb21ef56507dc4 Issue-ID: POLICY-261 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-21Removed useless parenthesesrama-huawei1-4/+4
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-21Added @Override methodrama-huawei3-19/+20
Added diamond symbol on RHS Removed useless parentheses Issue-ID: POLICY-239 Change-Id: Ie20319a5a7298c70a18cc3773ec47f235dbdae41 Signed-off-by: rama-huawei <rama.subba.reddy.s@huawei.com>
2017-09-20load config files in ascending order by nameJorge Hernandez1-2/+12
adding predictibility for environment and controller files loading Change-Id: Id02ddca75dd0dc8da658b64b84e77bef9e82b37c Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-19Adding JUnits for Configuration ClassesPamela Dragosh3-19/+22
Also fixed some Sonar Major issues to help clean that up. Issue-ID: POLICY-109 Change-Id: Ic8a0b8d97f2be1cc1f8e8e4e8b319c6117b231a4 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-15Fix sonar related to persistence-featurePamela Dragosh2-1/+2
Sonar blocker for catchable: I am not sure why this is wrapped with an exception. Changing try-catch to use Exception | LinkageError per Jorge/Ralph. Sonar critical for logging exceptions. Sonar critical for casting to Long and reinterrupting thread. Change-Id: I44d46f005d9aa30c434c22e479034107055277ce Issue-ID: POLICY-195 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-14added "fetch timeout" backoff for UEB endpointsJorge Hernandez2-2/+33
this prevents high frequency fruitless attempts to connect to an unreachable (perhaps temporarily) UEB server. added additional management apis for noop endpoints. bump versions of jackson parsers so through snakeyaml library throughtransitive dependencies is bump up from 1.15 as it is resolved in the classpath at runtime to > 1.17 otherwise causes incompatibilities with the one used in controlloops under their own classloaders, as they expect 1.17. Change-Id: I936348c4b93a2c409c22568868c44ed330dc18f7 Issue-ID: POLICY-119 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-07Support environment configurationsJorge Hernandez5-4007/+3866
This enables PDP-D to have knowledge of any installation property or else configured via OS environment variable or as an environment file. This allows the user to query or set via REST API of programmatically through PolicyEngine any environment variable. It also provides a means to make data globally available to all drools applications. For example: http://localhost:9696/policy/pdp/engine/environment> get HTTP/1.1 200 OK Content-Length: 749 Content-Type: application/json Date: Wed, 06 Sep 2017 23:53:57 GMT Server: Jetty(9.3.14.v20161028) { "DCAE_SERVERS": "", "DCAE_TOPIC": "", "DMAAP_SERVERS": "", "ENGINE_MANAGEMENT_HOST": "0.0.0.0", "ENGINE_MANAGEMENT_PASSWORD": "", "ENGINE_MANAGEMENT_PORT": "9696", "ENGINE_MANAGEMENT_USER": "", "HEALTHCHECK_PASSWORD": "", "HEALTHCHECK_USER": "", "JAVA_HOME": "/usr/lib/jvm/java-8-oracle", "M2_HOME": "/usr/share/maven", "PAP_HOST": "", "PAP_PASSWORD": "", "PAP_USERNAME": "", "PDPD_CONFIGURATION_API_KEY": "", "PDPD_CONFIGURATION_API_SECRET": "", "PDPD_CONFIGURATION_CONSUMER_GROUP": "", "PDPD_CONFIGURATION_CONSUMER_INSTANCE": "", "PDPD_CONFIGURATION_PARTITION_KEY": "", "PDPD_CONFIGURATION_SERVERS": "", "PDPD_CONFIGURATION_TOPIC": "PDPD-CONFIGURATION", "PDP_HOST": "", "PDP_PASSWORD": "", "PDP_USERNAME": "", "POLICY_HOME": "/home/policy/snapshot", "SQL_HOST": "", "SQL_PASSWORD": "", "SQL_USER": "" } policy@newton:~/snapshot/config$ echo -n "http://one.com/aai" | http --verbose PUT :9696/policy/pdp/engine/environment/AAI_URL Content-Type:text/plain Accept:text/plain PUT /policy/pdp/engine/environment/AAI_URL HTTP/1.1 Accept: text/plain Accept-Encoding: gzip, deflate Connection: keep-alive Content-Length: 18 Content-Type: text/plain Host: localhost:9696 User-Agent: HTTPie/0.9.2 http://one.com/aai HTTP/1.1 200 OK Content-Length: 0 Content-Type: text/plain Date: Thu, 07 Sep 2017 00:05:05 GMT Server: Jetty(9.3.14.v20161028) policy@newton:~/snapshot/config$ echo -n "http://one.com/aai2" | http --verbose PUT :9696/policy/pdp/engine/environment/AAI_URL Content-Type:text/plain Accept:text/plain PUT /policy/pdp/engine/environment/AAI_URL HTTP/1.1 Accept: text/plain Accept-Encoding: gzip, deflate Connection: keep-alive Content-Length: 19 Content-Type: text/plain Host: localhost:9696 User-Agent: HTTPie/0.9.2 http://one.com/aai2 HTTP/1.1 200 OK Content-Length: 18 Content-Type: text/plain Date: Thu, 07 Sep 2017 00:05:45 GMT Server: Jetty(9.3.14.v20161028) http://one.com/aai policy@newton:~/snapshot/config$ http :9696/policy/pdp/engine/environment/AAI_URL HTTP/1.1 200 OK Content-Length: 19 Content-Type: application/json Date: Thu, 07 Sep 2017 05:14:57 GMT Server: Jetty(9.3.14.v20161028) http://one.com/aai2 Change-Id: I1fcd610938af751977bb2db925b57b4e5b3f7ba4 Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-31Support Utils Libraries for CL Lab IntegrationJorge Hernandez2-2/+5
There is a companion review in the drools-applications repo. This also includes workarounds to the recent oparent dependency introduction that breaks runtime (with the version-check-maven-plugin). It manifested by loading control loops and failing to load some classes due to different versions (in a lab environment). The issue was that underlying drools libraries use 3.2.5 and oparent has included a had dependency with transitive dependencies for some maven libraries in 3.2.3 and lower version xml parsers. Bottomoline, the classpath at runtime was formed by the union of both, with some libraries being resolved to the oparent one, and others to the drools one. These errors are very obscured to debug. Additional clean up of dependencies versions and order of build was introduced to avoid issues loading dependencies at runtime in a lab environment (non-junit).. Change-Id: If4f4201e08f7e6e1f3619f557434c1b2e23e47a5 Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-28junits in policy-managementJorge Hernandez3-25/+89
- add additional junits for policy-management module - allow for no configuration pdp-d start up. - minor changes junits for policy-endpoints to avoid race conditions in jenkins environment, starting up, and shutting down servers. Issue-ID: POLICY-109 Change-Id: Ibccefeb5d7cf762da27fe3282887df18d79db5df Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-20sonar criticals and some majorsJorge Hernandez7-394/+203
Issue-ID: POLICY-114 Change-Id: I5fe12b6538379a4d018bb76173247fe53fba21d7 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-08-02[POLICY-114] fix some sonar criticalsJorge Hernandez4-16/+11
Change-Id: Ic79b3d81ac814948ce3a956fe4c32b8a9b5c0009 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-07-28[POLICY-72] replace openecomp for drools-pdpGuo Ruijing20-0/+11340
Change-Id: I8aa8e32d3ba10f7c655b50e97aaf6865514d4777 Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>