diff --git a/.github/workflows/notifications-test-and-build-workflow.yml b/.github/workflows/notifications-test-and-build-workflow.yml index 7430a48d..647208b2 100644 --- a/.github/workflows/notifications-test-and-build-workflow.yml +++ b/.github/workflows/notifications-test-and-build-workflow.yml @@ -20,10 +20,13 @@ jobs: fail-fast: false matrix: java: [21, 23] + os: + - ubuntu-24.04-arm # arm64-preview + - ubuntu-24.04 # x64 # Job name name: Build Notifications with JDK ${{ matrix.java }} on linux - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} container: # using the same image which is used by opensearch-build team to build the OpenSearch Distribution # this image tag is subject to change as more dependencies and updates will arrive over time @@ -43,7 +46,7 @@ jobs: # notifications - name: Checkout Notifications - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build with Gradle run: | @@ -68,13 +71,13 @@ jobs: - name: Upload Artifacts for notifications plugin uses: actions/upload-artifact@v4 with: - name: notifications-plugin-${{ matrix.os }} + name: notifications-plugin-${{ matrix.os }}-JDK${{ matrix.java }} path: notifications-build/notifications - name: Upload Artifacts for notifications-core plugin uses: actions/upload-artifact@v4 with: - name: notifications-core-plugin-${{ matrix.os }} + name: notifications-core-plugin-${{ matrix.os }}-JDK${{ matrix.java }} path: notifications-build/notifications-core build-windows-macos: @@ -101,14 +104,14 @@ jobs: steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin # Temurin is a distribution of adoptium java-version: ${{ matrix.java }} # notifications - name: Checkout Notifications - uses: actions/checkout@v2 + uses: actions/checkout@v4 # This is a hack, but this step creates a link to the X: mounted drive, which makes the path # short enough to work on Windows @@ -134,11 +137,11 @@ jobs: - name: Upload Artifacts for notifications plugin uses: actions/upload-artifact@v4 with: - name: notifications-plugin-${{ matrix.os }} + name: notifications-plugin-${{ matrix.os }}-JDK${{ matrix.java }} path: notifications-build/notifications - name: Upload Artifacts for notifications-core plugin uses: actions/upload-artifact@v4 with: - name: notifications-core-plugin-${{ matrix.os }} + name: notifications-core-plugin-${{ matrix.os }}-JDK${{ matrix.java }} path: notifications-build/notifications-core diff --git a/.github/workflows/security-notifications-test-workflow.yml b/.github/workflows/security-notifications-test-workflow.yml index 90a640d0..9a8a17db 100644 --- a/.github/workflows/security-notifications-test-workflow.yml +++ b/.github/workflows/security-notifications-test-workflow.yml @@ -17,19 +17,22 @@ jobs: fail-fast: false matrix: java: [21, 23] + os: + - ubuntu-24.04-arm # arm64-preview + - ubuntu-24.04 # x64 - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} steps: - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin # Temurin is a distribution of adoptium java-version: ${{ matrix.java }} # notifications - name: Checkout Notifications - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Temporarily exclude tests which causing CI to fail. Tracking in #251 - name: Build with Gradle diff --git a/notifications/build.gradle b/notifications/build.gradle index 4583ce3c..808648e2 100644 --- a/notifications/build.gradle +++ b/notifications/build.gradle @@ -6,9 +6,9 @@ buildscript { ext { - opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "3.0.0-alpha1-SNAPSHOT") isSnapshot = "true" == System.getProperty("build.snapshot", "true") - buildVersionQualifier = System.getProperty("build.version_qualifier", "") + buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1") // 3.0.0-SNAPSHOT -> 3.0.0.0-SNAPSHOT version_tokens = opensearch_version.tokenize('-') opensearch_build = version_tokens[0] + '.0' diff --git a/notifications/core/src/main/kotlin/org/opensearch/notifications/core/NotificationCorePlugin.kt b/notifications/core/src/main/kotlin/org/opensearch/notifications/core/NotificationCorePlugin.kt index ada97fc1..87b27336 100644 --- a/notifications/core/src/main/kotlin/org/opensearch/notifications/core/NotificationCorePlugin.kt +++ b/notifications/core/src/main/kotlin/org/opensearch/notifications/core/NotificationCorePlugin.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.core -import org.opensearch.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.service.ClusterService import org.opensearch.common.settings.Setting @@ -25,6 +24,7 @@ import org.opensearch.plugins.ReloadablePlugin import org.opensearch.repositories.RepositoriesService import org.opensearch.script.ScriptService import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import org.opensearch.watcher.ResourceWatcherService import java.util.function.Supplier 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 e15aa7d8..4290ab66 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.client.Client import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.node.DiscoveryNodes import org.opensearch.cluster.service.ClusterService @@ -51,6 +50,7 @@ import org.opensearch.rest.RestController import org.opensearch.rest.RestHandler import org.opensearch.script.ScriptService import org.opensearch.threadpool.ThreadPool +import org.opensearch.transport.client.Client import org.opensearch.watcher.ResourceWatcherService import java.util.function.Supplier 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 d7eedbd7..9fa44aa7 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.CreateNotificationConfigRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Create NotificationConfig transport action 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 4bdcb3a7..67323fa7 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.DeleteNotificationConfigRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Delete NotificationConfig transport action 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 95cafc9d..74ae776a 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.GetChannelListRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Get channel list transport action 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 8eb5784a..eae13572 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.GetNotificationConfigRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Get notification config transport action 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 6ffb19f5..12ca59a4 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.GetPluginFeaturesRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.CoreProvider import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Get plugin features transport action 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 2e2c1020..63ce34c8 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 @@ -13,7 +13,6 @@ import org.opensearch.OpenSearchStatusException import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction -import org.opensearch.client.Client import org.opensearch.common.util.concurrent.ThreadContext import org.opensearch.commons.ConfigConstants.OPENSEARCH_SECURITY_USER_INFO_THREAD_CONTEXT import org.opensearch.commons.authuser.User @@ -29,6 +28,7 @@ import org.opensearch.notifications.NotificationPlugin.Companion.LOG_PREFIX import org.opensearch.notifications.metrics.Metrics import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import java.io.IOException internal abstract class PluginBaseAction<Request : ActionRequest, Response : ActionResponse>( 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 929be1e1..d39f1c79 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.LegacyPublishNotificationRequest @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.send.SendMessageActionHelper import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Publish Notification transport action 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 d6dd05f5..d9bbeed6 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.NotificationsActions @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.send.SendMessageActionHelper import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Send Notification transport action 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 15a533f8..219e05d2 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 @@ -8,8 +8,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionType import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction -import org.opensearch.client.Client -import org.opensearch.client.node.NodeClient import org.opensearch.common.inject.Inject import org.opensearch.commons.notifications.NotificationsPluginInterface import org.opensearch.commons.notifications.action.SendNotificationResponse @@ -21,6 +19,8 @@ import org.opensearch.notifications.model.SendTestNotificationRequest import org.opensearch.notifications.send.SendTestNotificationActionHelper import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client +import org.opensearch.transport.client.node.NodeClient /** * Send Test Notification transport action 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 3e9830cc..d8ceff80 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 @@ -7,7 +7,6 @@ package org.opensearch.notifications.action import org.opensearch.action.ActionRequest import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.common.inject.Inject import org.opensearch.commons.authuser.User import org.opensearch.commons.notifications.action.NotificationsActions @@ -19,6 +18,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client /** * Update NotificationConfig transport action diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/NotificationConfigIndex.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/NotificationConfigIndex.kt index bc63de0e..c91517a1 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/NotificationConfigIndex.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/index/NotificationConfigIndex.kt @@ -22,8 +22,7 @@ import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse import org.opensearch.action.search.SearchRequest import org.opensearch.action.search.SearchResponse -import org.opensearch.action.support.master.AcknowledgedResponse -import org.opensearch.client.Client +import org.opensearch.action.support.clustermanager.AcknowledgedResponse import org.opensearch.cluster.service.ClusterService import org.opensearch.common.unit.TimeValue import org.opensearch.common.util.concurrent.ThreadContext @@ -54,6 +53,7 @@ import org.opensearch.script.Script import org.opensearch.search.SearchHit import org.opensearch.search.builder.SearchSourceBuilder import org.opensearch.search.sort.SortOrder +import org.opensearch.transport.client.Client import java.lang.IllegalArgumentException import java.util.concurrent.TimeUnit diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationChannelListRestHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationChannelListRestHandler.kt index 926b61ae..af6a3abe 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationChannelListRestHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationChannelListRestHandler.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.commons.notifications.NotificationsPluginInterface import org.opensearch.commons.notifications.action.GetChannelListRequest import org.opensearch.core.rest.RestStatus @@ -17,6 +16,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient /** * Rest handler for getting notification channels. diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationConfigRestHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationConfigRestHandler.kt index e83e797e..9480d4ab 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationConfigRestHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationConfigRestHandler.kt @@ -4,7 +4,6 @@ */ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.commons.notifications.NotificationConstants.CONFIG_ID_LIST_TAG import org.opensearch.commons.notifications.NotificationConstants.CONFIG_ID_TAG import org.opensearch.commons.notifications.NotificationConstants.DEFAULT_MAX_ITEMS @@ -34,6 +33,7 @@ import org.opensearch.rest.RestRequest.Method.POST import org.opensearch.rest.RestRequest.Method.PUT import org.opensearch.rest.action.RestToXContentListener import org.opensearch.search.sort.SortOrder +import org.opensearch.transport.client.node.NodeClient /** * Rest handler for notification configurations. diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationFeaturesRestHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationFeaturesRestHandler.kt index 6364cd2b..d9517dd7 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationFeaturesRestHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationFeaturesRestHandler.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.commons.notifications.NotificationsPluginInterface import org.opensearch.commons.notifications.action.GetPluginFeaturesRequest import org.opensearch.core.rest.RestStatus @@ -17,6 +16,7 @@ import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.action.RestToXContentListener +import org.opensearch.transport.client.node.NodeClient /** * Rest handler for getting notification features. diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationStatsRestHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationStatsRestHandler.kt index 856a928b..7c3148f4 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationStatsRestHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/NotificationStatsRestHandler.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.core.rest.RestStatus import org.opensearch.notifications.NotificationPlugin.Companion.PLUGIN_BASE_URI import org.opensearch.notifications.metrics.Metrics @@ -15,6 +14,7 @@ import org.opensearch.rest.BytesRestResponse import org.opensearch.rest.RestHandler.Route import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET +import org.opensearch.transport.client.node.NodeClient /** * Rest handler for getting notifications backend stats diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/PluginBaseHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/PluginBaseHandler.kt index 63931820..e8ee88b5 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/PluginBaseHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/PluginBaseHandler.kt @@ -4,10 +4,10 @@ */ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.notifications.metrics.Metrics import org.opensearch.rest.BaseRestHandler import org.opensearch.rest.RestRequest +import org.opensearch.transport.client.node.NodeClient /** * Base class for Rest handler for plugin. diff --git a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/SendTestMessageRestHandler.kt b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/SendTestMessageRestHandler.kt index d6d30e9b..c33095d2 100644 --- a/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/SendTestMessageRestHandler.kt +++ b/notifications/notifications/src/main/kotlin/org/opensearch/notifications/resthandler/SendTestMessageRestHandler.kt @@ -5,7 +5,6 @@ package org.opensearch.notifications.resthandler -import org.opensearch.client.node.NodeClient import org.opensearch.commons.notifications.NotificationConstants.CONFIG_ID_TAG import org.opensearch.core.rest.RestStatus import org.opensearch.notifications.NotificationPlugin.Companion.PLUGIN_BASE_URI @@ -18,6 +17,7 @@ import org.opensearch.rest.RestHandler.ReplacedRoute import org.opensearch.rest.RestRequest import org.opensearch.rest.RestRequest.Method.GET import org.opensearch.rest.RestRequest.Method.POST +import org.opensearch.transport.client.node.NodeClient /** * Rest handler for getting notification features. 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 4bea83c8..cd7e7cae 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 @@ -34,11 +34,11 @@ import org.opensearch.action.termvectors.TermVectorsRequest 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 +import org.opensearch.transport.client.Client /** * 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 913dc057..94f0022b 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.client.OpenSearchClient import org.opensearch.core.action.ActionListener +import org.opensearch.transport.client.OpenSearchClient 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 a2d07f45..59312284 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 @@ -15,7 +15,6 @@ import org.mockito.Mock import org.mockito.Mockito.mock import org.mockito.junit.jupiter.MockitoExtension import org.opensearch.action.support.ActionFilters -import org.opensearch.client.Client import org.opensearch.commons.destination.response.LegacyDestinationResponse import org.opensearch.commons.notifications.action.BaseResponse import org.opensearch.commons.notifications.action.CreateNotificationConfigRequest @@ -49,6 +48,7 @@ import org.opensearch.notifications.index.ConfigIndexingActions import org.opensearch.notifications.send.SendMessageActionHelper import org.opensearch.tasks.Task import org.opensearch.transport.TransportService +import org.opensearch.transport.client.Client import kotlin.test.assertEquals @ExtendWith(MockitoExtension::class) diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/util/SuspendUtilsTests.kt b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/util/SuspendUtilsTests.kt index 5b4b85c8..4e3f9b71 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/util/SuspendUtilsTests.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/util/SuspendUtilsTests.kt @@ -16,8 +16,8 @@ import org.mockito.Mock import org.mockito.junit.jupiter.MockitoExtension import org.opensearch.action.index.IndexRequest import org.opensearch.action.index.IndexResponse -import org.opensearch.client.Client import org.opensearch.notifications.util.SuspendUtils.Companion.suspendUntilTimeout +import org.opensearch.transport.client.Client @ExtendWith(MockitoExtension::class) internal class SuspendUtilsTests {