From 6911c78913ea9d6ab37c0c0eb67b7389b9108ada Mon Sep 17 00:00:00 2001 From: Anantha Krishna Bhatta Date: Mon, 9 Nov 2020 15:54:34 -0800 Subject: [PATCH] Added transport action support for sending notification API --- .idea/codeStyles/Project.xml | 9 ++ .../notifications/NotificationPlugin.kt | 9 +- .../notifications/action/PluginBaseAction.kt | 101 +++++++++++++ .../notifications/action/SendAction.kt | 120 --------------- .../notifications/action/SendMessageAction.kt | 102 +++++++++++++ .../notifications/channel/EmptyChannel.kt | 7 +- .../channel/NotificationChannel.kt | 4 +- .../channel/email/BaseEmailChannel.kt | 19 +-- .../channel/email/EmailMimeProvider.kt | 2 +- .../notifications/channel/email/SesChannel.kt | 26 ++-- .../channel/email/SmtpChannel.kt | 14 +- .../notifications/core/NotificationMessage.kt | 71 --------- .../notifications/model/BaseResponse.kt | 45 ++++++ .../{core => model}/ChannelMessage.kt | 34 ++++- .../{core => model}/ChannelMessageResponse.kt | 14 +- .../notifications/model/SendMessageRequest.kt | 143 ++++++++++++++++++ .../model/SendMessageResponse.kt | 123 +++++++++++++++ .../resthandler/PluginRestHandler.kt | 83 ---------- .../RestResponseToXContentListener.kt | 36 +++++ ...stHandler.kt => SendMessageRestHandler.kt} | 28 ++-- .../notifications/util/Helpers.kt | 33 ++++ .../NotificationsRestTestCase.kt | 9 +- .../notifications/channel/SmtpChannelIT.kt | 2 +- ...ndlerIT.kt => SendMessageRestHandlerIT.kt} | 2 +- ...ests.kt => SendMessageRestHandlerTests.kt} | 8 +- 25 files changed, 705 insertions(+), 339 deletions(-) create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/action/PluginBaseAction.kt delete mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/action/SendAction.kt create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/action/SendMessageAction.kt delete mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/core/NotificationMessage.kt create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/model/BaseResponse.kt rename src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/{core => model}/ChannelMessage.kt (61%) rename src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/{core => model}/ChannelMessageResponse.kt (85%) create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/model/SendMessageRequest.kt create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/model/SendMessageResponse.kt delete mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/resthandler/PluginRestHandler.kt create mode 100644 src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/resthandler/RestResponseToXContentListener.kt rename src/main/kotlin/com/amazon/opendistroforelasticsearch/notifications/resthandler/{SendRestHandler.kt => SendMessageRestHandler.kt} (62%) rename src/test/kotlin/com/amazon/opendistroforelasticsearch/notifications/resthandler/{SendRestHandlerIT.kt => SendMessageRestHandlerIT.kt} (92%) rename src/test/kotlin/com/amazon/opendistroforelasticsearch/notifications/resthandler/{SendRestHandlerTests.kt => SendMessageRestHandlerTests.kt} (86%) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 006df8a3..a58b712e 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -8,6 +8,15 @@ +