diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java index 23f233305f699..470dff124d006 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java @@ -115,7 +115,7 @@ public Mono> addSetting(String key, String value) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> addSetting(ConfigurationSetting setting) { - return addSetting(setting, Context.NONE); + return monoContext(context -> addSetting(setting, context)); } /** @@ -188,7 +188,8 @@ Mono> addSetting(ConfigurationSetting setting, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setSetting(String key, String value) { - return setSetting(new ConfigurationSetting().key(key).value(value), Context.NONE); + return monoContext( + context -> setSetting(new ConfigurationSetting().key(key).value(value), context)); } /** @@ -232,7 +233,7 @@ public Mono> setSetting(String key, String value) */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setSetting(ConfigurationSetting setting) { - return setSetting(setting, Context.NONE); + return monoContext(context -> setSetting(setting, context)); } /** @@ -316,7 +317,8 @@ Mono> setSetting(ConfigurationSetting setting, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateSetting(String key, String value) { - return updateSetting(new ConfigurationSetting().key(key).value(value), Context.NONE); + return monoContext( + context -> updateSetting(new ConfigurationSetting().key(key).value(value), context)); } /** @@ -348,7 +350,7 @@ public Mono> updateSetting(String key, String val */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateSetting(ConfigurationSetting setting) { - return updateSetting(setting, Context.NONE); + return monoContext(context -> updateSetting(setting, context)); } /** @@ -414,7 +416,7 @@ Mono> updateSetting(ConfigurationSetting setting, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSetting(String key) { - return getSetting(new ConfigurationSetting().key(key), Context.NONE); + return monoContext(context -> getSetting(new ConfigurationSetting().key(key), context)); } /** @@ -441,7 +443,7 @@ public Mono> getSetting(String key) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSetting(ConfigurationSetting setting) { - return getSetting(setting, Context.NONE); + return monoContext(context -> getSetting(setting, context)); } /** @@ -500,7 +502,7 @@ Mono> getSetting(ConfigurationSetting setting, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteSetting(String key) { - return deleteSetting(new ConfigurationSetting().key(key), Context.NONE); + return monoContext(context -> deleteSetting(new ConfigurationSetting().key(key), context)); } /** @@ -534,7 +536,7 @@ public Mono> deleteSetting(String key) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteSetting(ConfigurationSetting setting) { - return deleteSetting(setting, Context.NONE); + return monoContext(context -> deleteSetting(setting, context)); } /** @@ -593,8 +595,10 @@ Mono> deleteSetting(ConfigurationSetting setting, * @return A Flux of ConfigurationSettings that matches the {@code options}. If no options were provided, the Flux * contains all of the current settings in the service. */ + @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSettings(SettingSelector options) { - return listSettings(options, Context.NONE); + return new PagedFlux<>(() -> monoContext(context -> listFirstPageSettings(options, context)), + continuationToken -> monoContext(context -> listNextPageSettings(context, continuationToken))); } /** @@ -761,7 +765,9 @@ private static void validateSetting(ConfigurationSetting setting) { * Remaps the exception returned from the service if it is a PRECONDITION_FAILED response. This is performed since * add setting returns PRECONDITION_FAILED when the configuration already exists, all other uses of setKey return * this status when the configuration doesn't exist. + * * @param throwable Error response from the service. + * * @return Exception remapped to a ResourceModifiedException if the throwable was a ResourceNotFoundException, * otherwise the throwable is returned unmodified. */ diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java index 067e149c4f292..8026fb83eecc0 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java @@ -102,7 +102,7 @@ public void addSettingEmptyValue() { */ public void addSettingNullKey() { assertRunnableThrowsException(() -> client.addSetting(null, "A Value").block(), IllegalArgumentException.class); - assertRunnableThrowsException(() -> client.addSetting(null), NullPointerException.class); + assertRunnableThrowsException(() -> client.addSetting(null).block(), NullPointerException.class); } /** @@ -179,8 +179,8 @@ public void setSettingEmptyValue() { * Verifies that an exception is thrown when null key is passed. */ public void setSettingNullKey() { - assertRunnableThrowsException(() -> client.setSetting(null, "A Value"), IllegalArgumentException.class); - assertRunnableThrowsException(() -> client.setSetting(null), NullPointerException.class); + assertRunnableThrowsException(() -> client.setSetting(null, "A Value").block(), IllegalArgumentException.class); + assertRunnableThrowsException(() -> client.setSetting(null).block(), NullPointerException.class); } /** @@ -224,8 +224,8 @@ public void updateSettingOverload() { * Verifies that an exception is thrown when null key is passed. */ public void updateSettingNullKey() { - assertRunnableThrowsException(() -> client.updateSetting(null, "A Value"), IllegalArgumentException.class); - assertRunnableThrowsException(() -> client.updateSetting(null), NullPointerException.class); + assertRunnableThrowsException(() -> client.updateSetting(null, "A Value").block(), IllegalArgumentException.class); + assertRunnableThrowsException(() -> client.updateSetting(null).block(), NullPointerException.class); } /** @@ -365,8 +365,8 @@ public void deleteSettingWithETag() { * Test the API will not make a delete call without having a key passed, an IllegalArgumentException should be thrown. */ public void deleteSettingNullKey() { - assertRunnableThrowsException(() -> client.deleteSetting((String) null), IllegalArgumentException.class); - assertRunnableThrowsException(() -> client.deleteSetting((ConfigurationSetting) null), NullPointerException.class); + assertRunnableThrowsException(() -> client.deleteSetting((String) null).block(), IllegalArgumentException.class); + assertRunnableThrowsException(() -> client.deleteSetting((ConfigurationSetting) null).block(), NullPointerException.class); } /** diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/http/ReactorNettyClientTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/http/ReactorNettyClientTests.java index 4d486fc00cdf1..d5b182d585927 100644 --- a/sdk/core/azure-core/src/test/java/com/azure/core/http/ReactorNettyClientTests.java +++ b/sdk/core/azure-core/src/test/java/com/azure/core/http/ReactorNettyClientTests.java @@ -72,7 +72,6 @@ public void testFlowableResponseLongBodyAsByteArrayAsync() { checkBodyReceived(LONG_BODY, "/long"); } - @Test public void testMultipleSubscriptionsEmitsError() { HttpResponse response = getResponse("/short"); @@ -94,8 +93,6 @@ public void testDispose() throws InterruptedException { Assert.assertTrue(response.internConnection().isDisposed()); } - - @Test public void testCancel() { HttpResponse response = getResponse("/long"); @@ -217,6 +214,7 @@ public void testServerShutsDownSocketShouldPushErrorToContentFlowable() } } + @Ignore("This flakey test fails often on MacOS. https://github.com/Azure/azure-sdk-for-java/issues/4357.") @Test public void testConcurrentRequests() throws NoSuchAlgorithmException { long t = System.currentTimeMillis(); diff --git a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/util/FluxUtilTests.java b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/util/FluxUtilTests.java index 7cda0889394d6..76cd1feb04a5e 100644 --- a/sdk/core/azure-core/src/test/java/com/azure/core/implementation/util/FluxUtilTests.java +++ b/sdk/core/azure-core/src/test/java/com/azure/core/implementation/util/FluxUtilTests.java @@ -7,16 +7,25 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpMethod; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.implementation.http.PagedResponseBase; import com.azure.core.util.Context; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; +import io.netty.handler.codec.http.HttpResponseStatus; import io.netty.util.ReferenceCountUtil; import java.io.BufferedOutputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; import java.nio.channels.AsynchronousFileChannel; import java.nio.charset.StandardCharsets; import java.nio.file.StandardOpenOption; @@ -25,6 +34,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; @@ -286,6 +297,69 @@ public void testCallWithContextGetCollection() { Assert.assertEquals(expectedLines, actualLines); } + @Test + public void testCallWithContextGetPagedCollection() throws Exception { + // Simulates the customer code that includes context + getPagedCollection() + .subscriberContext( + reactor.util.context.Context.of("Key1", "Val1", "Key2", "Val2")) + .doOnNext(System.out::println) + .subscribe(); + } + + private PagedFlux getPagedCollection() + throws Exception { + // Simulates the client library API + List> pagedResponses = getPagedResponses(4); + return new PagedFlux<>( + () -> FluxUtil.monoContext(context -> getFirstPage(pagedResponses, context)), + continuationToken -> FluxUtil + .monoContext(context -> getNextPage(continuationToken, pagedResponses, context))); + } + + private List> getPagedResponses(int noOfPages) + throws MalformedURLException { + HttpHeaders httpHeaders = new HttpHeaders().put("header1", "value1") + .put("header2", "value2"); + HttpRequest httpRequest = new HttpRequest(HttpMethod.GET, new URL("http://localhost")); + String deserializedHeaders = "header1,value1,header2,value2"; + return IntStream.range(0, noOfPages) + .boxed() + .map(i -> createPagedResponse(httpRequest, httpHeaders, deserializedHeaders, i, noOfPages)) + .collect(Collectors.toList()); + } + + private Mono> getFirstPage(List> pagedResponses, + Context context) { + // Simulates the service side code which should get the context provided by customer code + Assert.assertEquals("Val1", context.getData("Key1").get()); + return pagedResponses.isEmpty() ? Mono.empty() : Mono.just(pagedResponses.get(0)); + } + + private Mono> getNextPage(String continuationToken, + List> pagedResponses, Context context) { + // Simulates the service side code which should get the context provided by customer code + Assert.assertEquals("Val2", context.getData("Key2").get()); + if (continuationToken == null || continuationToken.isEmpty()) { + return Mono.empty(); + } + return Mono.just(pagedResponses.get(Integer.valueOf(continuationToken))); + } + + private PagedResponseBase createPagedResponse(HttpRequest httpRequest, + HttpHeaders httpHeaders, String deserializedHeaders, int i, int noOfPages) { + return new PagedResponseBase<>(httpRequest, HttpResponseStatus.OK.code(), + httpHeaders, + getItems(i), + i < noOfPages - 1 ? String.valueOf(i + 1) : null, + deserializedHeaders); + } + + private List getItems(Integer i) { + return IntStream.range(i * 3, i * 3 + 3).boxed().collect(Collectors.toList()); + } + + private Mono getSingle(String prefix) { return FluxUtil.monoContext(context -> serviceCallSingle(prefix, context)); } diff --git a/sdk/eventhubs/azure-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java b/sdk/eventhubs/azure-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java index 19bdefe5663c8..a76b11d722a6a 100644 --- a/sdk/eventhubs/azure-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java +++ b/sdk/eventhubs/azure-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubConsumer.java @@ -3,8 +3,8 @@ package com.azure.messaging.eventhubs; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.implementation.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.eventhubs.implementation.AmqpReceiveLink; import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; import com.azure.messaging.eventhubs.models.EventPosition; @@ -84,8 +84,7 @@ public class EventHubConsumer implements Closeable { } return link.receive().map(EventData::new); - }).timeout(operationTimeout) - .subscribeWith(emitterProcessor) + }).subscribeWith(emitterProcessor) .doOnSubscribe(subscription -> { AmqpReceiveLink existingLink = RECEIVE_LINK_FIELD_UPDATER.get(this); if (existingLink == null) { diff --git a/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java b/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java index 04a8f19aab2dd..30921adf1ba5a 100644 --- a/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java +++ b/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventPositionIntegrationTest.java @@ -28,6 +28,7 @@ import java.util.concurrent.atomic.AtomicReference; import static com.azure.messaging.eventhubs.EventHubAsyncClient.DEFAULT_CONSUMER_GROUP_NAME; +import static com.azure.messaging.eventhubs.TestUtils.MESSAGE_TRACKING_ID; import static com.azure.messaging.eventhubs.TestUtils.isMatchingEvent; import static java.nio.charset.StandardCharsets.UTF_8; @@ -43,7 +44,6 @@ public class EventPositionIntegrationTest extends ApiTestBase { private static final AtomicBoolean HAS_PUSHED_EVENTS = new AtomicBoolean(); private static final AtomicReference EVENTS_PUSHED = new AtomicReference<>(); private static final String MESSAGE_POSITION_ID = "message-position"; - private static final String MESSAGE_TRACKING_ID = "message-tracking-id"; private static final String MESSAGE_TRACKING_VALUE = UUID.randomUUID().toString(); private static final AtomicReference MESSAGES_PUSHED_INSTANT = new AtomicReference<>(); diff --git a/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/SetPrefetchCountTest.java b/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/SetPrefetchCountTest.java index 80d1c7548cb26..be7a5dd4dd529 100644 --- a/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/SetPrefetchCountTest.java +++ b/sdk/eventhubs/azure-eventhubs/src/test/java/com/azure/messaging/eventhubs/SetPrefetchCountTest.java @@ -8,6 +8,7 @@ import com.azure.messaging.eventhubs.implementation.ApiTestBase; import com.azure.messaging.eventhubs.implementation.ReactorHandlerProvider; import com.azure.messaging.eventhubs.models.EventHubConsumerOptions; +import com.azure.messaging.eventhubs.models.EventHubProducerOptions; import com.azure.messaging.eventhubs.models.EventPosition; import org.junit.Assert; import org.junit.Rule; @@ -16,21 +17,33 @@ import reactor.core.Disposable; import reactor.core.publisher.Flux; +import java.time.Instant; +import java.util.UUID; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; -import static java.nio.charset.StandardCharsets.UTF_8; +import static com.azure.messaging.eventhubs.TestUtils.isMatchingEvent; /** * Verifies we can use various prefetch options with {@link EventHubConsumer}. */ public class SetPrefetchCountTest extends ApiTestBase { - private static final String PARTITION_ID = "0"; + private static final String PARTITION_ID = "1"; // Default number of events to fetch when creating the consumer. private static final int DEFAULT_PREFETCH_COUNT = 500; + // Set a large number of events to send to the service. + private static final int NUMBER_OF_EVENTS = DEFAULT_PREFETCH_COUNT * 3; + + // We use these values to keep track of the events we've pushed to the service and ensure the events we receive are + // our own. + private static final AtomicBoolean HAS_PUSHED_EVENTS = new AtomicBoolean(); + private static final String MESSAGE_TRACKING_VALUE = UUID.randomUUID().toString(); + private static final AtomicReference MESSAGES_PUSHED_INSTANT = new AtomicReference<>(); + private EventHubAsyncClient client; - private EventHubProducer producer; private EventHubConsumer consumer; @Rule @@ -51,12 +64,13 @@ protected void beforeTest() { final ReactorHandlerProvider handlerProvider = new ReactorHandlerProvider(getReactorProvider()); client = new EventHubAsyncClient(getConnectionOptions(), getReactorProvider(), handlerProvider); - producer = client.createProducer(); + + setupEventTestData(client); } @Override protected void afterTest() { - dispose(producer, consumer, client); + dispose(consumer, client); } /** @@ -67,24 +81,22 @@ public void setLargePrefetchCount() throws InterruptedException { // Arrange // Since we cannot test receiving very large prefetch like 10000 in a unit test, DefaultPrefetchCount * 3 was // chosen - final int eventCount = DEFAULT_PREFETCH_COUNT * 3; + final int eventCount = NUMBER_OF_EVENTS; final CountDownLatch countDownLatch = new CountDownLatch(eventCount); final EventHubConsumerOptions options = new EventHubConsumerOptions() .retry(Retry.getDefaultRetry()) .prefetchCount(2000); consumer = client.createConsumer(EventHubAsyncClient.DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, - EventPosition.latest(), options); + EventPosition.fromEnqueuedTime(MESSAGES_PUSHED_INSTANT.get()), options); final Disposable subscription = consumer.receive() - .take(eventCount + 1).subscribe(event -> countDownLatch.countDown()); + .filter(x -> isMatchingEvent(x, MESSAGE_TRACKING_VALUE)) + .take(eventCount).subscribe(event -> countDownLatch.countDown()); // Act try { - final Flux events = Flux.range(0, eventCount).map(number -> new EventData("c".getBytes(UTF_8))); - producer.send(events).block(); - - countDownLatch.await(45, TimeUnit.SECONDS); + countDownLatch.await(1, TimeUnit.MINUTES); // Assert Assert.assertEquals(0, countDownLatch.getCount()); @@ -104,17 +116,13 @@ public void setSmallPrefetchCount() throws InterruptedException { final EventHubConsumerOptions options = new EventHubConsumerOptions().prefetchCount(11); consumer = client.createConsumer(EventHubAsyncClient.DEFAULT_CONSUMER_GROUP_NAME, PARTITION_ID, - EventPosition.latest(), options); + EventPosition.fromEnqueuedTime(MESSAGES_PUSHED_INSTANT.get()), options); - final Disposable subscription = consumer.receive() - .take(eventCount + 1).subscribe(event -> countDownLatch.countDown()); + final Disposable subscription = consumer.receive().filter(x -> isMatchingEvent(x, MESSAGE_TRACKING_VALUE)) + .take(eventCount).subscribe(event -> countDownLatch.countDown()); try { // Act - final Flux events = Flux.range(0, eventCount) - .map(number -> new EventData("testString".getBytes(UTF_8))); - producer.send(events).block(TIMEOUT); - countDownLatch.await(45, TimeUnit.SECONDS); // Assert @@ -123,4 +131,29 @@ public void setSmallPrefetchCount() throws InterruptedException { subscription.dispose(); } } + + /** + * When we run this test, we check if there have been events already pushed to the partition, if not, we push some + * events there. + */ + private void setupEventTestData(EventHubAsyncClient client) { + if (HAS_PUSHED_EVENTS.getAndSet(true)) { + logger.info("Already pushed events to partition. Skipping."); + return; + } + + logger.info("Pushing events to partition. Message tracking value: {}", MESSAGE_TRACKING_VALUE); + + final EventHubProducerOptions producerOptions = new EventHubProducerOptions() + .partitionId(PARTITION_ID); + final EventHubProducer producer = client.createProducer(producerOptions); + final Flux events = TestUtils.getEvents(NUMBER_OF_EVENTS, MESSAGE_TRACKING_VALUE); + + try { + MESSAGES_PUSHED_INSTANT.set(Instant.now()); + producer.send(events).block(TIMEOUT); + } finally { + dispose(producer); + } + } } diff --git a/eventhubs/data-plane/azure-eventhubs-eph/.gitignore b/sdk/eventhubs/microsoft-azure-eventhubs-eph/.gitignore similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/.gitignore rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/.gitignore diff --git a/eventhubs/data-plane/azure-eventhubs-eph/Overview.md b/sdk/eventhubs/microsoft-azure-eventhubs-eph/Overview.md similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/Overview.md rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/Overview.md diff --git a/eventhubs/data-plane/azure-eventhubs-eph/Readme.md b/sdk/eventhubs/microsoft-azure-eventhubs-eph/Readme.md similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/Readme.md rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/Readme.md diff --git a/eventhubs/data-plane/azure-eventhubs-eph/pom.xml b/sdk/eventhubs/microsoft-azure-eventhubs-eph/pom.xml similarity index 97% rename from eventhubs/data-plane/azure-eventhubs-eph/pom.xml rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/pom.xml index 0a3bd414a75e3..fad46c57eae75 100644 --- a/eventhubs/data-plane/azure-eventhubs-eph/pom.xml +++ b/sdk/eventhubs/microsoft-azure-eventhubs-eph/pom.xml @@ -8,7 +8,7 @@ com.microsoft.azure azure-eventhubs-clients 2.3.1 - ../pom.xml + ../pom.data.xml 4.0.0 diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureBlobLease.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureBlobLease.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureBlobLease.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureBlobLease.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStorageCheckpointLeaseManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStoragePartitionManagerOptions.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStoragePartitionManagerOptions.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStoragePartitionManagerOptions.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/AzureStoragePartitionManagerOptions.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/BaseLease.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Checkpoint.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Checkpoint.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Checkpoint.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Checkpoint.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Closable.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Closable.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Closable.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/Closable.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CloseReason.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CloseReason.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CloseReason.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CloseReason.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CompleteLease.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CompleteLease.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CompleteLease.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/CompleteLease.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/DefaultEventProcessorFactory.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/DefaultEventProcessorFactory.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/DefaultEventProcessorFactory.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/DefaultEventProcessorFactory.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHost.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHostActionStrings.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHostActionStrings.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHostActionStrings.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorHostActionStrings.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorOptions.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorOptions.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorOptions.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/EventProcessorOptions.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionReceivedEventArgs.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionReceivedEventArgs.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionReceivedEventArgs.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionReceivedEventArgs.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionWithAction.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionWithAction.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionWithAction.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ExceptionWithAction.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/HostContext.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/HostContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/HostContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/HostContext.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ICheckpointManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ICheckpointManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ICheckpointManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ICheckpointManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessor.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessor.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessor.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessor.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessorFactory.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessorFactory.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessorFactory.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/IEventProcessorFactory.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ILeaseManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ILeaseManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ILeaseManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/ILeaseManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryCheckpointManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryCheckpointManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryCheckpointManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryCheckpointManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryLeaseManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryLeaseManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryLeaseManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/InMemoryLeaseManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LeaseLostException.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LeaseLostException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LeaseLostException.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LeaseLostException.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LoggingUtils.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LoggingUtils.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LoggingUtils.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/LoggingUtils.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionContext.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionContext.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManagerOptions.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManagerOptions.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManagerOptions.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionManagerOptions.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionPump.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionPump.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionPump.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionPump.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionScanner.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionScanner.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionScanner.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PartitionScanner.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PumpManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PumpManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PumpManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/main/java/com/microsoft/azure/eventprocessorhost/PumpManager.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/CheckpointManagerTest.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/CheckpointManagerTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/CheckpointManagerTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/CheckpointManagerTest.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/DummyPump.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/DummyPump.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/DummyPump.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/DummyPump.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/EPHConstructorTests.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/EPHConstructorTests.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/EPHConstructorTests.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/EPHConstructorTests.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/LeaseManagerTest.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/LeaseManagerTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/LeaseManagerTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/LeaseManagerTest.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PartitionManagerTest.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PartitionManagerTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PartitionManagerTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PartitionManagerTest.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PerTestSettings.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PerTestSettings.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PerTestSettings.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PerTestSettings.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabEventProcessor.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabEventProcessor.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabEventProcessor.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabEventProcessor.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabGeneralErrorHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabGeneralErrorHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabGeneralErrorHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabGeneralErrorHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabProcessorFactory.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabProcessorFactory.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabProcessorFactory.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/PrefabProcessorFactory.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/RealEventHubUtilities.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/RealEventHubUtilities.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/RealEventHubUtilities.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/RealEventHubUtilities.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/Repros.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/Repros.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/Repros.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/Repros.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SadPathTests.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SadPathTests.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SadPathTests.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SadPathTests.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SmokeTest.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SmokeTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SmokeTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/SmokeTest.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestBase.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestBase.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestBase.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestBase.java diff --git a/eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestUtilities.java b/sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestUtilities.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestUtilities.java rename to sdk/eventhubs/microsoft-azure-eventhubs-eph/src/test/java/com/microsoft/azure/eventprocessorhost/TestUtilities.java diff --git a/eventhubs/data-plane/azure-eventhubs-extensions/pom.xml b/sdk/eventhubs/microsoft-azure-eventhubs-extensions/pom.xml similarity index 97% rename from eventhubs/data-plane/azure-eventhubs-extensions/pom.xml rename to sdk/eventhubs/microsoft-azure-eventhubs-extensions/pom.xml index a2a85d70883b5..5faee62b351f4 100644 --- a/eventhubs/data-plane/azure-eventhubs-extensions/pom.xml +++ b/sdk/eventhubs/microsoft-azure-eventhubs-extensions/pom.xml @@ -8,7 +8,7 @@ com.microsoft.azure azure-eventhubs-clients 2.3.1 - ../pom.xml + ../pom.data.xml 4.0.0 diff --git a/eventhubs/data-plane/azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsAppender.java b/sdk/eventhubs/microsoft-azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsAppender.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsAppender.java rename to sdk/eventhubs/microsoft-azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsAppender.java diff --git a/eventhubs/data-plane/azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsManager.java b/sdk/eventhubs/microsoft-azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs-extensions/src/main/java/com/microsoft/azure/eventhubs/extensions/appender/EventHubsManager.java diff --git a/eventhubs/data-plane/azure-eventhubs/pom.xml b/sdk/eventhubs/microsoft-azure-eventhubs/pom.xml similarity index 95% rename from eventhubs/data-plane/azure-eventhubs/pom.xml rename to sdk/eventhubs/microsoft-azure-eventhubs/pom.xml index 6f567e713080e..dc90cc557ca52 100644 --- a/eventhubs/data-plane/azure-eventhubs/pom.xml +++ b/sdk/eventhubs/microsoft-azure-eventhubs/pom.xml @@ -8,7 +8,7 @@ com.microsoft.azure azure-eventhubs-clients 2.3.1 - ../pom.xml + ../pom.data.xml 4.0.0 diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/AuthorizationFailedException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/AuthorizationFailedException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/AuthorizationFailedException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/AuthorizationFailedException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/BatchOptions.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/BatchOptions.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/BatchOptions.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/BatchOptions.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/CommunicationException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/CommunicationException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/CommunicationException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/CommunicationException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ConnectionStringBuilder.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ErrorContext.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ErrorContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ErrorContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ErrorContext.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventData.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventData.java old mode 100755 new mode 100644 similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventData.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventData.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventDataBatch.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventDataBatch.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventDataBatch.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventDataBatch.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubClient.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubClient.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubClient.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubClient.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubRuntimeInformation.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubRuntimeInformation.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubRuntimeInformation.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventHubRuntimeInformation.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventPosition.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventPosition.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventPosition.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/EventPosition.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalConnectionStringFormatException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalConnectionStringFormatException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalConnectionStringFormatException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalConnectionStringFormatException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalEntityException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalEntityException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalEntityException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/IllegalEntityException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/OperationCancelledException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/OperationCancelledException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/OperationCancelledException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/OperationCancelledException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiveHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiveHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiveHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiveHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionReceiver.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionRuntimeInformation.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionRuntimeInformation.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionRuntimeInformation.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionRuntimeInformation.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionSender.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionSender.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionSender.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PartitionSender.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PayloadSizeExceededException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PayloadSizeExceededException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PayloadSizeExceededException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/PayloadSizeExceededException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/QuotaExceededException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/QuotaExceededException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/QuotaExceededException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/QuotaExceededException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverDisconnectedException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverDisconnectedException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverDisconnectedException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverDisconnectedException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverOptions.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverOptions.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverOptions.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverOptions.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverRuntimeInformation.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverRuntimeInformation.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverRuntimeInformation.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ReceiverRuntimeInformation.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/RetryPolicy.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/RetryPolicy.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/RetryPolicy.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/RetryPolicy.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ServerBusyException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ServerBusyException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ServerBusyException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/ServerBusyException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TimeoutException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TimeoutException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TimeoutException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TimeoutException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TransportType.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TransportType.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TransportType.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/TransportType.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ActiveClientTokenManager.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ActiveClientTokenManager.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ActiveClientTokenManager.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ActiveClientTokenManager.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConnection.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConnection.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConnection.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConnection.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConstants.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConstants.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConstants.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpConstants.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpErrorCode.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpErrorCode.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpErrorCode.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpErrorCode.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpException.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpException.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpException.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpException.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpLink.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpLink.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpLink.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpLink.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpReceiver.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpReceiver.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpReceiver.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpReceiver.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpResponseCode.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpResponseCode.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpResponseCode.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpResponseCode.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpSender.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpSender.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpSender.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpSender.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/AmqpUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/BaseLinkHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/BaseLinkHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/BaseLinkHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/BaseLinkHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CBSChannel.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CBSChannel.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CBSChannel.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CBSChannel.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientConstants.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientEntity.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientEntity.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientEntity.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ClientEntity.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ConnectionHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ConnectionHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ConnectionHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ConnectionHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CustomIOHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CustomIOHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CustomIOHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/CustomIOHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/DispatchHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/DispatchHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/DispatchHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/DispatchHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ErrorContextProvider.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ErrorContextProvider.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ErrorContextProvider.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ErrorContextProvider.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataBatchImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataBatchImpl.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataBatchImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataBatchImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataImpl.java old mode 100755 new mode 100644 similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventDataUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventHubClientImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventHubClientImpl.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventHubClientImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventHubClientImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventPositionImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventPositionImpl.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventPositionImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/EventPositionImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ExceptionUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ExceptionUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ExceptionUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ExceptionUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/FaultTolerantObject.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IOObject.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IOObject.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IOObject.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IOObject.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IteratorUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IteratorUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IteratorUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/IteratorUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ManagementChannel.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ManagementChannel.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ManagementChannel.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ManagementChannel.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageOperationResult.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageOperationResult.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageOperationResult.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageOperationResult.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageReceiver.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageReceiver.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageReceiver.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageReceiver.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageSender.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageSender.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageSender.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageSender.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageWrapper.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageWrapper.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageWrapper.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessageWrapper.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessagingFactory.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessagingFactory.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessagingFactory.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/MessagingFactory.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Operation.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Operation.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Operation.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Operation.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResult.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResult.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResult.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResult.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResultBase.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResultBase.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResultBase.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/OperationResultBase.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionReceiverImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionReceiverImpl.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionReceiverImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionReceiverImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionSenderImpl.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionSenderImpl.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionSenderImpl.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PartitionSenderImpl.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PassByRef.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PassByRef.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PassByRef.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/PassByRef.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ProtonUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ProtonUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ProtonUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ProtonUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorDispatcher.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorDispatcher.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorDispatcher.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorDispatcher.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReactorHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiveLinkHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiveLinkHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiveLinkHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiveLinkHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceivePump.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverContext.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverContext.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverSettingsProvider.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverSettingsProvider.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverSettingsProvider.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReceiverSettingsProvider.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReplayableWorkItem.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReplayableWorkItem.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReplayableWorkItem.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/ReplayableWorkItem.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseChannel.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseCloser.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseCloser.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseCloser.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseCloser.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseOpener.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseOpener.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseOpener.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RequestResponseOpener.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RetryExponential.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RetryExponential.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RetryExponential.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/RetryExponential.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SchedulerProvider.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SchedulerProvider.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SchedulerProvider.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SchedulerProvider.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SendLinkHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SendLinkHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SendLinkHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SendLinkHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SenderContext.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SenderContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SenderContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SenderContext.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionProvider.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionProvider.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionProvider.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SessionProvider.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SharedAccessSignatureTokenProvider.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SharedAccessSignatureTokenProvider.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SharedAccessSignatureTokenProvider.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/SharedAccessSignatureTokenProvider.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/StringUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/StringUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/StringUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/StringUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TimeoutTracker.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TimeoutTracker.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TimeoutTracker.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TimeoutTracker.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Timer.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Timer.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Timer.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/Timer.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TrackingUtil.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TrackingUtil.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TrackingUtil.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/TrackingUtil.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketConnectionHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketConnectionHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketConnectionHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketConnectionHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketProxyConnectionHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketProxyConnectionHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketProxyConnectionHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WebSocketProxyConnectionHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WorkItem.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WorkItem.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WorkItem.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/main/java/com/microsoft/azure/eventhubs/impl/WorkItem.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/ConcurrentReceiversTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/ConcurrentReceiversTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/ConcurrentReceiversTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/ConcurrentReceiversTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/EventHubClientTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/EventHubClientTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/EventHubClientTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/concurrency/EventHubClientTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/ConnStrBuilderTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/ConnStrBuilderTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/ConnStrBuilderTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/ConnStrBuilderTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/TransportTypeTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/TransportTypeTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/TransportTypeTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/connstrbuilder/TransportTypeTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/BackCompatTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/BackCompatTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/BackCompatTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/BackCompatTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataBatchTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataBatchTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataBatchTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataBatchTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/EventDataTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropAmqpPropertiesTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropAmqpPropertiesTest.java old mode 100755 new mode 100644 similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropAmqpPropertiesTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropAmqpPropertiesTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropEventBodyTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropEventBodyTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropEventBodyTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/eventdata/InteropEventBodyTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ClientEntityCreateTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ClientEntityCreateTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ClientEntityCreateTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ClientEntityCreateTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/MsgFactoryOpenCloseTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/MsgFactoryOpenCloseTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/MsgFactoryOpenCloseTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/MsgFactoryOpenCloseTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReactorFaultTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReactorFaultTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReactorFaultTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReactorFaultTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReceiverEpochTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReceiverEpochTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReceiverEpochTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/ReceiverEpochTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/RetryPolicyTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/RetryPolicyTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/RetryPolicyTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/RetryPolicyTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SecurityExceptionsTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SecurityExceptionsTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SecurityExceptionsTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SecurityExceptionsTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SendLargeMessageTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SendLargeMessageTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SendLargeMessageTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/SendLargeMessageTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/WebSocketsSendLargeMessageTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/WebSocketsSendLargeMessageTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/WebSocketsSendLargeMessageTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/exceptioncontracts/WebSocketsSendLargeMessageTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/impl/EventDataOrderTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/impl/EventDataOrderTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/impl/EventDataOrderTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/impl/EventDataOrderTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyNegotiationHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyNegotiationHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyNegotiationHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyNegotiationHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyServer.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyServer.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyServer.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/ProxyServer.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/SimpleProxy.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/SimpleProxy.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/SimpleProxy.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/jproxy/SimpleProxy.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/ApiTestBase.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/ApiTestBase.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/ApiTestBase.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/ApiTestBase.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/FaultInjectingReactorFactory.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/FaultInjectingReactorFactory.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/FaultInjectingReactorFactory.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/FaultInjectingReactorFactory.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/SasTokenTestBase.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/SasTokenTestBase.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/SasTokenTestBase.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/SasTokenTestBase.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestBase.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestContext.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestContext.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestContext.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/TestContext.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/MockServer.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/MockServer.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/MockServer.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/MockServer.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/Sender1MsgOnLinkFlowHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/Sender1MsgOnLinkFlowHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/Sender1MsgOnLinkFlowHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/Sender1MsgOnLinkFlowHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/ServerTraceHandler.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/ServerTraceHandler.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/ServerTraceHandler.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/lib/mock/ServerTraceHandler.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxyReceiveTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxyReceiveTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxyReceiveTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxyReceiveTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySelectorTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySelectorTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySelectorTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySelectorTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendLargeMessageTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendLargeMessageTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendLargeMessageTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendLargeMessageTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/proxy/ProxySendTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/EventDataBatchAPITest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/EventDataBatchAPITest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/EventDataBatchAPITest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/EventDataBatchAPITest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveParallelManualTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveParallelManualTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveParallelManualTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveParallelManualTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpEventHubTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpEventHubTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpEventHubTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpEventHubTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceivePumpTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiveTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverIdentifierTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverIdentifierTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverIdentifierTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverIdentifierTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverRuntimeMetricsTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverRuntimeMetricsTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverRuntimeMetricsTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/ReceiverRuntimeMetricsTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/RequestResponseTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/RequestResponseTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/RequestResponseTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/RequestResponseTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenReceiveTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenReceiveTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenReceiveTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenReceiveTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenSendTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenSendTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenSendTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SasTokenSendTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SendTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SendTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SendTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SendTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SetPrefetchCountTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SetPrefetchCountTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SetPrefetchCountTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/SetPrefetchCountTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsReceiveTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsReceiveTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsReceiveTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsReceiveTest.java diff --git a/eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsSendTest.java b/sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsSendTest.java similarity index 100% rename from eventhubs/data-plane/azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsSendTest.java rename to sdk/eventhubs/microsoft-azure-eventhubs/src/test/java/com/microsoft/azure/eventhubs/sendrecv/WebSocketsSendTest.java diff --git a/eventhubs/data-plane/pom.xml b/sdk/eventhubs/pom.data.xml similarity index 100% rename from eventhubs/data-plane/pom.xml rename to sdk/eventhubs/pom.data.xml diff --git a/sdk/eventhubs/pom.service.xml b/sdk/eventhubs/pom.service.xml index 87821b3eed055..23edea1a17d6e 100644 --- a/sdk/eventhubs/pom.service.xml +++ b/sdk/eventhubs/pom.service.xml @@ -9,6 +9,9 @@ pom 1.0.0 + microsoft-azure-eventhubs + microsoft-azure-eventhubs-eph + microsoft-azure-eventhubs-extensions ../core azure-eventhubs diff --git a/sdk/eventhubs/tests.yml b/sdk/eventhubs/tests.yml new file mode 100644 index 0000000000000..e6aa03d5f6a63 --- /dev/null +++ b/sdk/eventhubs/tests.yml @@ -0,0 +1,10 @@ +trigger: none + +jobs: + - template: ../../eng/pipelines/templates/jobs/archetype-sdk-tests.yml + parameters: + ServiceDirectory: eventhubs + EnvVars: + AZURE_EVENTHUBS_CONNECTION_STRING: $(java-event-hubs-test-connection-string) + AZURE_TEST_MODE: RECORD + AZURE_LOG_LEVEL: 4 diff --git a/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java b/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java index da44d45f04a26..b8b4ad5c4816c 100644 --- a/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java +++ b/sdk/keyvault/azure-keyvault-keys/src/main/java/com/azure/security/keyvault/keys/KeyAsyncClient.java @@ -7,17 +7,16 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.http.rest.VoidResponse; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedFlux; import com.azure.core.implementation.RestProxy; +import com.azure.core.implementation.annotation.ReturnType; import com.azure.core.implementation.annotation.ServiceClient; -import com.azure.core.implementation.util.ImplUtils; -import com.azure.core.util.Context; +import com.azure.core.implementation.annotation.ServiceMethod; import com.azure.core.util.logging.ClientLogger; -import com.azure.security.keyvault.keys.implementation.DeletedKeyPage; -import com.azure.security.keyvault.keys.implementation.KeyBasePage; import com.azure.security.keyvault.keys.models.DeletedKey; import com.azure.security.keyvault.keys.models.EcKeyCreateOptions; import com.azure.security.keyvault.keys.models.Key; @@ -34,10 +33,11 @@ import java.util.Objects; import java.util.function.Function; -import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import static com.azure.core.implementation.util.FluxUtil.monoContext; + /** * The KeyAsyncClient provides asynchronous methods to manage {@link Key keys} in the Azure Key Vault. The client * supports creating, retrieving, updating, deleting, purging, backing up, restoring and listing the {@link Key keys}. The client @@ -48,6 +48,7 @@ * {@codesnippet com.azure.security.keyvault.keys.async.keyclient.instantiation} * * @see KeyClientBuilder + * @see PagedFlux */ @ServiceClient(builder = KeyClientBuilder.class, isAsync = true, serviceInterfaces = KeyService.class) public final class KeyAsyncClient { @@ -94,12 +95,13 @@ public final class KeyAsyncClient { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key created key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createKey(String name, KeyType keyType) { KeyRequestParameters parameters = new KeyRequestParameters().kty(keyType); - return service.createKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.createKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Creating key - {}", name)) .doOnSuccess(response -> logger.info("Created key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to create key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to create key - {}", name, error))); } /** @@ -130,16 +132,17 @@ public Mono> createKey(String name, KeyType keyType) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key created key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createKey(KeyCreateOptions keyCreateOptions) { Objects.requireNonNull(keyCreateOptions, "The key options parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .kty(keyCreateOptions.keyType()) .keyOps(keyCreateOptions.keyOperations()) .keyAttributes(new KeyRequestAttributes(keyCreateOptions)); - return service.createKey(endpoint, keyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.createKey(endpoint, keyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Creating key - {}", keyCreateOptions.name())) .doOnSuccess(response -> logger.info("Created key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to create key - {}", keyCreateOptions.name(), error)); + .doOnError(error -> logger.warning("Failed to create key - {}", keyCreateOptions.name(), error))); } /** @@ -172,6 +175,7 @@ public Mono> createKey(KeyCreateOptions keyCreateOptions) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key created key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createRsaKey(RsaKeyCreateOptions rsaKeyCreateOptions) { Objects.requireNonNull(rsaKeyCreateOptions, "The Rsa key options parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() @@ -179,10 +183,10 @@ public Mono> createRsaKey(RsaKeyCreateOptions rsaKeyCreateOptions) .keySize(rsaKeyCreateOptions.keySize()) .keyOps(rsaKeyCreateOptions.keyOperations()) .keyAttributes(new KeyRequestAttributes(rsaKeyCreateOptions)); - return service.createKey(endpoint, rsaKeyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.createKey(endpoint, rsaKeyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Creating Rsa key - {}", rsaKeyCreateOptions.name())) .doOnSuccess(response -> logger.info("Created Rsa key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to create Rsa key - {}", rsaKeyCreateOptions.name(), error)); + .doOnError(error -> logger.warning("Failed to create Rsa key - {}", rsaKeyCreateOptions.name(), error))); } /** @@ -215,6 +219,7 @@ public Mono> createRsaKey(RsaKeyCreateOptions rsaKeyCreateOptions) * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key created key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> createEcKey(EcKeyCreateOptions ecKeyCreateOptions) { Objects.requireNonNull(ecKeyCreateOptions, "The Ec key options options cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() @@ -222,10 +227,10 @@ public Mono> createEcKey(EcKeyCreateOptions ecKeyCreateOptions) { .curve(ecKeyCreateOptions.curve()) .keyOps(ecKeyCreateOptions.keyOperations()) .keyAttributes(new KeyRequestAttributes(ecKeyCreateOptions)); - return service.createKey(endpoint, ecKeyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.createKey(endpoint, ecKeyCreateOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Creating Ec key - {}", ecKeyCreateOptions.name())) .doOnSuccess(response -> logger.info("Created Ec key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to create Ec key - {}", ecKeyCreateOptions.name(), error)); + .doOnError(error -> logger.warning("Failed to create Ec key - {}", ecKeyCreateOptions.name(), error))); } /** @@ -245,12 +250,13 @@ public Mono> createEcKey(EcKeyCreateOptions ecKeyCreateOptions) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key imported key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importKey(String name, JsonWebKey keyMaterial) { KeyImportRequestParameters parameters = new KeyImportRequestParameters().key(keyMaterial); - return service.importKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.importKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Importing key - {}", name)) .doOnSuccess(response -> logger.info("Imported key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to import key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to import key - {}", name, error))); } /** @@ -279,16 +285,17 @@ public Mono> importKey(String name, JsonWebKey keyMaterial) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key imported key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> importKey(KeyImportOptions keyImportOptions) { Objects.requireNonNull(keyImportOptions, "The key import configuration parameter cannot be null."); KeyImportRequestParameters parameters = new KeyImportRequestParameters() .key(keyImportOptions.keyMaterial()) .hsm(keyImportOptions.hsm()) .keyAttributes(new KeyRequestAttributes(keyImportOptions)); - return service.importKey(endpoint, keyImportOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.importKey(endpoint, keyImportOptions.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Importing key - {}", keyImportOptions.name())) .doOnSuccess(response -> logger.info("Imported key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to import key - {}", keyImportOptions.name(), error)); + .doOnError(error -> logger.warning("Failed to import key - {}", keyImportOptions.name(), error))); } /** @@ -310,15 +317,15 @@ public Mono> importKey(KeyImportOptions keyImportOptions) { * @throws HttpRequestException if {@code name} or {@code version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the requested {@link Key key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKey(String name, String version) { - String keyVersion = ""; - if (version != null) { - keyVersion = version; + if (version == null) { + return getKey(name); } - return service.getKey(endpoint, name, keyVersion, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.getKey(endpoint, name, version, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Retrieving key - {}", name)) .doOnSuccess(response -> logger.info("Retrieved key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to get key - {}", name, error))); } /** @@ -339,11 +346,12 @@ public Mono> getKey(String name, String version) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the requested {@link Key key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKey(String name) { - return getKey(name, "") + return monoContext(context -> getKey(name, "") .doOnRequest(ignored -> logger.info("Retrieving key - {}", name)) .doOnSuccess(response -> logger.info("Retrieved key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to get key - {}", name, error))); } @@ -365,16 +373,14 @@ public Mono> getKey(String name) { * @throws HttpRequestException if {@link KeyBase#name()} name} or {@link KeyBase#version() version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the requested {@link Key key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getKey(KeyBase keyBase) { Objects.requireNonNull(keyBase, "The Key Base parameter cannot be null."); - String keyVersion = ""; - if (keyBase.version() != null) { - keyVersion = keyBase.version(); + if (keyBase.version() == null) { + return getKey(keyBase.name()); } - return service.getKey(endpoint, keyBase.name(), keyVersion, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Retrieving key - {}", keyBase.name())) - .doOnSuccess(response -> logger.info("Retrieved key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get key - {}", keyBase.name(), error)); + + return getKey(keyBase.name(), keyBase.version()); } /** @@ -401,16 +407,17 @@ public Mono> getKey(KeyBase keyBase) { * @throws HttpRequestException if {@link KeyBase#name() name} or {@link KeyBase#version() version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link KeyBase updated key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateKey(KeyBase key) { Objects.requireNonNull(key, "The key input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .tags(key.tags()) .keyAttributes(new KeyRequestAttributes(key)); - return service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Updating key - {}", key.name())) .doOnSuccess(response -> logger.info("Updated key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to update key - {}", key.name(), error)); + .doOnError(error -> logger.warning("Failed to update key - {}", key.name(), error))); } /** @@ -438,6 +445,7 @@ public Mono> updateKey(KeyBase key) { * @throws HttpRequestException if {@link KeyBase#name() name} or {@link KeyBase#version() version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link KeyBase updated key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateKey(KeyBase key, KeyOperation... keyOperations) { Objects.requireNonNull(key, "The key input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() @@ -445,10 +453,10 @@ public Mono> updateKey(KeyBase key, KeyOperation... keyOperations) .keyOps(Arrays.asList(keyOperations)) .keyAttributes(new KeyRequestAttributes(key)); - return service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.updateKey(endpoint, key.name(), key.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Updating key - {}", key.name())) .doOnSuccess(response -> logger.info("Updated key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to update key - {}", key.name(), error)); + .doOnError(error -> logger.warning("Failed to update key - {}", key.name(), error))); } /** @@ -471,11 +479,12 @@ public Mono> updateKey(KeyBase key, KeyOperation... keyOperations) * @throws HttpRequestException when a key with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link DeletedKey deleted key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteKey(String name) { - return service.deleteKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.deleteKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Deleting key - {}", name)) .doOnSuccess(response -> logger.info("Deleted key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to delete key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to delete key - {}", name, error))); } /** @@ -496,11 +505,12 @@ public Mono> deleteKey(String name) { * @throws HttpRequestException when a key with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link DeletedKey deleted key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeletedKey(String name) { - return service.getDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.getDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Retrieving deleted key - {}", name)) .doOnSuccess(response -> logger.info("Retrieved deleted key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to get key - {}", name, error))); } /** @@ -521,11 +531,12 @@ public Mono> getDeletedKey(String name) { * @throws HttpRequestException when a key with {@code name} is empty string. * @return A {@link Mono} containing a {@link VoidResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono purgeDeletedKey(String name) { - return service.purgeDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.purgeDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Purging deleted key - {}", name)) .doOnSuccess(response -> logger.info("Purged deleted key - {}", name)) - .doOnError(error -> logger.warning("Failed to purge deleted key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to purge deleted key - {}", name, error))); } /** @@ -547,11 +558,12 @@ public Mono purgeDeletedKey(String name) { * @throws HttpRequestException when a key with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key recovered key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> recoverDeletedKey(String name) { - return service.recoverDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.recoverDeletedKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Recovering deleted key - {}", name)) .doOnSuccess(response -> logger.info("Recovered deleted key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to recover deleted key - {}", name, error)); + .doOnError(error -> logger.warning("Failed to recover deleted key - {}", name, error))); } /** @@ -577,13 +589,14 @@ public Mono> recoverDeletedKey(String name) { * @throws HttpRequestException when a key with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the backed up key blob. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> backupKey(String name) { - return service.backupKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.backupKey(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Backing up key - {}", name)) .doOnSuccess(response -> logger.info("Backed up key - {}", name)) .doOnError(error -> logger.warning("Failed to backup key - {}", name, error)) .flatMap(base64URLResponse -> Mono.just(new SimpleResponse(base64URLResponse.request(), - base64URLResponse.statusCode(), base64URLResponse.headers(), base64URLResponse.value().value()))); + base64URLResponse.statusCode(), base64URLResponse.headers(), base64URLResponse.value().value())))); } /** @@ -608,12 +621,13 @@ public Mono> backupKey(String name) { * @throws ResourceModifiedException when {@code backup} blob is malformed. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Key restored key}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> restoreKey(byte[] backup) { KeyRestoreRequestParameters parameters = new KeyRestoreRequestParameters().keyBackup(backup); - return service.restoreKey(endpoint, API_VERSION, parameters, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.restoreKey(endpoint, API_VERSION, parameters, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Attempting to restore key")) .doOnSuccess(response -> logger.info("Restored Key - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to restore key - {}", error)); + .doOnError(error -> logger.warning("Failed to restore key - {}", error))); } /** @@ -629,14 +643,37 @@ public Mono> restoreKey(byte[] backup) { * .map(Response::value); * * - * @return A {@link Flux} containing {@link KeyBase key} of all the keys in the vault. + * @return A {@link PagedFlux} containing {@link KeyBase key} of all the keys in the vault. */ - public Flux listKeys() { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listKeys() { + return new PagedFlux<>( + () -> monoContext(context -> listKeysFirstPage()), + continuationToken -> monoContext(context -> listKeysNextPage(continuationToken))); + } + + /* + * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to + * {@link KeyAsyncClient#listKeys()}. + * + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the listKeys operations. + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. + */ + private Mono> listKeysNextPage(String continuationToken) { + return service.getKeys(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignored -> logger.info("Listing next keys page - Page {} ", continuationToken)) + .doOnSuccess(response -> logger.info("Listed next keys page - Page {} ", continuationToken)) + .doOnError(error -> logger.warning("Failed to list next keys page - Page {} ", continuationToken, error)); + } + + /* + * Calls the service and retrieve first page result. It makes one call and retrieve {@code DEFAULT_MAX_PAGE_RESULTS} values. + */ + private Mono> listKeysFirstPage() { return service.getKeys(endpoint, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing keys")) - .doOnSuccess(response -> logger.info("Listed keys")) - .doOnError(error -> logger.warning("Failed to list keys", error)) - .flatMapMany(r -> extractAndFetchKeys(r, Context.NONE)); + .doOnRequest(ignored -> logger.info("Listing keys")) + .doOnSuccess(response -> logger.info("Listed keys")) + .doOnError(error -> logger.warning("Failed to list keys", error)); } /** @@ -652,14 +689,37 @@ public Flux listKeys() { * System.out.printf("Deleted key's recovery Id %s \n", deletedKey.recoveryId())); * * - * @return A {@link Flux} containing all of the {@link DeletedKey deleted keys} in the vault. + * @return A {@link PagedFlux} containing all of the {@link DeletedKey deleted keys} in the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeletedKeys() { + return new PagedFlux<>( + () -> monoContext(context -> listDeletedKeysFirstPage()), + continuationToken -> monoContext(context -> listDeletedKeysNextPage(continuationToken))); + } + + /* + * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to + * {@link KeyAsyncClient#listDeletedKeys()}. + * + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the list operations. + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. + */ + private Mono> listDeletedKeysNextPage(String continuationToken) { + return service.getDeletedKeys(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignored -> logger.info("Listing next deleted keys page - Page {} ", continuationToken)) + .doOnSuccess(response -> logger.info("Listed next deleted keys page - Page {} ", continuationToken)) + .doOnError(error -> logger.warning("Failed to list next deleted keys page - Page {} ", continuationToken, error)); + } + + /* + * Calls the service and retrieve first page result. It makes one call and retrieve {@code DEFAULT_MAX_PAGE_RESULTS} values. */ - public Flux listDeletedKeys() { + private Mono> listDeletedKeysFirstPage() { return service.getDeletedKeys(endpoint, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing deleted keys")) - .doOnSuccess(response -> logger.info("Listed deleted keys")) - .doOnError(error -> logger.warning("Failed to list deleted keys", error)) - .flatMapMany(r -> extractAndFetchDeletedKeys(r, Context.NONE)); + .doOnRequest(ignored -> logger.info("Listing deleted keys")) + .doOnSuccess(response -> logger.info("Listed deleted keys")) + .doOnError(error -> logger.warning("Failed to list deleted keys", error)); } /** @@ -679,44 +739,34 @@ public Flux listDeletedKeys() { * @param name The name of the key. * @throws ResourceNotFoundException when a key with {@code name} doesn't exist in the key vault. * @throws HttpRequestException when a key with {@code name} is empty string. - * @return A {@link Flux} containing {@link KeyBase key} of all the versions of the specified key in the vault. Flux is empty if key with {@code name} does not exist in key vault. + * @return A {@link PagedFlux} containing {@link KeyBase key} of all the versions of the specified key in the vault. Flux is empty if key with {@code name} does not exist in key vault. */ - public Flux listKeyVersions(String name) { - return service.getKeyVersions(endpoint, name, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) - .doOnSuccess(response -> logger.info("Listed key versions - {}", name)) - .doOnError(error -> logger.warning(String.format("Failed to list key versions - {}", name), error)) - .flatMapMany(r -> extractAndFetchKeys(r, Context.NONE)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listKeyVersions(String name) { + return new PagedFlux<>( + () -> monoContext(context -> listKeyVersionsFirstPage(name)), + continuationToken -> monoContext(context -> listKeyVersionsNextPage(continuationToken))); } - /** - * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to - * {@link KeyAsyncClient#listKeys()}. - * - * @param nextPageLink The {@link KeyBasePage#nextLink()} from a previous, successful call to one of the list operations. - * @return A stream of {@link KeyBase key} from the next page of results. - */ - private Flux listKeysNext(String nextPageLink, Context context) { - return service.getKeys(endpoint, nextPageLink, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE).flatMapMany(r -> extractAndFetchKeys(r, context)); - } - - private Publisher extractAndFetchKeys(PagedResponse page, Context context) { - return ImplUtils.extractAndFetch(page, context, this::listKeysNext); + private Mono> listKeyVersionsFirstPage(String name) { + return service.getKeyVersions(endpoint, name, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignored -> logger.info("Listing key versions - {}", name)) + .doOnSuccess(response -> logger.info("Listed key versions - {}", name)) + .doOnError(error -> logger.warning(String.format("Failed to list key versions - {}", name), error)); } - /** + /* * Gets attributes of all the keys given by the {@code nextPageLink} that was retrieved from a call to - * {@link KeyAsyncClient#listDeletedKeys()}. + * {@link KeyAsyncClient#listKeyVersions()}. * - * @param nextPageLink The {@link DeletedKeyPage#nextLink()} from a previous, successful call to one of the list operations. - * @return A stream of {@link KeyBase key} from the next page of results. + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the listKeys operations. + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. */ - private Flux listDeletedKeysNext(String nextPageLink, Context context) { - return service.getDeletedKeys(endpoint, nextPageLink, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE).flatMapMany(r -> extractAndFetchDeletedKeys(r, context)); - } - - private Publisher extractAndFetchDeletedKeys(PagedResponse page, Context context) { - return ImplUtils.extractAndFetch(page, context, this::listDeletedKeysNext); + private Mono> listKeyVersionsNextPage(String continuationToken) { + return service.getKeys(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignored -> logger.info("Listing next key versions page - Page {} ", continuationToken)) + .doOnSuccess(response -> logger.info("Listed next key versions page - Page {} ", continuationToken)) + .doOnError(error -> logger.warning("Failed to list next key versions page - Page {} ", continuationToken, error)); } } diff --git a/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretAsyncClient.java b/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretAsyncClient.java index 0ed4b9d76c89c..8adfceac47ffe 100644 --- a/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretAsyncClient.java +++ b/sdk/keyvault/azure-keyvault-secrets/src/main/java/com/azure/security/keyvault/secrets/SecretAsyncClient.java @@ -4,21 +4,20 @@ package com.azure.security.keyvault.secrets; import com.azure.core.http.HttpPipeline; -import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; import com.azure.core.http.rest.VoidResponse; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.implementation.RestProxy; +import com.azure.core.implementation.annotation.ReturnType; import com.azure.core.implementation.annotation.ServiceClient; -import com.azure.core.implementation.util.ImplUtils; +import com.azure.core.implementation.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.security.keyvault.secrets.implementation.SecretBasePage; import com.azure.security.keyvault.secrets.models.DeletedSecret; import com.azure.security.keyvault.secrets.models.Secret; import com.azure.security.keyvault.secrets.models.SecretBase; -import com.azure.security.keyvault.secrets.implementation.DeletedSecretPage; -import org.reactivestreams.Publisher; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -29,6 +28,8 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.HttpRequestException; +import static com.azure.core.implementation.util.FluxUtil.monoContext; + /** * The SecretAsyncClient provides asynchronous methods to manage {@link Secret secrets} in the Azure Key Vault. The client * supports creating, retrieving, updating, deleting, purging, backing up, restoring and listing the {@link Secret secrets}. The client @@ -38,6 +39,7 @@ * {@codesnippet com.azure.security.keyvault.secretclient.async.construct} * * @see SecretClientBuilder + * @see PagedFlux */ @ServiceClient(builder = SecretClientBuilder.class, isAsync = true, serviceInterfaces = SecretService.class) public final class SecretAsyncClient { @@ -89,6 +91,7 @@ public final class SecretAsyncClient { * @throws HttpRequestException if {@link Secret#name() name} or {@link Secret#value() value} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Secret created secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setSecret(Secret secret) { Objects.requireNonNull(secret, "The Secret input parameter cannot be null."); SecretRequestParameters parameters = new SecretRequestParameters() @@ -97,10 +100,10 @@ public Mono> setSecret(Secret secret) { .contentType(secret.contentType()) .secretAttributes(new SecretRequestAttributes(secret)); - return service.setSecret(endpoint, secret.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.setSecret(endpoint, secret.name(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Setting secret - {}", secret.name())) .doOnSuccess(response -> logger.info("Set secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to set secret - {}", secret.name(), error)); + .doOnError(error -> logger.warning("Failed to set secret - {}", secret.name(), error))); } /** @@ -121,12 +124,13 @@ public Mono> setSecret(Secret secret) { * @throws HttpRequestException if {@code name} or {@code value} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Secret created secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setSecret(String name, String value) { SecretRequestParameters parameters = new SecretRequestParameters().value(value); - return service.setSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.setSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Setting secret - {}", name)) .doOnSuccess(response -> logger.info("Set secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to set secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to set secret - {}", name, error))); } /** @@ -149,15 +153,16 @@ public Mono> setSecret(String name, String value) { * @throws HttpRequestException if {@code name} name} or {@code version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the requested {@link Secret secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSecret(String name, String version) { - String secretVersion = ""; - if (version != null) { - secretVersion = version; + if (version == null) { + return getSecret(name); } - return service.getSecret(endpoint, name, secretVersion, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + + return monoContext(context -> service.getSecret(endpoint, name, version, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignoredValue -> logger.info("Retrieving secret - {}", name)) .doOnSuccess(response -> logger.info("Retrieved secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to get secret - {}", name, error))); } /** @@ -178,16 +183,13 @@ public Mono> getSecret(String name, String version) { * @throws HttpRequestException if {@link SecretBase#name()} name} or {@link SecretBase#version() version} is empty string. * @return A {@link Response} whose {@link Response#value() value} contains the requested {@link Secret secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSecret(SecretBase secretBase) { Objects.requireNonNull(secretBase, "The Secret Base parameter cannot be null."); - String secretVersion = ""; - if (secretBase.version() != null) { - secretVersion = secretBase.version(); + if (secretBase.version() == null) { + return getSecret(secretBase.name()); } - return service.getSecret(endpoint, secretBase.name(), secretVersion, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignoredValue -> logger.info("Retrieving secret - {}", secretBase.name())) - .doOnSuccess(response -> logger.info("Retrieved secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to get secret - {}", secretBase.name(), error)); + return getSecret(secretBase.name(), secretBase.version()); } /** * Get the latest version of the specified secret from the key vault. The get operation is applicable to any secret stored in Azure Key Vault. @@ -207,6 +209,7 @@ public Mono> getSecret(SecretBase secretBase) { * @throws HttpRequestException if {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the requested {@link Secret secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSecret(String name) { return getSecret(name, ""); } @@ -236,6 +239,7 @@ public Mono> getSecret(String name) { * @throws HttpRequestException if {@link SecretBase#name()} name} or {@link SecretBase#version() version} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link SecretBase updated secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> updateSecret(SecretBase secret) { Objects.requireNonNull(secret, "The secret input parameter cannot be null."); SecretRequestParameters parameters = new SecretRequestParameters() @@ -243,10 +247,10 @@ public Mono> updateSecret(SecretBase secret) { .contentType(secret.contentType()) .secretAttributes(new SecretRequestAttributes(secret)); - return service.updateSecret(endpoint, secret.name(), secret.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.updateSecret(endpoint, secret.name(), secret.version(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Updating secret - {}", secret.name())) .doOnSuccess(response -> logger.info("Updated secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to update secret - {}", secret.name(), error)); + .doOnError(error -> logger.warning("Failed to update secret - {}", secret.name(), error))); } /** @@ -267,11 +271,12 @@ public Mono> updateSecret(SecretBase secret) { * @throws HttpRequestException when a secret with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link DeletedSecret deleted secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteSecret(String name) { - return service.deleteSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.deleteSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Deleting secret - {}", name)) .doOnSuccess(response -> logger.info("Deleted secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to delete secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to delete secret - {}", name, error))); } /** @@ -292,11 +297,12 @@ public Mono> deleteSecret(String name) { * @throws HttpRequestException when a secret with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link DeletedSecret deleted secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getDeletedSecret(String name) { - return service.getDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.getDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Retrieving deleted secret - {}", name)) .doOnSuccess(response -> logger.info("Retrieved deleted secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to retrieve deleted secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to retrieve deleted secret - {}", name, error))); } /** @@ -317,11 +323,12 @@ public Mono> getDeletedSecret(String name) { * @throws HttpRequestException when a secret with {@code name} is empty string. * @return A {@link Mono} containing a {@link VoidResponse}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono purgeDeletedSecret(String name) { - return service.purgeDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.purgeDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Purging deleted secret - {}", name)) .doOnSuccess(response -> logger.info("Purged deleted secret - {}", name)) - .doOnError(error -> logger.warning("Failed to purge deleted secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to purge deleted secret - {}", name, error))); } /** @@ -342,11 +349,12 @@ public Mono purgeDeletedSecret(String name) { * @throws HttpRequestException when a secret with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Secret recovered secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> recoverDeletedSecret(String name) { - return service.recoverDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.recoverDeletedSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Recovering deleted secret - {}", name)) .doOnSuccess(response -> logger.info("Recovered deleted secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to recover deleted secret - {}", name, error)); + .doOnError(error -> logger.warning("Failed to recover deleted secret - {}", name, error))); } /** @@ -366,13 +374,14 @@ public Mono> recoverDeletedSecret(String name) { * @throws HttpRequestException when a secret with {@code name} is empty string. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the backed up secret blob. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> backupSecret(String name) { - return service.backupSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.backupSecret(endpoint, name, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Backing up secret - {}", name)) .doOnSuccess(response -> logger.info("Backed up secret - {}", name)) .doOnError(error -> logger.warning("Failed to back up secret - {}", name, error)) .flatMap(base64URLResponse -> Mono.just(new SimpleResponse(base64URLResponse.request(), - base64URLResponse.statusCode(), base64URLResponse.headers(), base64URLResponse.value().value()))); + base64URLResponse.statusCode(), base64URLResponse.headers(), base64URLResponse.value().value())))); } /** @@ -391,12 +400,13 @@ public Mono> backupSecret(String name) { * @throws ResourceModifiedException when {@code backup} blob is malformed. * @return A {@link Mono} containing a {@link Response} whose {@link Response#value() value} contains the {@link Secret restored secret}. */ + @ServiceMethod(returns = ReturnType.SINGLE) public Mono> restoreSecret(byte[] backup) { SecretRestoreRequestParameters parameters = new SecretRestoreRequestParameters().secretBackup(backup); - return service.restoreSecret(endpoint, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) + return monoContext(context -> service.restoreSecret(endpoint, API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE) .doOnRequest(ignored -> logger.info("Attempting to restore secret")) .doOnSuccess(response -> logger.info("Restored secret - {}", response.value().name())) - .doOnError(error -> logger.warning("Failed to restore secret", error)); + .doOnError(error -> logger.warning("Failed to restore secret", error))); } /** @@ -412,14 +422,37 @@ public Mono> restoreSecret(byte[] backup) { * .map(Response::value); * * - * @return A {@link Flux} containing {@link SecretBase secret} of all the secrets in the vault. + * @return A {@link PagedFlux} containing {@link SecretBase secret} of all the secrets in the vault. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSecrets() { + return new PagedFlux<>( + () -> monoContext(context -> listSecretsFirstPage()), + continuationToken -> monoContext(context -> listSecretsNextPage(continuationToken))); + } + + /* + * Gets attributes of all the secrets given by the {@code nextPageLink} that was retrieved from a call to + * {@link SecretAsyncClient#listSecrets()}. + * + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the list operations. + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. + */ + private Mono> listSecretsNextPage(String continuationToken) { + return service.getSecrets(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignoredValue -> logger.info("Retrieving the next secrets page - Page {}", continuationToken)) + .doOnSuccess(response -> logger.info("Retrieved the next secrets page - Page {}", continuationToken)) + .doOnError(error -> logger.warning("Failed to retrieve the next secrets page - Page {}", continuationToken, error)); + } + + /* + * Calls the service and retrieve first page result. It makes one call and retrieve {@code DEFAULT_MAX_PAGE_RESULTS} values. */ - public Flux listSecrets() { + private Mono> listSecretsFirstPage() { return service.getSecrets(endpoint, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing secrets")) - .doOnSuccess(response -> logger.info("Listed secrets")) - .doOnError(error -> logger.warning("Failed to list secrets", error)) - .flatMapMany(r -> extractAndFetchSecrets(r, Context.NONE)); + .doOnRequest(ignored -> logger.info("Listing secrets")) + .doOnSuccess(response -> logger.info("Listed secrets")) + .doOnError(error -> logger.warning("Failed to list secrets", error)); } /** @@ -436,12 +469,35 @@ public Flux listSecrets() { * * @return A {@link Flux} containing all of the {@link DeletedSecret deleted secrets} in the vault. */ - public Flux listDeletedSecrets() { + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listDeletedSecrets() { + return new PagedFlux<>( + () -> monoContext(context -> listDeletedSecretsFirstPage()), + continuationToken -> monoContext(context -> listDeletedSecretsNextPage(continuationToken, Context.NONE))); + } + + /** + * Gets attributes of all the secrets given by the {@code nextPageLink} that was retrieved from a call to + * {@link SecretAsyncClient#listDeletedSecrets()}. + * + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the list operations. + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. + */ + private Mono> listDeletedSecretsNextPage(String continuationToken, Context context) { + return service.getDeletedSecrets(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignoredValue -> logger.info("Retrieving the next deleted secrets page - Page {}", continuationToken)) + .doOnSuccess(response -> logger.info("Retrieved the next deleted secrets page - Page {}", continuationToken)) + .doOnError(error -> logger.warning("Failed to retrieve the next deleted secrets page - Page {}", continuationToken, error)); + } + + /* + * Calls the service and retrieve first page result. It makes one call and retrieve {@code DEFAULT_MAX_PAGE_RESULTS} values. + */ + private Mono> listDeletedSecretsFirstPage() { return service.getDeletedSecrets(endpoint, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing deleted secrets")) - .doOnSuccess(response -> logger.info("Listed deleted secrets")) - .doOnError(error -> logger.warning("Failed to list deleted secrets", error)) - .flatMapMany(r -> extractAndFetchDeletedSecrets(r, Context.NONE)); + .doOnRequest(ignored -> logger.info("Listing deleted secrets")) + .doOnSuccess(response -> logger.info("Listed deleted secrets")) + .doOnError(error -> logger.warning("Failed to list deleted secrets", error)); } /** @@ -461,51 +517,37 @@ public Flux listDeletedSecrets() { * @param name The name of the secret. * @throws ResourceNotFoundException when a secret with {@code name} doesn't exist in the key vault. * @throws HttpRequestException when a secret with {@code name} is empty string. - * @return A {@link Flux} containing {@link SecretBase secret} of all the versions of the specified secret in the vault. Flux is empty if secret with {@code name} does not exist in key vault + * @return A {@link PagedFlux} containing {@link SecretBase secret} of all the versions of the specified secret in the vault. Flux is empty if secret with {@code name} does not exist in key vault */ - public Flux listSecretVersions(String name) { - return service.getSecretVersions(endpoint, name, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignored -> logger.info("Listing secret versions - {}", name)) - .doOnSuccess(response -> logger.info("Listed secret versions - {}", name)) - .doOnError(error -> logger.warning(String.format("Failed to list secret versions - {}", name), error)) - .flatMapMany(r -> extractAndFetchSecrets(r, Context.NONE)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSecretVersions(String name) { + return new PagedFlux<>( + () -> monoContext(context -> listSecretVersionsFirstPage(name)), + continuationToken -> monoContext(context -> listSecretVersionsNextPage(continuationToken))); } - /** - * Gets attributes of all the secrets given by the {@code nextPageLink} that was retrieved from a call to - * {@link SecretAsyncClient#listSecrets()}. + /* + * Gets attributes of all the secrets versions given by the {@code nextPageLink} that was retrieved from a call to + * {@link SecretAsyncClient#listSecretVersions()}. * - * @param nextPageLink The {@link SecretBasePage#nextLink()} from a previous, successful call to one of the list operations. - * @return A stream of {@link SecretBase secret} from the next page of results. + * @param continuationToken The {@link PagedResponse#nextLink()} from a previous, successful call to one of the list operations. + * + * @return A {@link Mono} of {@link PagedResponse} from the next page of results. */ - private Flux listSecretsNext(String nextPageLink, Context context) { - return service.getSecrets(endpoint, nextPageLink, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignoredValue -> logger.info("Retrieving the next listing page - Page {}", nextPageLink)) - .doOnSuccess(response -> logger.info("Retrieved the next listing page - Page {}", nextPageLink)) - .doOnError(error -> logger.warning("Failed to retrieve the next listing page - Page {}", nextPageLink, error)) - .flatMapMany(r -> extractAndFetchSecrets(r, context)); + private Mono> listSecretVersionsNextPage(String continuationToken) { + return service.getSecrets(endpoint, continuationToken, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignoredValue -> logger.info("Retrieving the next secrets versions page - Page {}", continuationToken)) + .doOnSuccess(response -> logger.info("Retrieved the next secrets versions page - Page {}", continuationToken)) + .doOnError(error -> logger.warning("Failed to retrieve the next secrets versions page - Page {}", continuationToken, error)); } - private Publisher extractAndFetchSecrets(PagedResponse page, Context context) { - return ImplUtils.extractAndFetch(page, context, this::listSecretsNext); - } - - /** - * Gets attributes of all the secrets given by the {@code nextPageLink} that was retrieved from a call to - * {@link SecretAsyncClient#listDeletedSecrets()}. - * - * @param nextPageLink The {@link DeletedSecretPage#nextLink()} from a previous, successful call to one of the list operations. - * @return A stream of {@link SecretBase secret} from the next page of results. + /* + * Calls the service and retrieve first page result. It makes one call and retrieve {@code DEFAULT_MAX_PAGE_RESULTS} values. */ - private Flux listDeletedSecretsNext(String nextPageLink, Context context) { - return service.getDeletedSecrets(endpoint, nextPageLink, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) - .doOnRequest(ignoredValue -> logger.info("Retrieving the next listing page - Page {}", nextPageLink)) - .doOnSuccess(response -> logger.info("Retrieved the next listing page - Page {}", nextPageLink)) - .doOnError(error -> logger.warning("Failed to retrieve the next listing page - Page {}", nextPageLink, error)) - .flatMapMany(r -> extractAndFetchDeletedSecrets(r, context)); - } - - private Publisher extractAndFetchDeletedSecrets(PagedResponse page, Context context) { - return ImplUtils.extractAndFetch(page, context, this::listDeletedSecretsNext); + private Mono> listSecretVersionsFirstPage(String name) { + return service.getSecretVersions(endpoint, name, DEFAULT_MAX_PAGE_RESULTS, API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE) + .doOnRequest(ignored -> logger.info("Listing secret versions - {}", name)) + .doOnSuccess(response -> logger.info("Listed secret versions - {}", name)) + .doOnError(error -> logger.warning(String.format("Failed to list secret versions - {}", name), error)); } }