aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus
AgeCommit message (Collapse)AuthorFilesLines
2024-04-24Remove leftover UEB configurationsadheli.tavares3-5/+4
Issue-ID: POLICY-4945 Change-Id: I05f7dca432ed859360e2239bba91ee5c35229697 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-04-10Dependency management updateadheli.tavares11-1059/+0
- including dependencies to pom.xml files only where they are used, avoiding extra dependencies being added in all packages. - removal of unused UEB topic. Issue-ID: POLICY-4945 Change-Id: Ifc0212af2bc938e357e1addebcec591f9d6cfc14 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-03-14Update dependenciesadheli.tavares1-2/+0
- add dependencies that were brought by oparent - remove versions of dependencies already managed by policy parent - fix any code related to those dependencies Issue-ID: POLICY-4945 Change-Id: I88ec8ec3d0094592c29a4a63d119dfb1022518df Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-02-07Remove Dmaap references from policy-commonrameshiyer2716-1553/+16
- updated dependencies for jakarta.* compabilities - other dependency updates for security fixes Issue-ID: POLICY-4881 Change-Id: I979d944fcd21279f618d1bcbfe12e914ba30077f Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
2024-02-07Addition of tracing for Kafkasaul.gill11-4/+92
Added open telemetry-based interceptors Messages will be tagged with tracing information Issue-ID: POLICY-4922 Change-Id: If4234a642c3eb7dd6c3acaf2f06b2efb2ddef8af Signed-off-by: saul.gill <saul.gill@est.tech>
2023-12-18Apply lower case to any topics to be compatible with Kafka.adheli.tavares9-52/+53
Issue-ID: POLICY-4402 Change-Id: Iebaec5f52a1fa0feb881ccfcb5319bc8a951b496 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-12-14Add default fetch timeout for kafka clientrameshiyer271-1/+12
Issue-ID: POLICY-4201 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I494f2bd9e02edf61e8a8a199018356cd162e0d45
2023-09-29Fix security vulnerabilitiesadheli.tavares4-211/+215
- iq nexus vulnerabilities - sonar security hotspots and code smell Issue-ID: POLICY-4761 Issue-ID: POLICY-4833 Change-Id: Iab2e07d2ee7b90031bc5a30210ce7d3f5a47b3fd Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-02-27Fixed sonar issues in policy-commonSuresh Charan2-30/+23
Reduced technical debt by fixing sonar issues Issue-ID: POLICY-4536 Change-Id: I9f8366ea49ab4e5541d64db2fe1f6e8f138ce763 Signed-off-by: Suresh Charan <suresh.charan@bell.ca>
2023-01-31Upgrade and clean up dependenciesliamfallon1-2/+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: Iec5ba1283acd506c9f3c7fe7b5d7858db6abbaa7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-09-21Publish and Subscribe to Kafka topicSirisha_Manchikanti5-21/+130
Issue-ID: POLICY-4134 Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech> Change-Id: Idefa5b6f3cb702a4b478b76570717e73214d235a
2022-07-22Introduce Custom Kafka End pointSirisha_Manchikanti11-0/+909
Issue-ID: POLICY-4133 Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech> Change-Id: I2745f3af97e9bb83d94c5cb6d29dfd452d315506
2021-07-02Merge "Use UUID for topic consumer instance"Jim Hahn1-5/+10
2021-07-02Wait after fetch exception on topicJim Hahn1-4/+18
When dmaap is inaccessible for some reason, the topic source frequently enters a fast fail loop, rapidly filling up the log. Modified the code to wait the configured fetchTimeout when this occurs. With any luck, this will also fix the sporadic kubernetes crash-fail loops sometimes seen with the xacml-pdp pod. Modified to limit how long it will sleep after a failure, regardless of the fetchTimeout that was specified. Issue-ID: POLICY-3457 Change-Id: I88e360fb1d31197b46f4959e5ea0ea2d741ad25c Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-01Use UUID for topic consumer instanceJim Hahn1-5/+10
Modified the code so that if the consumer group is defined, but the consumer instance is not, then policy-endpoints will generate a UUID for the consumer instance. Made the logic a little more straight-forward in response to a review comment. Issue-ID: POLICY-3405 Change-Id: If74440bdb01525bc463a28e5b8a9a2eca89a855a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-17Use lombok in policy-endpointsJim Hahn7-112/+37
Issue-ID: POLICY-3394 Change-Id: I8dfb0814d5cc544b2c334dc11a3e69ef407f163f Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-24Merge "Enhance toString methods in factory classes"Jim Hahn7-18/+12
2021-05-21Fix sonar duplicate code issueJim Hahn1-49/+55
Issue-ID: POLICY-3284 Change-Id: I78c3a8ac92e18e2b0088eb07e27a4e97866d6182 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-21Enhance toString methods in factory classesJim Hahn7-18/+12
The factory classes in policy-endpoints have toString() methods that return "[]" for their list contents. Updated the code to provide a list of the keys rather than just an empty list. Also replaced some toString() methods with lombok. Also replace StringBuilder with concatenation in some cases. Issue-ID: POLICY-3298 Change-Id: I64fca21a4b009f7e09fcc482b5d156753fb7e680 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-07Change java.util.regex to re2jJim Hahn5-5/+5
Sonar complains about java.util.regex. Thought I used re2j when creating all of the patterns, but apparently not. Fixed that oversight. Issue-ID: POLICY-3284 Change-Id: Idbec112ab0d4c3b477ce357f8a556d95e4dea083 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in policy-commonJim Hahn11-43/+53
Fixed sonars: - use "var" instead of actual type name - re-interrupt threads - use rej2 split() instead of String split() Issue-ID: POLICY-3285 Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-04Fixing sonar issues in policy-commona.sreekumar7-14/+21
Change-Id: I4dce0dbdf71d01fbb59e9bf861d1af1ab49e5ae7 Issue-ID: POLICY-2914 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-10-29Remove server-side filtering from policy-endpointsJim Hahn2-90/+5
ONAP DMaaP Message Router no longer supports server-side filtering. Removed it from policy-endpoints. Issue-ID: POLICY-2881 Change-Id: I08157f7699608af63992dec78a61c5f9c55037b9 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-20Remove jackson from policy-commonJim Hahn1-3/+1
Issue-ID: POLICY-1528 Change-Id: Ic4b9314a770e53cefb93776bfede35591363690e Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-18Changes for checkstyle 8.32liamfallon1-2/+2
Issue-ID: POLICY-2188 Change-Id: I00843c61a6567001fc35c3ebb77b6843a1eb7da2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-17Cleanup various sonar issues in policy-commonJim Hahn5-13/+8
Addressed the following issues: - unused imports - unused method parameters - use assertEquals, assertSame instead of assertTrue - provide the parametrized type for this generic Also fixed some checkstyle issues: - removed blank lines between "import" groups Issue-ID: POLICY-2650 Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-02Code changes for dmaap-client upgradeJim Hahn1-4/+11
Issue-ID: POLICY-1996 Change-Id: Id8a3acf9406c6acada4c3ffee679f2baf819cded Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-06Address sonar issues in commonJim Hahn3-20/+14
Addressed the following sonar issues: - missing assertion in junit test case - disable sonars about setAccessible() as it's required for jackson emulation - sleep in junit - don't use wild-cards (e.g., "*") with java.util Pattern - use re2j instead of java.util Pattern - use String methods (e.g., startsWith()) - duplicate method bodies - duplicate code in Coder classes - string concatenation in logger calls - UTF-8 encoding - return primitive instead of boxed primitive - add assertion to tests - renamed support methods from doTestXxx to verifyXxx - cognitive complexity - use AtomicRef instead of volatile - use specific Functionals (e.g., IntConsumer) - function always returns the same value - serializable vs transient Issue-ID: POLICY-2305 Change-Id: I08eb7aa495a80bdc1d26827ba17a7946c83b9828 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-27More sonar issues cleanupPamela Dragosh2-10/+6
Either log or rethrow Use boolean expression Add at least one test Remove commented out code Issue-ID: POLICY-2204 Change-Id: I4fdf31aea75303e4f49d25198eb3b12341995bfe Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-14Sonar cleanup overrides and fixesPamela Dragosh1-4/+4
Removal of UTF-8 because its already set capabilities doesn't generate any code, no need to include override false positives for passwords etc. override for logging and exception throw that we want add synchronized to overrides that are synchronized ignore checking of some conditions adding synchronized to match set* methods Issue-ID: POLICY-2321 Change-Id: I26d9ca22a0cdd67fdaae9c44b718b8dc103f190e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-29Cleanup eclipse warnings in commonJim Hahn1-1/+1
Issue-ID: POLICY-2204 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If55ea1a804997ab751f15813e6b643572d4f189f
2019-07-30Fix managed noop topic sourceJim Hahn1-9/+0
NOOP topic sources configured via TopicParameterGroup are left unmanaged. Removed a new override method, as it did not pass the "managed" flag down, while the method that already existed in the superclass already works correctly. Also restored "null" lists to TopicParameterGroup so-as not to break the behavior of its validate() method. Change-Id: Id392a3263c3bd1c8f278461715b441719817c47c Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-29Add addTopic(List<TopicParams>)Jim Hahn3-1/+28
New services are typically configured using TopicParameters. These are converted into Properties before being passed to TopicEndpoint.addTopic(), which then converts them into BusTopicParams before configuring a given topic. Added TopicEndpoint.addTopic(List<TopicParams>), which makes it possible to configure the topics without going into the intermediate Properties. Furthermore, because TopicParams is a subclass of BusTopicParams, no conversion is needed for that either, so the TopicParams can be passed directly into the configuration classes. Incorporated changes from review. Change-Id: Id87e2c6812e36ae1a3ac680e6b35208667971782 Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-25Changes to add missing topic parametersa.sreekumar1-100/+5
Changes to support parameters which would be critical to run in a secure environment. Change-Id: Ia7df174261041b35e57b9f1f2be7552e5dcd2cec Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-07-05Fix sonar issues in policy/endpointsJim Hahn18-135/+212
Sonar fixes, other than code coverage. These changes are disruptive and will likely cause breakage in a number of policy repos. Renamed constants. Moved constants/factories from interfaces to classes. Change-Id: I182d50320aa6b53e383081af806c60dd2f806cbe Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-26Fix some sonar issues in policy-endpointsJim Hahn6-636/+244
Refactored various classes to reduce cyclomatic complexity. Introduced some endpoint utility classes to facilitate extraction and conversion of property values, and populating of common "builder" values. Change-Id: Ie1c91cd94cb54700dc9127f72780b4d94b82ec39 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-12Apply simple sonar fixesJim Hahn5-37/+27
Note: A number of these were identified, by SonarLint, in the Test classes, which are not typically scanned by Sonar. Removed unnecessary imports. Removed unneeded "throws Xxx". Replaced lambda with method references. Replaced duplicate strings with constants. Replaced try-fail-catch with assert-j methods to eliminate sonar complaints about duplicate failure messages. Added missing @Override annotations. Use map.computeIfAbsent() where appropriate. Also fixed some minor checkstyle issues. Removed unneeded "volatile" declarations. Replaced some if-else constructs with "?:" construct, per sonar. Replaced Object.wait() with CountDownLatch.await(); according to sonar (and javadocs), Object.wait() can return due to "spurious wakeups". Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse. Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-13Add Network Logging FeatureDaniel Cruz5-26/+21
This is part 1 of introducing the mdc filter feature. Network logging has to have interception points in order to pre/post process messages coming in from a network endpoint. The OrderedService interface and OrderedServiceImpl of the drools-pdp project have now been migrated to common but is also left in drools-pdp to mitigate disruption to existing features. However for features that need to use common's OrderedServiceImpl and drools-pdp version of OrderedServiceImpl there will be a conflict with getSequenceNumber(). So a migration of the other features is suggested. Network logging is moved to its own util class so that feature hooks can be invoked any time an event is being logged by a network logger. This util class will also be accessible to drools-applications in the case where drools-applications would like to invoke network logging features for REST events. Change-Id: I83d7c46e5abb351486f841c3be4d9009f7992476 Issue-ID: POLICY-1499 Signed-off-by: Daniel Cruz <dc443y@att.com>
2019-02-21Support for lab contextual topic names.Jorge Hernandez11-31/+89
This work allows a drools application, with its drl template to refer to the topic name by its invariable canonical name, ie. POLICY-CL-MGT. Since the drl is a design time artifact, it is desired to know topics by its canonical non-changeable name. The actual per lab environment topic name may change on a per deployment basis, for example POLICY-CL-MGT-WINDRIVER or POLICY-CL-MGT-TLAB. The template can still use POLICY-CL-MGT without modification but the actual installation configuration would use the "effectiveTopic" property to point to the right topic on a per lab basis. This also helps with installation (long story) since the canonical topics will be known ahead of time. Change-Id: I8322bf7e427569c37a76eea5ce6d5b9547cb2ff3 Issue-ID: POLICY-1534 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-02-13Add gson handler and testsJim Hahn1-1/+3
Added JacksonHandler which provides jackson behavior in gson. Also added classes to facilitate testing of gson serializations. Added compareGson(xxx, Class). Removed trailing spaces from some files. Updated license dates. Replaced incorrect constant with ${xxx} in json test file. Fixed typo in test method name. Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-08Return true only if thread has been really startedKrzysztof Opasiak1-1/+2
Accortding to doc start() should return true if start operation was successful. Unfortunately value of this.alive may change between end of synchronized block and return for example when other thread executes stop() in parallel. Change-Id: I4103f0f4c65620c47b4acf2d276f104937b91187 Issue-ID: POLICY-1387 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2019-01-31Fix potential race conditionKrzysztof Opasiak1-1/+1
init() is currently called outside of synhronized block. This is may lead to race condition as init() creates new bus consumer (this.consumer) which is the copied and nulled in stop() synchronized block. This may lead to race condition if: Thread #1 Thread #2 this.alive = true; this.alive = false consumerCopy = this.consumer; this.consumer = new Consumer(); // false if(consumerCopy != null) { consumerCopy.close(); } else { log.warn(); } As a result, new BusConsumers are being created but they are never close(). Issue-ID: POLICY-1387 Change-Id: I2eadb12ef1c4b07b9e47dc6ebc096acc713299a0 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2019-01-31Exteract common paramsKrzysztof Opasiak1-36/+21
Most of parameters used to initialize consumers are repeated in every branch. Instead of having 3 copies of the same code let's extract all common values and then add only those which are specific to given consumer type. Change-Id: I5884f6dd77a7e2f1a7f7614c909c1cad4826d4f1 Issue-ID: POLICY-1387 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2019-01-31Don't reinit allowSelfSignedCertsKrzysztof Opasiak1-8/+4
allowselfsignedcerts field is defined and initialized in BusTopicBase so there is need to overwrite it once agin with the same value. Change-Id: Id0a389921954606392eb2cb3c23cd0d8ee3dc4ae Issue-ID: POLICY-1387 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2019-01-31Use helper class to retrieve network loggerKrzysztof Opasiak3-14/+18
Instead of abusing constant from Topic interface use new dedicated helper class to retrive network logger. Issue-ID: POLICY-1486 Change-Id: Ia715aafb578aeb2842566de2623e8d22e42652fc Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
2019-01-23Add gson support to policy-endpointsJim Hahn1-1/+11
Added "provider" property to both http client and server builders. The provider defaults to jackson, to maintain backward compatibility until other policy code has been converted to gson. Removed commented item from pom. Added some comments and re-arranged a few pieces of code. Fixed a few typos and removed spacing at the end of some lines. Reordered imports. Added comments about limitations when using jersey-media-json-jackson. Address ridiculous checkstyle complaint. Support comma-separated list of serialization providers in jersey client. Disabled metainf discovery from jersey client and server so that the media-json dependencies could be re-instated in the pom. Address another ridiculous checkstyle complaint. Change-Id: Ic5a93b475d0ee9b435352b3516de6b865b00a86a Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-15Remove policy-endpoints checkstyle suppressionsJim Hahn8-1128/+1215
Split class files so each file only contains one class. Change-Id: Iaf94c4c079380dc7db3aff2affbe48f50e3cc0a2 Issue-ID: POLICY-1134 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-11Adding NOOP sources supportJorge Hernandez10-280/+678
In addition, Noop* classes have been refactored to increase code reuse and clean some checkstyle issues. Additional Junits have been added for existing functionality. Change-Id: I072f9ff2f415630ac82eca949a8360249f73da86 Issue-ID: POLICY-1397 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2018-11-27Fix checkstyle issue in policy commonKrishnakumar Jinka1-31/+34
Move method into class it is being called. Fix minor checkstyle formatting in the class. The changes have side effects hence revert some changes. Modify the javadoc tags Issue-ID: POLICY-1251 Change-Id: Iecb513dafe3f60628664f3e60d6c49d3e4ce3148 Signed-off-by: kris.jinka <kris.jinka@samsung.com>
2018-11-06Update dmaap code for 1.1.9Pamela Dragosh2-7/+7
The new version has changed class names. Issue-ID: POLICY-1229 Change-Id: Id268b1a57667ffa3b5950dba7c10db2181586245 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>