From d36b9c0133442de95763b3de72f5887053afb8df Mon Sep 17 00:00:00 2001 From: zhichao-aws Date: Wed, 16 Aug 2023 13:01:38 +0800 Subject: [PATCH] fix actions components after core #9082 (#739) * fix actions Signed-off-by: zhichao-aws * fix test Signed-off-by: zhichao-aws --------- Signed-off-by: zhichao-aws --- .../org/opensearch/notifications/NotificationPlugin.kt | 2 +- .../notifications/action/CreateNotificationConfigAction.kt | 2 +- .../notifications/action/DeleteNotificationConfigAction.kt | 2 +- .../opensearch/notifications/action/GetChannelListAction.kt | 2 +- .../notifications/action/GetNotificationConfigAction.kt | 2 +- .../notifications/action/GetPluginFeaturesAction.kt | 2 +- .../org/opensearch/notifications/action/PluginBaseAction.kt | 4 ++-- .../notifications/action/PublishNotificationAction.kt | 2 +- .../notifications/action/SendNotificationAction.kt | 2 +- .../notifications/action/SendTestNotificationAction.kt | 2 +- .../notifications/action/UpdateNotificationConfigAction.kt | 2 +- .../org/opensearch/notifications/util/SecureIndexClient.kt | 6 +++--- .../org/opensearch/notifications/util/SuspendUtils.kt | 2 +- .../opensearch/notifications/action/PluginActionTests.kt | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/NotificationPlugin.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/NotificationPlugin.kt index cefbc43b..2ac0ebae 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/NotificationPlugin.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/NotificationPlugin.kt @@ -6,7 +6,6 @@ package org.opensearch.notifications import org.opensearch.action.ActionRequest -import org.opensearch.action.ActionResponse import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.node.DiscoveryNodes @@ -18,6 +17,7 @@ import org.opensearch.common.settings.Settings import org.opensearch.common.settings.SettingsFilter import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.logger +import org.opensearch.core.action.ActionResponse import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.env.Environment diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/CreateNotificationConfigAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/CreateNotificationConfigAction.kt index 9080eefa..d7eedbd7 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/CreateNotificationConfigAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/CreateNotificationConfigAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.CreateNotificationConfigReque import org.opensearch.commons.notifications.action.CreateNotificationConfigResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/DeleteNotificationConfigAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/DeleteNotificationConfigAction.kt index ec91e3fa..4bdcb3a7 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/DeleteNotificationConfigAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/DeleteNotificationConfigAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.DeleteNotificationConfigReque import org.opensearch.commons.notifications.action.DeleteNotificationConfigResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetChannelListAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetChannelListAction.kt index ad2adb47..95cafc9d 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetChannelListAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetChannelListAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.GetChannelListRequest import org.opensearch.commons.notifications.action.GetChannelListResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetNotificationConfigAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetNotificationConfigAction.kt index 6549ac9e..8eb5784a 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetNotificationConfigAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetNotificationConfigAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.GetNotificationConfigRequest import org.opensearch.commons.notifications.action.GetNotificationConfigResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetPluginFeaturesAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetPluginFeaturesAction.kt index 98ac1416..6ffb19f5 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetPluginFeaturesAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/GetPluginFeaturesAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.GetPluginFeaturesRequest import org.opensearch.commons.notifications.action.GetPluginFeaturesResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.CoreProvider import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PluginBaseAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PluginBaseAction.kt index 92987aff..2e2c1020 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PluginBaseAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PluginBaseAction.kt @@ -10,9 +10,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import org.opensearch.OpenSearchSecurityException import org.opensearch.OpenSearchStatusException -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest -import org.opensearch.action.ActionResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.Client @@ -20,6 +18,8 @@ import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT import org.opensearch.commons.authuser.User import org.opensearch.commons.utils.logger +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.rest.RestStatus import org.opensearch.index.IndexNotFoundException diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PublishNotificationAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PublishNotificationAction.kt index 1dbfe1d6..929be1e1 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PublishNotificationAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/PublishNotificationAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.LegacyPublishNotificationRequ import org.opensearch.commons.notifications.action.LegacyPublishNotificationResponse import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.send.SendMessageActionHelper import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendNotificationAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendNotificationAction.kt index 5926ade3..d6dd05f5 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendNotificationAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendNotificationAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.notifications.action.SendNotificationRequest import org.opensearch.commons.notifications.action.SendNotificationResponse import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.send.SendMessageActionHelper import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendTestNotificationAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendTestNotificationAction.kt index ce5fefa1..15a533f8 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendTestNotificationAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/SendTestNotificationAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionType import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction @@ -15,6 +14,7 @@ import org.opensearch.common.inject.Inject import org.opensearch.commons.notifications.NotificationsPluginInterface import org.opensearch.commons.notifications.action.SendNotificationResponse import org.opensearch.commons.utils.logger +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.NotificationPlugin.Companion.LOG_PREFIX import org.opensearch.notifications.model.SendTestNotificationRequest diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/UpdateNotificationConfigAction.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/UpdateNotificationConfigAction.kt index 7a810be0..3e9830cc 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/UpdateNotificationConfigAction.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/action/UpdateNotificationConfigAction.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.action -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client @@ -15,6 +14,7 @@ import org.opensearch.commons.notifications.action.NotificationsActions import org.opensearch.commons.notifications.action.UpdateNotificationConfigRequest import org.opensearch.commons.notifications.action.UpdateNotificationConfigResponse import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SecureIndexClient.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SecureIndexClient.kt index 42ffd700..4bea83c8 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SecureIndexClient.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SecureIndexClient.kt @@ -5,10 +5,7 @@ package org.opensearch.notifications.util -import org.opensearch.action.ActionFuture -import org.opensearch.action.ActionListener import org.opensearch.action.ActionRequest -import org.opensearch.action.ActionResponse import org.opensearch.action.ActionType import org.opensearch.action.bulk.BulkRequest import org.opensearch.action.bulk.BulkResponse @@ -38,7 +35,10 @@ import org.opensearch.action.termvectors.TermVectorsResponse import org.opensearch.action.update.UpdateRequest import org.opensearch.action.update.UpdateResponse import org.opensearch.client.Client +import org.opensearch.common.action.ActionFuture import org.opensearch.common.util.concurrent.ThreadContext +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse /** * Wrapper class on [Client] with security context removed. diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SuspendUtils.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SuspendUtils.kt index 590c81b2..913dc057 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SuspendUtils.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/util/SuspendUtils.kt @@ -7,8 +7,8 @@ package org.opensearch.notifications.util import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.withTimeout -import org.opensearch.action.ActionListener import org.opensearch.client.OpenSearchClient +import org.opensearch.core.action.ActionListener import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/action/PluginActionTests.kt b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/action/PluginActionTests.kt index 03004299..a2d07f45 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/action/PluginActionTests.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/action/PluginActionTests.kt @@ -14,7 +14,6 @@ import org.mockito.Answers import org.mockito.Mock import org.mockito.Mockito.mock import org.mockito.junit.jupiter.MockitoExtension -import org.opensearch.action.ActionListener import org.opensearch.action.support.ActionFilters import org.opensearch.client.Client import org.opensearch.commons.destination.response.LegacyDestinationResponse @@ -43,6 +42,7 @@ import org.opensearch.commons.notifications.model.EventStatus import org.opensearch.commons.notifications.model.NotificationConfigSearchResult import org.opensearch.commons.notifications.model.NotificationEvent import org.opensearch.commons.notifications.model.SeverityType +import org.opensearch.core.action.ActionListener import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions