From 7e1e226ad0dc45674aead99c8c57917c6b25d1cd Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 17:49:29 -0700 Subject: [PATCH] make common-utils core compatible (#507) (#510) (cherry picked from commit fad45254c65c22eeda03ebefd4a2204ba30e7c64) Signed-off-by: Subhobrata Dey Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../opensearch/commons/alerting/AlertingPluginInterface.kt | 4 ++-- .../commons/notifications/NotificationsPluginInterface.kt | 4 ++-- .../opensearch/commons/notifications/action/BaseResponse.kt | 2 +- .../commons/notifications/model/NotificationEvent.kt | 2 +- .../org/opensearch/commons/utils/SecureClientWrapper.kt | 6 +++--- .../commons/alerting/AlertingPluginInterfaceTests.kt | 2 +- .../notifications/NotificationsPluginInterfaceTests.kt | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt b/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt index c905d2b3..5949582b 100644 --- a/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt +++ b/src/main/kotlin/org/opensearch/commons/alerting/AlertingPluginInterface.kt @@ -4,8 +4,6 @@ */ package org.opensearch.commons.alerting -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse import org.opensearch.client.node.NodeClient import org.opensearch.commons.alerting.action.AcknowledgeAlertRequest import org.opensearch.commons.alerting.action.AcknowledgeAlertResponse @@ -31,6 +29,8 @@ import org.opensearch.commons.alerting.action.PublishFindingsRequest import org.opensearch.commons.alerting.action.SubscribeFindingsResponse import org.opensearch.commons.notifications.action.BaseResponse import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.common.io.stream.Writeable diff --git a/src/main/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterface.kt b/src/main/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterface.kt index 59b25054..38359f32 100644 --- a/src/main/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterface.kt +++ b/src/main/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterface.kt @@ -4,8 +4,6 @@ */ package org.opensearch.commons.notifications -import org.opensearch.action.ActionListener -import org.opensearch.action.ActionResponse import org.opensearch.client.node.NodeClient import org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT import org.opensearch.commons.notifications.action.BaseResponse @@ -37,6 +35,8 @@ import org.opensearch.commons.notifications.model.ChannelMessage import org.opensearch.commons.notifications.model.EventSource import org.opensearch.commons.utils.SecureClientWrapper import org.opensearch.commons.utils.recreateObject +import org.opensearch.core.action.ActionListener +import org.opensearch.core.action.ActionResponse import org.opensearch.core.common.io.stream.Writeable /** diff --git a/src/main/kotlin/org/opensearch/commons/notifications/action/BaseResponse.kt b/src/main/kotlin/org/opensearch/commons/notifications/action/BaseResponse.kt index 68837e9c..ecbbf4e9 100644 --- a/src/main/kotlin/org/opensearch/commons/notifications/action/BaseResponse.kt +++ b/src/main/kotlin/org/opensearch/commons/notifications/action/BaseResponse.kt @@ -5,7 +5,7 @@ package org.opensearch.commons.notifications.action -import org.opensearch.action.ActionResponse +import org.opensearch.core.action.ActionResponse import org.opensearch.core.common.io.stream.StreamInput import org.opensearch.core.rest.RestStatus import org.opensearch.core.xcontent.ToXContentObject diff --git a/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt b/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt index 87f637b0..2b3c8f40 100644 --- a/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt +++ b/src/main/kotlin/org/opensearch/commons/notifications/model/NotificationEvent.kt @@ -4,7 +4,6 @@ */ package org.opensearch.commons.notifications.model -import org.opensearch.common.xcontent.XContentHelper import org.opensearch.common.xcontent.XContentType import org.opensearch.commons.notifications.NotificationConstants.EVENT_SOURCE_TAG import org.opensearch.commons.notifications.NotificationConstants.STATUS_LIST_TAG @@ -16,6 +15,7 @@ import org.opensearch.core.common.io.stream.Writeable import org.opensearch.core.xcontent.ToXContent import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS import org.opensearch.core.xcontent.XContentBuilder +import org.opensearch.core.xcontent.XContentHelper import org.opensearch.core.xcontent.XContentParser import org.opensearch.core.xcontent.XContentParserUtils import java.io.IOException diff --git a/src/main/kotlin/org/opensearch/commons/utils/SecureClientWrapper.kt b/src/main/kotlin/org/opensearch/commons/utils/SecureClientWrapper.kt index bc0f0596..ffdb1676 100644 --- a/src/main/kotlin/org/opensearch/commons/utils/SecureClientWrapper.kt +++ b/src/main/kotlin/org/opensearch/commons/utils/SecureClientWrapper.kt @@ -5,10 +5,7 @@ package org.opensearch.commons.utils -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/src/test/kotlin/org/opensearch/commons/alerting/AlertingPluginInterfaceTests.kt b/src/test/kotlin/org/opensearch/commons/alerting/AlertingPluginInterfaceTests.kt index b8aea1b8..57670fc8 100644 --- a/src/test/kotlin/org/opensearch/commons/alerting/AlertingPluginInterfaceTests.kt +++ b/src/test/kotlin/org/opensearch/commons/alerting/AlertingPluginInterfaceTests.kt @@ -9,7 +9,6 @@ import org.mockito.Mock import org.mockito.Mockito import org.mockito.Mockito.mock import org.mockito.junit.jupiter.MockitoExtension -import org.opensearch.action.ActionListener import org.opensearch.action.ActionType import org.opensearch.client.node.NodeClient import org.opensearch.common.settings.Settings @@ -36,6 +35,7 @@ import org.opensearch.commons.alerting.model.FindingDocument import org.opensearch.commons.alerting.model.FindingWithDocs import org.opensearch.commons.alerting.model.Monitor import org.opensearch.commons.alerting.model.Workflow +import org.opensearch.core.action.ActionListener import org.opensearch.core.common.io.stream.NamedWriteableRegistry import org.opensearch.core.rest.RestStatus import org.opensearch.index.seqno.SequenceNumbers diff --git a/src/test/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterfaceTests.kt b/src/test/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterfaceTests.kt index 2e09db60..ae7d0f3f 100644 --- a/src/test/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterfaceTests.kt +++ b/src/test/kotlin/org/opensearch/commons/notifications/NotificationsPluginInterfaceTests.kt @@ -17,7 +17,6 @@ import org.mockito.Mockito.mock import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.junit.jupiter.MockitoExtension -import org.opensearch.action.ActionListener import org.opensearch.action.ActionType import org.opensearch.client.node.NodeClient import org.opensearch.commons.destination.response.LegacyDestinationResponse @@ -49,6 +48,7 @@ import org.opensearch.commons.notifications.model.NotificationConfigSearchResult import org.opensearch.commons.notifications.model.NotificationEvent import org.opensearch.commons.notifications.model.SeverityType import org.opensearch.commons.notifications.model.Slack +import org.opensearch.core.action.ActionListener import org.opensearch.core.rest.RestStatus import java.time.Instant