Fix class loader issue for notifications response#38
Fix class loader issue for notifications response#38joshuali925 wants to merge 5 commits intoopensearch-project:mainfrom joshuali925:notifications-classloader
Conversation
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
dblock
left a comment
There was a problem hiding this comment.
I love this as a start.
Try to refactor this where you don't need to override fun onResponse manually in every instance.
I think I want to be able to write this:
wrapper.execute(
SEND_NOTIFICATION_ACTION_TYPE,
SendNotificationRequest(eventSource, channelMessage, channelIds, threadContext),
object: SomeNewType<ActionResponse, SendNotificationResponse>
}
dblock
left a comment
There was a problem hiding this comment.
This should be refactored, and definitely needs tests to be merged.
I was trying to extract a |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
|
@joshuali925 excellent! Is it worth putting this into a method (e.g. client.execute(
DELETE_NOTIFICATION_CONFIG_ACTION_TYPE,
request,
listener
wrapActionListener(listener) { response -> recreateObject(response) { DeleteNotificationConfigResponse(it) } }
)I almost think that maybe this entire implementation is a map of |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
|
@dblock agree that could look cleaner, but in |
|
Closing for #40 |
@joshuali925 @dblock I tried this idea but the code was not clean as I thought. This is mostly because of generic types and number fo params required by each execute call. I would suggest keeping it as is for now. |
Signed-off-by: Joshua Li joshuali925@gmail.com
Description
fix from @dai-chen:
Recreate the response object from
ActionResponseas specific notifications response in notifications plugin interface to avoid classloader issue when passing response between pluginsIssues Resolved
#37
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.