customPolicies = new ArrayList<>();
-
- /**
- * Default constructor for CommunicationRelayClientBuilder.
- */
- public CommunicationRelayClientBuilder() {
- }
-
- /**
- * Set endpoint of the service
- *
- * @param endpoint url of the service
- * @return CommunicationRelayClientBuilder
- */
- @Override
- public CommunicationRelayClientBuilder endpoint(String endpoint) {
- this.endpoint = endpoint;
- return this;
- }
-
- /**
- * Sets the {@link HttpPipeline} to use for the service client.
- *
- * Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * If a pipeline is not supplied, the credential and httpClient fields must be set
- *
- *
- * @param pipeline {@link HttpPipeline} to use for sending service requests and receiving responses.
- * @return CommunicationRelayClientBuilder
- */
- @Override
- public CommunicationRelayClientBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
- return this;
- }
-
- /**
- * Sets the {@link TokenCredential} used to authorize requests sent to the service. Refer to the Azure SDK for Java
- * identity and authentication
- * documentation for more details on proper usage of the {@link TokenCredential} type.
- *
- * @param tokenCredential {@link TokenCredential} used to authorize requests sent to the service.
- * @return The updated {@link CommunicationRelayClientBuilder} object.
- */
- @Override
- public CommunicationRelayClientBuilder credential(TokenCredential tokenCredential) {
- this.tokenCredential = tokenCredential;
- return this;
- }
-
- /**
- * Sets the {@link AzureKeyCredential} used to authenticate HTTP requests.
- *
- * @param keyCredential The {@link AzureKeyCredential} used to authenticate HTTP requests.
- * @return The updated {@link CommunicationRelayClientBuilder} object.
- */
- @Override
- public CommunicationRelayClientBuilder credential(AzureKeyCredential keyCredential) {
- this.azureKeyCredential = keyCredential;
- return this;
- }
-
- /**
- * Set endpoint and credential to use
- *
- * @param connectionString connection string for setting endpoint and initalizing CommunicationClientCredential
- * @return CommunicationRelayClientBuilder
- */
- @Override
- public CommunicationRelayClientBuilder connectionString(String connectionString) {
- CommunicationConnectionString connectionStringObject = new CommunicationConnectionString(connectionString);
- String endpoint = connectionStringObject.getEndpoint();
- String accessKey = connectionStringObject.getAccessKey();
- this
- .endpoint(endpoint)
- .credential(new AzureKeyCredential(accessKey));
- return this;
- }
-
- /**
- * Sets the {@link HttpClient} to use for sending and receiving requests to and from the service.
- *
- * Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * @param httpClient The {@link HttpClient} to use for requests.
- * @return CommunicationRelayClientBuilder
- */
- @Override
- public CommunicationRelayClientBuilder httpClient(HttpClient httpClient) {
- this.httpClient = httpClient;
- return this;
- }
-
- /**
- * Adds a {@link HttpPipelinePolicy pipeline policy} to apply on each request sent.
- *
- * Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * @param customPolicy A {@link HttpPipelinePolicy pipeline policy}.
- * @return CommunicationRelayClientBuilder
- */
- @Override
- public CommunicationRelayClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
- this.customPolicies.add(customPolicy);
- return this;
- }
-
- /**
- * Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is
- * recommended that this method be called with an instance of the {@link HttpClientOptions}
- * class (a subclass of the {@link ClientOptions} base class). The HttpClientOptions subclass provides more
- * configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait
- * interface.
- *
- * Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * @param clientOptions A configured instance of {@link HttpClientOptions}.
- * @return The updated {@link CommunicationRelayClientBuilder} object.
- * @see HttpClientOptions
- */
- @Override
- public CommunicationRelayClientBuilder clientOptions(ClientOptions clientOptions) {
- this.clientOptions = clientOptions;
- return this;
- }
-
- /**
- * Sets the configuration object used to retrieve environment configuration values during building of the client.
- *
- * @param configuration Configuration store used to retrieve environment configurations.
- * @return the updated CommunicationRelayClientBuilder object
- */
- @Override
- public CommunicationRelayClientBuilder configuration(Configuration configuration) {
- this.configuration = configuration;
- return this;
- }
-
- /**
- * Sets the {@link HttpLogOptions logging configuration} to use when sending and receiving requests to and from
- * the service. If a {@code logLevel} is not provided, default value of {@link HttpLogDetailLevel#NONE} is set.
- *
- * Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * @param logOptions The {@link HttpLogOptions logging configuration} to use when sending and receiving requests to
- * and from the service.
- * @return the updated CommunicationRelayClientBuilder object
- */
- @Override
- public CommunicationRelayClientBuilder httpLogOptions(HttpLogOptions logOptions) {
- this.httpLogOptions = logOptions;
- return this;
- }
-
- /**
- * Sets the {@link RetryPolicy} that is used when each request is sent.
- *
- * Setting this is mutually exclusive with using {@link #retryOptions(RetryOptions)}.
- *
- * @param retryPolicy User's retry policy applied to each request.
- * @return The updated {@link CommunicationRelayClientBuilder} object.
- */
- public CommunicationRelayClientBuilder retryPolicy(RetryPolicy retryPolicy) {
- this.retryPolicy = retryPolicy;
- return this;
- }
-
- /**
- * Sets the {@link RetryOptions} for all the requests made through the client.
- *
- *
Note: It is important to understand the precedence order of the HttpTrait APIs. In
- * particular, if a {@link HttpPipeline} is specified, this takes precedence over all other APIs in the trait, and
- * they will be ignored. If no {@link HttpPipeline} is specified, a HTTP pipeline will be constructed internally
- * based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this
- * trait that are also ignored if an {@link HttpPipeline} is specified, so please be sure to refer to the
- * documentation of types that implement this trait to understand the full set of implications.
- *
- * Setting this is mutually exclusive with using {@link #retryPolicy(RetryPolicy)}.
- *
- * @param retryOptions The {@link RetryOptions} to use for all the requests made through the client.
- * @return The updated {@link CommunicationRelayClientBuilder} object.
- */
- @Override
- public CommunicationRelayClientBuilder retryOptions(RetryOptions retryOptions) {
- this.retryOptions = retryOptions;
- return this;
- }
-
- /**
- * Sets the {@link CommunicationRelayServiceVersion} that is used when making API requests.
- *
- * If a service version is not provided, the service version that will be used will be the latest known service
- * version based on the version of the client library being used. If no service version is specified, updating to a
- * newer version of the client library will have the result of potentially moving to a newer service version.
- *
- * Targeting a specific service version may also mean that the service will return an error for newer APIs.
- *
- * @param version {@link CommunicationRelayServiceVersion} of the service to be used when making requests.
- * @return the updated CommunicationRelayClientBuilder object
- */
- public CommunicationRelayClientBuilder serviceVersion(CommunicationRelayServiceVersion version) {
- return this;
- }
-
- /**
- * Create asynchronous client applying HMACAuthenticationPolicy, UserAgentPolicy,
- * RetryPolicy, and CookiePolicy.
- * Additional HttpPolicies specified by additionalPolicies will be applied after them
- *
- * @return CommunicationRelayAsyncClient instance
- * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)}
- * and {@link #retryPolicy(RetryPolicy)} have been set.
- */
- public CommunicationRelayAsyncClient buildAsyncClient() {
- Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
- return new CommunicationRelayAsyncClient(createServiceImpl());
- }
-
- /**
- * Create synchronous client applying HmacAuthenticationPolicy, UserAgentPolicy,
- * RetryPolicy, and CookiePolicy.
- * Additional HttpPolicies specified by additionalPolicies will be applied after them
- *
- * @return CommunicationRelayClient instance
- * @throws IllegalStateException If both {@link #retryOptions(RetryOptions)}
- * and {@link #retryPolicy(RetryPolicy)} have been set.
- */
- public CommunicationRelayClient buildClient() {
- return new CommunicationRelayClient(buildAsyncClient());
- }
-
- private CommunicationNetworkTraversalClientImpl createServiceImpl() {
-
-
- HttpPipeline builderPipeline = this.pipeline;
- if (this.pipeline == null) {
- builderPipeline = createHttpPipeline(httpClient,
- createHttpPipelineAuthPolicy(),
- customPolicies);
- }
-
- CommunicationNetworkTraversalClientImplBuilder clientBuilder = new CommunicationNetworkTraversalClientImplBuilder();
- clientBuilder.endpoint(endpoint)
- .pipeline(builderPipeline);
-
- return clientBuilder.buildClient();
- }
-
- private HttpPipelinePolicy createHttpPipelineAuthPolicy() {
- if (this.tokenCredential != null && this.azureKeyCredential != null) {
- throw logger.logExceptionAsError(
- new IllegalArgumentException("Both 'credential' and 'accessKey' are set. Just one may be used."));
- }
- if (this.tokenCredential != null) {
- return new BearerTokenAuthenticationPolicy(
- this.tokenCredential, "https://communication.azure.com//.default");
- } else if (this.azureKeyCredential != null) {
- return new HmacAuthenticationPolicy(this.azureKeyCredential);
- } else {
- throw logger.logExceptionAsError(
- new IllegalArgumentException("Missing credential information while building a client."));
- }
- }
-
- private HttpPipeline createHttpPipeline(HttpClient httpClient,
- HttpPipelinePolicy authorizationPolicy,
- List customPolicies) {
-
- List policies = new ArrayList();
- applyRequiredPolicies(policies, authorizationPolicy);
-
- if (customPolicies != null && customPolicies.size() > 0) {
- policies.addAll(customPolicies);
- }
-
- return new HttpPipelineBuilder()
- .policies(policies.toArray(new HttpPipelinePolicy[0]))
- .httpClient(httpClient)
- .clientOptions(clientOptions)
- .build();
- }
-
- private void applyRequiredPolicies(List policies, HttpPipelinePolicy authorizationPolicy) {
- String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");
- String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");
-
- ClientOptions buildClientOptions = (clientOptions == null) ? new ClientOptions() : clientOptions;
- HttpLogOptions buildLogOptions = (httpLogOptions == null) ? new HttpLogOptions() : httpLogOptions;
-
- String applicationId = null;
- if (!CoreUtils.isNullOrEmpty(buildClientOptions.getApplicationId())) {
- applicationId = buildClientOptions.getApplicationId();
- } else if (!CoreUtils.isNullOrEmpty(buildLogOptions.getApplicationId())) {
- applicationId = buildLogOptions.getApplicationId();
- }
-
- policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, configuration));
- policies.add(new RequestIdPolicy());
- policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions));
- policies.add(new CookiePolicy());
- // auth policy is per request, should be after retry
- policies.add(authorizationPolicy);
- policies.add(new HttpLoggingPolicy(httpLogOptions));
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/CommunicationRelayServiceVersion.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/CommunicationRelayServiceVersion.java
deleted file mode 100644
index 360251fc57b94..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/CommunicationRelayServiceVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.communication.networktraversal;
-
-import com.azure.core.util.ServiceVersion;
-
-/**
- * The versions of Communication Relay Service supported by this client library.
- */
-public enum CommunicationRelayServiceVersion implements ServiceVersion {
- /**
- * Service version {@code 2021_10_08}.
- */
- V2021_10_08("2021_10_08");
-
- private final String version;
-
- CommunicationRelayServiceVersion(String version) {
-
- this.version = version;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getVersion() {
-
- return this.version;
- }
-
- /**
- * Gets the latest service version supported by this client library
- *
- * @return the latest {@link CommunicationRelayServiceVersion}
- */
- public static CommunicationRelayServiceVersion getLatest() {
-
- return V2021_10_08;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImpl.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImpl.java
deleted file mode 100644
index f65fe516ea6f8..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation;
-
-import com.azure.core.http.HttpPipeline;
-import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
-import com.azure.core.http.policy.RetryPolicy;
-import com.azure.core.http.policy.UserAgentPolicy;
-import com.azure.core.util.serializer.JacksonAdapter;
-import com.azure.core.util.serializer.SerializerAdapter;
-
-/** Initializes a new instance of the CommunicationNetworkTraversalClient type. */
-public final class CommunicationNetworkTraversalClientImpl {
- /** The communication resource, for example https://my-resource.communication.azure.com. */
- private final String endpoint;
-
- /**
- * Gets The communication resource, for example https://my-resource.communication.azure.com.
- *
- * @return the endpoint value.
- */
- public String getEndpoint() {
- return this.endpoint;
- }
-
- /** Api Version. */
- private final String apiVersion;
-
- /**
- * Gets Api Version.
- *
- * @return the apiVersion value.
- */
- public String getApiVersion() {
- return this.apiVersion;
- }
-
- /** The HTTP pipeline to send requests through. */
- private final HttpPipeline httpPipeline;
-
- /**
- * Gets The HTTP pipeline to send requests through.
- *
- * @return the httpPipeline value.
- */
- public HttpPipeline getHttpPipeline() {
- return this.httpPipeline;
- }
-
- /** The serializer to serialize an object into a string. */
- private final SerializerAdapter serializerAdapter;
-
- /**
- * Gets The serializer to serialize an object into a string.
- *
- * @return the serializerAdapter value.
- */
- public SerializerAdapter getSerializerAdapter() {
- return this.serializerAdapter;
- }
-
- /** The CommunicationNetworkTraversalsImpl object to access its operations. */
- private final CommunicationNetworkTraversalsImpl communicationNetworkTraversals;
-
- /**
- * Gets the CommunicationNetworkTraversalsImpl object to access its operations.
- *
- * @return the CommunicationNetworkTraversalsImpl object.
- */
- public CommunicationNetworkTraversalsImpl getCommunicationNetworkTraversals() {
- return this.communicationNetworkTraversals;
- }
-
- /**
- * Initializes an instance of CommunicationNetworkTraversalClient client.
- *
- * @param endpoint The communication resource, for example https://my-resource.communication.azure.com.
- * @param apiVersion Api Version.
- */
- CommunicationNetworkTraversalClientImpl(String endpoint, String apiVersion) {
- this(
- new HttpPipelineBuilder()
- .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
- .build(),
- JacksonAdapter.createDefaultSerializerAdapter(),
- endpoint,
- apiVersion);
- }
-
- /**
- * Initializes an instance of CommunicationNetworkTraversalClient client.
- *
- * @param httpPipeline The HTTP pipeline to send requests through.
- * @param endpoint The communication resource, for example https://my-resource.communication.azure.com.
- * @param apiVersion Api Version.
- */
- CommunicationNetworkTraversalClientImpl(HttpPipeline httpPipeline, String endpoint, String apiVersion) {
- this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion);
- }
-
- /**
- * Initializes an instance of CommunicationNetworkTraversalClient client.
- *
- * @param httpPipeline The HTTP pipeline to send requests through.
- * @param serializerAdapter The serializer to serialize an object into a string.
- * @param endpoint The communication resource, for example https://my-resource.communication.azure.com.
- * @param apiVersion Api Version.
- */
- CommunicationNetworkTraversalClientImpl(
- HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) {
- this.httpPipeline = httpPipeline;
- this.serializerAdapter = serializerAdapter;
- this.endpoint = endpoint;
- this.apiVersion = apiVersion;
- this.communicationNetworkTraversals = new CommunicationNetworkTraversalsImpl(this);
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImplBuilder.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImplBuilder.java
deleted file mode 100644
index f7d9c8268bda2..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalClientImplBuilder.java
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation;
-
-import com.azure.core.annotation.ServiceClientBuilder;
-import com.azure.core.http.HttpClient;
-import com.azure.core.http.HttpPipeline;
-import com.azure.core.http.HttpPipelineBuilder;
-import com.azure.core.http.policy.CookiePolicy;
-import com.azure.core.http.policy.HttpLogOptions;
-import com.azure.core.http.policy.HttpLoggingPolicy;
-import com.azure.core.http.policy.HttpPipelinePolicy;
-import com.azure.core.http.policy.HttpPolicyProviders;
-import com.azure.core.http.policy.RetryPolicy;
-import com.azure.core.http.policy.UserAgentPolicy;
-import com.azure.core.util.Configuration;
-import com.azure.core.util.serializer.JacksonAdapter;
-import com.azure.core.util.serializer.SerializerAdapter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/** A builder for creating a new instance of the CommunicationNetworkTraversalClient type. */
-@ServiceClientBuilder(serviceClients = {CommunicationNetworkTraversalClientImpl.class})
-public final class CommunicationNetworkTraversalClientImplBuilder {
- private static final String SDK_NAME = "name";
-
- private static final String SDK_VERSION = "version";
-
- private final Map properties = new HashMap<>();
-
- /** Create an instance of the CommunicationNetworkTraversalClientImplBuilder. */
- public CommunicationNetworkTraversalClientImplBuilder() {
- this.pipelinePolicies = new ArrayList<>();
- }
-
- /*
- * The communication resource, for example
- * https://my-resource.communication.azure.com
- */
- private String endpoint;
-
- /**
- * Sets The communication resource, for example https://my-resource.communication.azure.com.
- *
- * @param endpoint the endpoint value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder endpoint(String endpoint) {
- this.endpoint = endpoint;
- return this;
- }
-
- /*
- * Api Version
- */
- private String apiVersion;
-
- /**
- * Sets Api Version.
- *
- * @param apiVersion the apiVersion value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder apiVersion(String apiVersion) {
- this.apiVersion = apiVersion;
- return this;
- }
-
- /*
- * The HTTP pipeline to send requests through
- */
- private HttpPipeline pipeline;
-
- /**
- * Sets The HTTP pipeline to send requests through.
- *
- * @param pipeline the pipeline value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder pipeline(HttpPipeline pipeline) {
- this.pipeline = pipeline;
- return this;
- }
-
- /*
- * The serializer to serialize an object into a string
- */
- private SerializerAdapter serializerAdapter;
-
- /**
- * Sets The serializer to serialize an object into a string.
- *
- * @param serializerAdapter the serializerAdapter value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
- this.serializerAdapter = serializerAdapter;
- return this;
- }
-
- /*
- * The HTTP client used to send the request.
- */
- private HttpClient httpClient;
-
- /**
- * Sets The HTTP client used to send the request.
- *
- * @param httpClient the httpClient value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder httpClient(HttpClient httpClient) {
- this.httpClient = httpClient;
- return this;
- }
-
- /*
- * The configuration store that is used during construction of the service
- * client.
- */
- private Configuration configuration;
-
- /**
- * Sets The configuration store that is used during construction of the service client.
- *
- * @param configuration the configuration value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder configuration(Configuration configuration) {
- this.configuration = configuration;
- return this;
- }
-
- /*
- * The logging configuration for HTTP requests and responses.
- */
- private HttpLogOptions httpLogOptions;
-
- /**
- * Sets The logging configuration for HTTP requests and responses.
- *
- * @param httpLogOptions the httpLogOptions value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
- this.httpLogOptions = httpLogOptions;
- return this;
- }
-
- /*
- * The retry policy that will attempt to retry failed requests, if
- * applicable.
- */
- private RetryPolicy retryPolicy;
-
- /**
- * Sets The retry policy that will attempt to retry failed requests, if applicable.
- *
- * @param retryPolicy the retryPolicy value.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder retryPolicy(RetryPolicy retryPolicy) {
- this.retryPolicy = retryPolicy;
- return this;
- }
-
- /*
- * The list of Http pipeline policies to add.
- */
- private final List pipelinePolicies;
-
- /**
- * Adds a custom Http pipeline policy.
- *
- * @param customPolicy The custom Http pipeline policy to add.
- * @return the CommunicationNetworkTraversalClientImplBuilder.
- */
- public CommunicationNetworkTraversalClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
- pipelinePolicies.add(customPolicy);
- return this;
- }
-
- /**
- * Builds an instance of CommunicationNetworkTraversalClientImpl with the provided parameters.
- *
- * @return an instance of CommunicationNetworkTraversalClientImpl.
- */
- public CommunicationNetworkTraversalClientImpl buildClient() {
- if (apiVersion == null) {
- this.apiVersion = "2022-02-01";
- }
- if (pipeline == null) {
- this.pipeline = createHttpPipeline();
- }
- if (serializerAdapter == null) {
- this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter();
- }
- CommunicationNetworkTraversalClientImpl client =
- new CommunicationNetworkTraversalClientImpl(pipeline, serializerAdapter, endpoint, apiVersion);
- return client;
- }
-
- private HttpPipeline createHttpPipeline() {
- Configuration buildConfiguration =
- (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
- if (httpLogOptions == null) {
- httpLogOptions = new HttpLogOptions();
- }
- List policies = new ArrayList<>();
- String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");
- String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");
- policies.add(
- new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration));
- HttpPolicyProviders.addBeforeRetryPolicies(policies);
- policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);
- policies.add(new CookiePolicy());
- policies.addAll(this.pipelinePolicies);
- HttpPolicyProviders.addAfterRetryPolicies(policies);
- policies.add(new HttpLoggingPolicy(httpLogOptions));
- HttpPipeline httpPipeline =
- new HttpPipelineBuilder()
- .policies(policies.toArray(new HttpPipelinePolicy[0]))
- .httpClient(httpClient)
- .build();
- return httpPipeline;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalsImpl.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalsImpl.java
deleted file mode 100644
index 18bfe261cf128..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/CommunicationNetworkTraversalsImpl.java
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation;
-
-import com.azure.communication.networktraversal.implementation.models.CommunicationErrorResponseException;
-import com.azure.communication.networktraversal.implementation.models.CommunicationRelayConfigurationRequest;
-import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
-import com.azure.core.annotation.BodyParam;
-import com.azure.core.annotation.ExpectedResponses;
-import com.azure.core.annotation.HeaderParam;
-import com.azure.core.annotation.Host;
-import com.azure.core.annotation.HostParam;
-import com.azure.core.annotation.Post;
-import com.azure.core.annotation.QueryParam;
-import com.azure.core.annotation.ReturnType;
-import com.azure.core.annotation.ServiceInterface;
-import com.azure.core.annotation.ServiceMethod;
-import com.azure.core.annotation.UnexpectedResponseExceptionType;
-import com.azure.core.http.rest.Response;
-import com.azure.core.http.rest.RestProxy;
-import com.azure.core.util.Context;
-import com.azure.core.util.FluxUtil;
-import reactor.core.publisher.Mono;
-
-/** An instance of this class provides access to all the operations defined in CommunicationNetworkTraversals. */
-public final class CommunicationNetworkTraversalsImpl {
- /** The proxy service used to perform REST calls. */
- private final CommunicationNetworkTraversalsService service;
-
- /** The service client containing this operation class. */
- private final CommunicationNetworkTraversalClientImpl client;
-
- /**
- * Initializes an instance of CommunicationNetworkTraversalsImpl.
- *
- * @param client the instance of the service client containing this operation class.
- */
- CommunicationNetworkTraversalsImpl(CommunicationNetworkTraversalClientImpl client) {
- this.service =
- RestProxy.create(
- CommunicationNetworkTraversalsService.class,
- client.getHttpPipeline(),
- client.getSerializerAdapter());
- this.client = client;
- }
-
- /**
- * The interface defining all the services for CommunicationNetworkTraversalClientCommunicationNetworkTraversals to
- * be used by the proxy service to perform REST calls.
- */
- @Host("{endpoint}")
- @ServiceInterface(name = "CommunicationNetwork")
- public interface CommunicationNetworkTraversalsService {
- @Post("/networkTraversal/:issueRelayConfiguration")
- @ExpectedResponses({200})
- @UnexpectedResponseExceptionType(CommunicationErrorResponseException.class)
- Mono> issueRelayConfiguration(
- @HostParam("endpoint") String endpoint,
- @QueryParam("api-version") String apiVersion,
- @BodyParam("application/json") CommunicationRelayConfigurationRequest body,
- @HeaderParam("Accept") String accept,
- Context context);
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> issueRelayConfigurationWithResponseAsync(
- CommunicationRelayConfigurationRequest body) {
- final String accept = "application/json";
- return FluxUtil.withContext(
- context ->
- service.issueRelayConfiguration(
- this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context));
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> issueRelayConfigurationWithResponseAsync(
- CommunicationRelayConfigurationRequest body, Context context) {
- final String accept = "application/json";
- return service.issueRelayConfiguration(
- this.client.getEndpoint(), this.client.getApiVersion(), body, accept, context);
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono issueRelayConfigurationAsync(
- CommunicationRelayConfigurationRequest body) {
- return issueRelayConfigurationWithResponseAsync(body)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Mono issueRelayConfigurationAsync(
- CommunicationRelayConfigurationRequest body, Context context) {
- return issueRelayConfigurationWithResponseAsync(body, context)
- .flatMap(
- (Response res) -> {
- if (res.getValue() != null) {
- return Mono.just(res.getValue());
- } else {
- return Mono.empty();
- }
- });
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public CommunicationRelayConfiguration issueRelayConfiguration(CommunicationRelayConfigurationRequest body) {
- return issueRelayConfigurationAsync(body).block();
- }
-
- /**
- * Issue a configuration for an STUN/TURN server.
- *
- * @param body Optional request for providing the id and/or route type for the returned relay configuration.
- * @param context The context to associate with this operation.
- * @throws IllegalArgumentException thrown if parameters fail the validation.
- * @throws CommunicationErrorResponseException thrown if the request is rejected by server.
- * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return a relay configuration containing the STUN/TURN URLs and credentials.
- */
- @ServiceMethod(returns = ReturnType.SINGLE)
- public Response issueRelayConfigurationWithResponse(
- CommunicationRelayConfigurationRequest body, Context context) {
- return issueRelayConfigurationWithResponseAsync(body, context).block();
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationError.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationError.java
deleted file mode 100644
index 56a4c608f0b34..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationError.java
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.List;
-
-/** The Communication Services error. */
-@Fluent
-public final class CommunicationError {
- /*
- * The error code.
- */
- @JsonProperty(value = "code", required = true)
- private String code;
-
- /*
- * The error message.
- */
- @JsonProperty(value = "message", required = true)
- private String message;
-
- /*
- * The error target.
- */
- @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY)
- private String target;
-
- /*
- * Further details about specific errors that led to this error.
- */
- @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY)
- private List details;
-
- /*
- * The inner error if any.
- */
- @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY)
- private CommunicationError innerError;
-
- /**
- * Get the code property: The error code.
- *
- * @return the code value.
- */
- public String getCode() {
- return this.code;
- }
-
- /**
- * Set the code property: The error code.
- *
- * @param code the code value to set.
- * @return the CommunicationError object itself.
- */
- public CommunicationError setCode(String code) {
- this.code = code;
- return this;
- }
-
- /**
- * Get the message property: The error message.
- *
- * @return the message value.
- */
- public String getMessage() {
- return this.message;
- }
-
- /**
- * Set the message property: The error message.
- *
- * @param message the message value to set.
- * @return the CommunicationError object itself.
- */
- public CommunicationError setMessage(String message) {
- this.message = message;
- return this;
- }
-
- /**
- * Get the target property: The error target.
- *
- * @return the target value.
- */
- public String getTarget() {
- return this.target;
- }
-
- /**
- * Get the details property: Further details about specific errors that led to this error.
- *
- * @return the details value.
- */
- public List getDetails() {
- return this.details;
- }
-
- /**
- * Get the innerError property: The inner error if any.
- *
- * @return the innerError value.
- */
- public CommunicationError getInnerError() {
- return this.innerError;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponse.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponse.java
deleted file mode 100644
index b871b3fcebc4f..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponse.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation.models;
-
-import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/** The Communication Services error. */
-@Fluent
-public final class CommunicationErrorResponse {
- /*
- * The Communication Services error.
- */
- @JsonProperty(value = "error", required = true)
- private CommunicationError error;
-
- /**
- * Get the error property: The Communication Services error.
- *
- * @return the error value.
- */
- public CommunicationError getError() {
- return this.error;
- }
-
- /**
- * Set the error property: The Communication Services error.
- *
- * @param error the error value to set.
- * @return the CommunicationErrorResponse object itself.
- */
- public CommunicationErrorResponse setError(CommunicationError error) {
- this.error = error;
- return this;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponseException.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponseException.java
deleted file mode 100644
index 34a49e99f931e..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationErrorResponseException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation.models;
-
-import com.azure.core.exception.HttpResponseException;
-import com.azure.core.http.HttpResponse;
-
-/** Exception thrown for an invalid response with CommunicationErrorResponse information. */
-public final class CommunicationErrorResponseException extends HttpResponseException {
- /**
- * Initializes a new instance of the CommunicationErrorResponseException class.
- *
- * @param message the exception message or the response content if a message is not available.
- * @param response the HTTP response.
- */
- public CommunicationErrorResponseException(String message, HttpResponse response) {
- super(message, response);
- }
-
- /**
- * Initializes a new instance of the CommunicationErrorResponseException class.
- *
- * @param message the exception message or the response content if a message is not available.
- * @param response the HTTP response.
- * @param value the deserialized response value.
- */
- public CommunicationErrorResponseException(
- String message, HttpResponse response, CommunicationErrorResponse value) {
- super(message, response, value);
- }
-
- @Override
- public CommunicationErrorResponse getValue() {
- return (CommunicationErrorResponse) super.getValue();
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationRelayConfigurationRequest.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationRelayConfigurationRequest.java
deleted file mode 100644
index ab3a1058bbc65..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/CommunicationRelayConfigurationRequest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.implementation.models;
-
-import com.azure.communication.networktraversal.models.RouteType;
-import com.azure.core.annotation.Fluent;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/** Request for a CommunicationRelayConfiguration. */
-@Fluent
-public final class CommunicationRelayConfigurationRequest {
- /*
- * An identity to be associated with telemetry for data relayed using the
- * returned credentials. Must be an existing ACS user identity. If not
- * provided, the telemetry will not contain an associated identity value.
- */
- @JsonProperty(value = "id")
- private String id;
-
- /*
- * Filter the routing methodology returned. If not provided, will return
- * all route types in separate ICE servers.
- */
- @JsonProperty(value = "routeType")
- private RouteType routeType;
-
- /**
- * Get the id property: An identity to be associated with telemetry for data relayed using the returned credentials.
- * Must be an existing ACS user identity. If not provided, the telemetry will not contain an associated identity
- * value.
- *
- * @return the id value.
- */
- public String getId() {
- return this.id;
- }
-
- /**
- * Set the id property: An identity to be associated with telemetry for data relayed using the returned credentials.
- * Must be an existing ACS user identity. If not provided, the telemetry will not contain an associated identity
- * value.
- *
- * @param id the id value to set.
- * @return the CommunicationRelayConfigurationRequest object itself.
- */
- public CommunicationRelayConfigurationRequest setId(String id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get the routeType property: Filter the routing methodology returned. If not provided, will return all route types
- * in separate ICE servers.
- *
- * @return the routeType value.
- */
- public RouteType getRouteType() {
- return this.routeType;
- }
-
- /**
- * Set the routeType property: Filter the routing methodology returned. If not provided, will return all route types
- * in separate ICE servers.
- *
- * @param routeType the routeType value to set.
- * @return the CommunicationRelayConfigurationRequest object itself.
- */
- public CommunicationRelayConfigurationRequest setRouteType(RouteType routeType) {
- this.routeType = routeType;
- return this;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/package-info.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/package-info.java
deleted file mode 100644
index d06843b641f66..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/models/package-info.java
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-/**
- * Package containing the data models for CommunicationNetworkTraversalClient. Azure Communication Network Traversal
- * Service.
- */
-package com.azure.communication.networktraversal.implementation.models;
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/package-info.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/package-info.java
deleted file mode 100644
index 31646a4dbe519..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/implementation/package-info.java
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-/**
- * Package containing the implementations for CommunicationNetworkTraversalClient. Azure Communication Network Traversal
- * Service.
- */
-package com.azure.communication.networktraversal.implementation;
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationIceServer.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationIceServer.java
deleted file mode 100644
index aa30b71c3a987..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationIceServer.java
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.models;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.List;
-
-/** An instance of a STUN/TURN server with credentials to be used for ICE negotiation. */
-public final class CommunicationIceServer {
- /*
- * List of STUN/TURN server URLs.
- */
- @JsonProperty(value = "urls", required = true)
- private List urls;
-
- /*
- * User account name which uniquely identifies the credentials.
- */
- @JsonProperty(value = "username", required = true)
- private String username;
-
- /*
- * Credential for the server.
- */
- @JsonProperty(value = "credential", required = true)
- private String credential;
-
- /*
- * The routing methodology to where the ICE server will be located from the
- * client. "any" will have higher reliability while "nearest" will have
- * lower latency. It is recommended to default to use the "any" routing
- * method unless there are specific scenarios which minimizing latency is
- * critical.
- */
- @JsonProperty(value = "routeType", required = true)
- private RouteType routeType;
-
- /**
- * Default constructor for CommunicationIceServer.
- */
- public CommunicationIceServer() {
- }
-
- /**
- * Get the urls property: List of STUN/TURN server URLs.
- *
- * @return the urls value.
- */
- public List getUrls() {
- return this.urls;
- }
-
- /**
- * Set the urls property: List of STUN/TURN server URLs.
- *
- * @param urls the urls value to set.
- * @return the CommunicationIceServer object itself.
- */
- CommunicationIceServer setUrls(List urls) {
- this.urls = urls;
- return this;
- }
-
- /**
- * Get the username property: User account name which uniquely identifies the credentials.
- *
- * @return the username value.
- */
- public String getUsername() {
- return this.username;
- }
-
- /**
- * Set the username property: User account name which uniquely identifies the credentials.
- *
- * @param username the username value to set.
- * @return the CommunicationIceServer object itself.
- */
- CommunicationIceServer setUsername(String username) {
- this.username = username;
- return this;
- }
-
- /**
- * Get the credential property: Credential for the server.
- *
- * @return the credential value.
- */
- public String getCredential() {
- return this.credential;
- }
-
- /**
- * Set the credential property: Credential for the server.
- *
- * @param credential the credential value to set.
- * @return the CommunicationIceServer object itself.
- */
- CommunicationIceServer setCredential(String credential) {
- this.credential = credential;
- return this;
- }
-
- /**
- * Get the routeType property: The routing methodology to where the ICE server will be located from the client.
- * "any" will have higher reliability while "nearest" will have lower latency. It is recommended to default to use
- * the "any" routing method unless there are specific scenarios which minimizing latency is critical.
- *
- * @return the routeType value.
- */
- public RouteType getRouteType() {
- return this.routeType;
- }
-
- /**
- * Set the routeType property: The routing methodology to where the ICE server will be located from the client.
- * "any" will have higher reliability while "nearest" will have lower latency. It is recommended to default to use
- * the "any" routing method unless there are specific scenarios which minimizing latency is critical.
- *
- * @param routeType the routeType value to set.
- * @return the CommunicationIceServer object itself.
- */
- CommunicationIceServer setRouteType(RouteType routeType) {
- this.routeType = routeType;
- return this;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationRelayConfiguration.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationRelayConfiguration.java
deleted file mode 100644
index aafd7802fa2f7..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/CommunicationRelayConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.models;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.time.OffsetDateTime;
-import java.util.List;
-
-/** A relay configuration containing the STUN/TURN URLs and credentials. */
-public final class CommunicationRelayConfiguration {
- /*
- * The date for which the username and credentials are not longer valid.
- * Will be 48 hours from request time.
- */
- @JsonProperty(value = "expiresOn", required = true)
- private OffsetDateTime expiresOn;
-
- /*
- * An array representing the credentials and the STUN/TURN server URLs for
- * use in ICE negotiations.
- */
- @JsonProperty(value = "iceServers", required = true)
- private List iceServers;
-
- /**
- * Default constructor for CommunicationRelayConfiguration.
- */
- public CommunicationRelayConfiguration() {
- }
-
- /**
- * Get the expiresOn property: The date for which the username and credentials are not longer valid. Will be 48
- * hours from request time.
- *
- * @return the expiresOn value.
- */
- public OffsetDateTime getExpiresOn() {
- return this.expiresOn;
- }
-
- /**
- * Set the expiresOn property: The date for which the username and credentials are not longer valid. Will be 48
- * hours from request time.
- *
- * @param expiresOn the expiresOn value to set.
- * @return the CommunicationRelayConfiguration object itself.
- */
- CommunicationRelayConfiguration setExpiresOn(OffsetDateTime expiresOn) {
- this.expiresOn = expiresOn;
- return this;
- }
-
- /**
- * Get the iceServers property: An array representing the credentials and the STUN/TURN server URLs for use in ICE
- * negotiations.
- *
- * @return the iceServers value.
- */
- public List getIceServers() {
- return this.iceServers;
- }
-
- /**
- * Set the iceServers property: An array representing the credentials and the STUN/TURN server URLs for use in ICE
- * negotiations.
- *
- * @param iceServers the iceServers value to set.
- * @return the CommunicationRelayConfiguration object itself.
- */
- CommunicationRelayConfiguration setIceServers(List iceServers) {
- this.iceServers = iceServers;
- return this;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/GetRelayConfigurationOptions.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/GetRelayConfigurationOptions.java
deleted file mode 100644
index 376606dca75d2..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/GetRelayConfigurationOptions.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.communication.networktraversal.models;
-
-import com.azure.communication.common.CommunicationUserIdentifier;
-
-/**
- * Additional options for getting a relay configuration.
- *
- */
-public final class GetRelayConfigurationOptions {
- private CommunicationUserIdentifier communicationUser;
- private RouteType routeType;
-
- /**
- * Default constructor for GetRelayConfigurationOptions.
- */
- public GetRelayConfigurationOptions() {
- }
-
- /**
- * Get the communicationUser property: The CommunicationUserIdentifier for whom to issue a token.
- *
- * @return the communicationUser value.
- */
- public CommunicationUserIdentifier getCommunicationUserIdentifier() {
- return this.communicationUser;
- }
-
- /**
- * Set the communicationUser property: The CommunicationUserIdentifier for whom to issue a token
- *
- * @param communicationUser the communicationUser value to set.
- * @return the GetRelayConfigurationOptions object itself.
- */
- public GetRelayConfigurationOptions setCommunicationUserIdentifier(CommunicationUserIdentifier communicationUser) {
- this.communicationUser = communicationUser;
- return this;
- }
-
- /**
- * Get the routeType property: The routing methodology to where the ICE server will be located from the client.
- *
- * @return the routeType value.
- */
- public RouteType getRouteType() {
- return this.routeType;
- }
-
- /**
- * Set the routeType property: The routing methodology to where the ICE server will be located from the client.
- *
- * @param routeType the routeType value to set.
- * @return the GetRelayConfigurationOptions object itself.
- */
- public GetRelayConfigurationOptions setRouteType(RouteType routeType) {
- this.routeType = routeType;
- return this;
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/RouteType.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/RouteType.java
deleted file mode 100644
index 56c2ee6d3ac8c..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/RouteType.java
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-package com.azure.communication.networktraversal.models;
-
-import com.azure.core.util.ExpandableStringEnum;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import java.util.Collection;
-
-/** Defines values for RouteType. */
-public final class RouteType extends ExpandableStringEnum {
- /**
- * Default constructor for RouteType.
- */
- public RouteType() {
- }
-
- /** Static value any for RouteType. */
- public static final RouteType ANY = fromString("any");
-
- /** Static value nearest for RouteType. */
- public static final RouteType NEAREST = fromString("nearest");
-
- /**
- * Creates or finds a RouteType from its string representation.
- *
- * @param name a name to look for.
- * @return the corresponding RouteType.
- */
- @JsonCreator
- public static RouteType fromString(String name) {
- return fromString(name, RouteType.class);
- }
-
- /**
- * Retrieve values collection
- *
- * @return known RouteType values.
- */
- public static Collection values() {
- return values(RouteType.class);
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/package-info.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/package-info.java
deleted file mode 100644
index 999f1a35ee87c..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/models/package-info.java
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-// Code generated by Microsoft (R) AutoRest Code Generator.
-
-/**
- * Package containing classes for CommunicationNetworkTraversalClient. Azure Communication Network Traversal Service.
- */
-package com.azure.communication.networktraversal.models;
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/package-info.java b/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/package-info.java
deleted file mode 100644
index cab9431d54978..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/com/azure/communication/networktraversal/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-/** Package containing the classes for AzureCommunicationNetworkTraversal. Azure Communication Networking Service. */
-package com.azure.communication.networktraversal;
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/java/module-info.java b/sdk/communication/azure-communication-networktraversal/src/main/java/module-info.java
deleted file mode 100644
index 1b246546856c0..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/java/module-info.java
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-module com.azure.communication.networktraversal {
-
- requires transitive com.azure.communication.common;
-
- // public API surface area
- exports com.azure.communication.networktraversal;
- exports com.azure.communication.networktraversal.models;
-
- opens com.azure.communication.networktraversal.models
- to com.fasterxml.jackson.databind;
- opens com.azure.communication.networktraversal.implementation.models
- to com.fasterxml.jackson.databind, com.azure.core;
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/main/resources/azure-communication-networktraversal.properties b/sdk/communication/azure-communication-networktraversal/src/main/resources/azure-communication-networktraversal.properties
deleted file mode 100644
index ca812989b4f27..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/main/resources/azure-communication-networktraversal.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-name=${project.artifactId}
-version=${project.version}
diff --git a/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/CreateAndIssueRelayCredentialsExample.java b/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/CreateAndIssueRelayCredentialsExample.java
deleted file mode 100644
index 3b6169d0f5534..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/CreateAndIssueRelayCredentialsExample.java
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal;
-
-import com.azure.communication.common.CommunicationUserIdentifier;
-import com.azure.communication.identity.CommunicationIdentityClient;
-import com.azure.communication.identity.CommunicationIdentityClientBuilder;
-import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
-import com.azure.communication.networktraversal.models.CommunicationIceServer;
-import com.azure.communication.networktraversal.models.GetRelayConfigurationOptions;
-import java.util.List;
-
-/**
- * Shows how to get a CommunicationUserIdentifier using CommunicationIdentityClient
- * to later return a relay configuration using CommunicationRelayConfiguration
- *
- * It iterates over the lis of CommunicationIceServer to print the urls, username and credential
- */
-public class CreateAndIssueRelayCredentialsExample {
- public static void main(String[] args) {
- String connectionString = System.getenv("COMMUNICATION_SAMPLES_CONNECTION_STRING");
- CommunicationIdentityClient communicationIdentityClient = new CommunicationIdentityClientBuilder()
- .connectionString(connectionString)
- .buildClient();
-
- CommunicationRelayClient communicationRelayClient = new CommunicationRelayClientBuilder()
- .connectionString(connectionString)
- .buildClient();
-
- CommunicationUserIdentifier user = communicationIdentityClient.createUser();
- System.out.println("User id: " + user.getId());
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- // Define a list of communication token scopes
- CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(options);
-
- System.out.println("Expires on:" + config.getExpiresOn());
- List iceServers = config.getIceServers();
-
- for (CommunicationIceServer iceS : iceServers) {
- System.out.println("URLS: " + iceS.getUrls());
- System.out.println("Username: " + iceS.getUsername());
- System.out.println("credential: " + iceS.getCredential());
- }
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/ReadmeSamples.java b/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/ReadmeSamples.java
deleted file mode 100644
index 6d23b684b28be..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/samples/java/com/azure/communication/networktraversal/ReadmeSamples.java
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal;
-
-import com.azure.communication.common.CommunicationUserIdentifier;
-import com.azure.core.credential.AzureKeyCredential;
-import com.azure.identity.DefaultAzureCredentialBuilder;
-import com.azure.communication.identity.CommunicationIdentityClient;
-import com.azure.communication.identity.CommunicationIdentityClientBuilder;
-import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
-import com.azure.communication.networktraversal.models.RouteType;
-import com.azure.communication.networktraversal.models.CommunicationIceServer;
-import com.azure.communication.networktraversal.models.GetRelayConfigurationOptions;
-import java.util.List;
-
-public class ReadmeSamples {
- /**
- * Sample code for creating a sync Communication Identity Client.
- *
- * @return the Communication Identity Client.
- */
- public CommunicationIdentityClient createCommunicationIdentityClient() {
- // You can find your endpoint and access key from your resource in the Azure Portal
- String endpoint = "https://.communication.azure.com";
- AzureKeyCredential keyCredential = new AzureKeyCredential("");
-
- CommunicationIdentityClient communicationIdentityClient = new CommunicationIdentityClientBuilder()
- .endpoint(endpoint)
- .credential(keyCredential)
- .buildClient();
-
- return communicationIdentityClient;
- }
-
- /**
- * Sample code for creating a sync Communication Network Traversal Client.
- *
- * @return the Communication Relay Client.
- */
- public CommunicationRelayClient createCommunicationNetworkTraversalClient() {
- // BEGIN: readme-sample-createCommunicationNetworkTraversalClient
- // You can find your endpoint and access key from your resource in the Azure Portal
- String endpoint = "https://.communication.azure.com";
- AzureKeyCredential keyCredential = new AzureKeyCredential("");
-
- CommunicationRelayClient communicationRelayClient = new CommunicationRelayClientBuilder()
- .endpoint(endpoint)
- .credential(keyCredential)
- .buildClient();
- // END: readme-sample-createCommunicationNetworkTraversalClient
-
- return communicationRelayClient;
- }
-
- /**
- * Sample code for creating a Relay Client Builder
- *
- * @return the Communication Relay Client Builder
- */
- public CommunicationRelayClientBuilder createCommunicationNetworkTraversalClientBuilder() {
- // BEGIN: readme-sample-createCommunicationNetworkTraversalClientBuilder
- // You can find your endpoint and access key from your resource in the Azure Portal
- String endpoint = "https://.communication.azure.com";
- AzureKeyCredential keyCredential = new AzureKeyCredential("");
-
- CommunicationRelayClientBuilder communicationRelayClientBuilder = new CommunicationRelayClientBuilder()
- .endpoint(endpoint)
- .credential(keyCredential);
- // END: readme-sample-createCommunicationNetworkTraversalClientBuilder
-
- return communicationRelayClientBuilder;
- }
-
- /**
- * Sample code for creating a sync Communication Network Traversal Client.
- *
- * @return the Communication Relay Async Client.
- */
- public CommunicationRelayAsyncClient createCommunicationNetworkTraversalAsyncClient() {
- // BEGIN: readme-sample-createCommunicationNetworkTraversalAsyncClient
- // You can find your endpoint and access key from your resource in the Azure Portal
- String endpoint = "https://.communication.azure.com";
- AzureKeyCredential keyCredential = new AzureKeyCredential("");
-
- CommunicationRelayAsyncClient communicationRelayClient = new CommunicationRelayClientBuilder()
- .endpoint(endpoint)
- .credential(keyCredential)
- .buildAsyncClient();
- // END: readme-sample-createCommunicationNetworkTraversalAsyncClient
-
- return communicationRelayClient;
- }
-
- /**
- * Sample code for creating a sync Communication Relay Client using connection string.
- *
- * @return the Communication Relay Client.
- */
- public CommunicationRelayClient createCommunicationRelayClientWithConnectionString() {
- // BEGIN: readme-sample-createCommunicationRelayClientWithConnectionString
- // You can find your connection string from your resource in the Azure Portal
- String connectionString = "";
-
- CommunicationRelayClient communicationRelayClient = new CommunicationRelayClientBuilder()
- .connectionString(connectionString)
- .buildClient();
- // END: readme-sample-createCommunicationRelayClientWithConnectionString
-
- return communicationRelayClient;
- }
-
- /**
- * Sample code for creating a sync Communication Relay Client using AAD authentication.
- *
- * @return the Communication Relay Client.
- */
- public CommunicationRelayClient createCommunicationRelayClientWithAAD() {
- // BEGIN: readme-sample-createCommunicationRelayClientWithAAD
- // You can find your endpoint and access key from your resource in the Azure Portal
- String endpoint = "https://.communication.azure.com";
-
- CommunicationRelayClient communicationRelayClient = new CommunicationRelayClientBuilder()
- .endpoint(endpoint)
- .credential(new DefaultAzureCredentialBuilder().build())
- .buildClient();
- // END: readme-sample-createCommunicationRelayClientWithAAD
-
- return communicationRelayClient;
- }
-
- /**
- * Sample code for getting a relay configuration
- *
- * @return the created user
- */
- public CommunicationRelayConfiguration getRelayConfiguration() {
- // BEGIN: readme-sample-getRelayConfiguration
- CommunicationIdentityClient communicationIdentityClient = createCommunicationIdentityClient();
-
- CommunicationUserIdentifier user = communicationIdentityClient.createUser();
- System.out.println("User id: " + user.getId());
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
- CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(options);
-
- System.out.println("Expires on:" + config.getExpiresOn());
- List iceServers = config.getIceServers();
-
- for (CommunicationIceServer iceS : iceServers) {
- System.out.println("URLS: " + iceS.getUrls());
- System.out.println("Username: " + iceS.getUsername());
- System.out.println("Credential: " + iceS.getCredential());
- System.out.println("RouteType: " + iceS.getRouteType());
- }
- // END: readme-sample-getRelayConfiguration
- return config;
- }
-
- /**
- * Sample code for getting a relay configuration without identity
- *
- * @return the created user
- */
- public CommunicationRelayConfiguration getRelayConfigurationWithoutIdentity() {
- // BEGIN: readme-sample-getRelayConfigurationWithoutIdentity
- CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
- CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration();
-
- System.out.println("Expires on:" + config.getExpiresOn());
- List iceServers = config.getIceServers();
-
- for (CommunicationIceServer iceS : iceServers) {
- System.out.println("URLS: " + iceS.getUrls());
- System.out.println("Username: " + iceS.getUsername());
- System.out.println("Credential: " + iceS.getCredential());
- System.out.println("RouteType: " + iceS.getRouteType());
- }
- // END: readme-sample-getRelayConfigurationWithoutIdentity
- return config;
- }
-
- /**
- * Sample code for getting a relay configuration providing RouteType
- *
- * @return the created user
- */
- public CommunicationRelayConfiguration getRelayConfigurationWithRouteType() {
- // BEGIN: readme-sample-getRelayConfigurationWithRouteType
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setRouteType(RouteType.ANY);
-
- CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
- CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(options);
-
- System.out.println("Expires on:" + config.getExpiresOn());
- List iceServers = config.getIceServers();
-
- for (CommunicationIceServer iceS : iceServers) {
- System.out.println("URLS: " + iceS.getUrls());
- System.out.println("Username: " + iceS.getUsername());
- System.out.println("Credential: " + iceS.getCredential());
- System.out.println("RouteType: " + iceS.getRouteType());
- }
- // END: readme-sample-getRelayConfigurationWithRouteType
- return config;
- }
-
- /**
- * Sample code for troubleshooting
- */
- public void createUserTroubleshooting() {
- CommunicationIdentityClient communicationIdentityClient = createCommunicationIdentityClient();
-
- // BEGIN: readme-sample-createUserTroubleshooting
- try {
- CommunicationUserIdentifier user = communicationIdentityClient.createUser();
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- CommunicationRelayClient communicationRelayClient = createCommunicationNetworkTraversalClient();
- CommunicationRelayConfiguration config = communicationRelayClient.getRelayConfiguration(options);
- } catch (RuntimeException ex) {
- System.out.println(ex.getMessage());
- }
- // END: readme-sample-createUserTroubleshooting
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayAsyncTests.java b/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayAsyncTests.java
deleted file mode 100644
index 4519f202e6805..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayAsyncTests.java
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-import com.azure.communication.common.CommunicationUserIdentifier;
-import com.azure.communication.identity.CommunicationIdentityClient;
-import com.azure.communication.identity.CommunicationIdentityServiceVersion;
-import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
-import com.azure.communication.networktraversal.models.RouteType;
-import com.azure.communication.networktraversal.models.CommunicationIceServer;
-import com.azure.communication.networktraversal.models.GetRelayConfigurationOptions;
-
-import com.azure.core.http.HttpClient;
-import com.azure.core.http.rest.Response;
-
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.MethodSource;
-
-import reactor.core.publisher.Mono;
-import reactor.test.StepVerifier;
-
-public class CommunicationRelayAsyncTests extends CommunicationRelayClientTestBase {
- private CommunicationRelayAsyncClient asyncClient;
- private CommunicationUserIdentifier user;
-
- private void setupTest(HttpClient httpClient) {
- CommunicationIdentityClient communicationIdentityClient = createIdentityClientBuilder(httpClient).serviceVersion(CommunicationIdentityServiceVersion.V2022_10_01).buildClient();
- user = communicationIdentityClient.createUser();
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingManagedIdentity(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- asyncClient = setupAsyncClient(builder, "createRelayClientUsingManagedIdentityAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
- assertNotNull(user.getId());
-
- if (user != null) {
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- Mono relayResponse = asyncClient.getRelayConfiguration(options);
-
- StepVerifier.create(relayResponse)
- .assertNext(relayConfig -> {
- assertNotNull(relayConfig.getIceServers());
- for (CommunicationIceServer iceS : relayConfig.getIceServers()) {
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- }).verifyComplete();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientWithoutUserIdUsingManagedIdentity(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- asyncClient = setupAsyncClient(builder, "createRelayClientUsingManagedIdentityAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
-
- if (user != null) {
- Mono relayResponse = asyncClient.getRelayConfiguration();
-
- StepVerifier.create(relayResponse)
- .assertNext(relayConfig -> {
- assertNotNull(relayConfig.getIceServers());
- for (CommunicationIceServer iceS : relayConfig.getIceServers()) {
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- }).verifyComplete();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingManagedIdentityWithRouteTypeAny(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- asyncClient = setupAsyncClient(builder, "createRelayClientUsingManagedIdentityAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
- assertNotNull(user.getId());
-
- if (user != null) {
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- options.setRouteType(RouteType.ANY);
-
- Mono relayResponse = asyncClient.getRelayConfiguration(options);
-
- StepVerifier.create(relayResponse)
- .assertNext(relayConfig -> {
- assertNotNull(relayConfig.getIceServers());
- for (CommunicationIceServer iceS : relayConfig.getIceServers()) {
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertEquals(RouteType.ANY, iceS.getRouteType());
- }
- }).verifyComplete();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingConnectionString(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingConnectionString(httpClient);
- asyncClient = setupAsyncClient(builder, "createIdentityClientUsingConnectionStringAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
- assertNotNull(user.getId());
- if (user != null) {
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- Mono relayResponse = asyncClient.getRelayConfiguration(options);
-
- StepVerifier.create(relayResponse)
- .assertNext(relayConfig -> {
- assertNotNull(relayConfig.getIceServers());
- for (CommunicationIceServer iceS : relayConfig.getIceServers()) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- }).verifyComplete();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientWithoutUserIdUsingConnectionString(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingConnectionString(httpClient);
- asyncClient = setupAsyncClient(builder, "createIdentityClientUsingConnectionStringAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
- if (user != null) {
- Mono relayResponse = asyncClient.getRelayConfiguration();
-
- StepVerifier.create(relayResponse)
- .assertNext(relayConfig -> {
- assertNotNull(relayConfig.getIceServers());
- for (CommunicationIceServer iceS : relayConfig.getIceServers()) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- }).verifyComplete();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void getRelayConfigWithResponseWithRouteTypeNearest(HttpClient httpClient) {
- // Arrange
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- asyncClient = setupAsyncClient(builder, "createRelayClientUsingManagedIdentityAsync");
-
- // Action & Assert
- assertNotNull(asyncClient);
- assertNotNull(user.getId());
-
- if (user != null) {
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- options.setRouteType(RouteType.NEAREST);
-
- Mono> relayConfig = asyncClient.getRelayConfigurationWithResponse(options, null);
-
- StepVerifier.create(relayConfig)
- .assertNext(response -> {
- assertEquals(200, response.getStatusCode(), "Expect status code to be 200");
- assertNotNull(response.getValue().getIceServers());
- for (CommunicationIceServer iceS : response.getValue().getIceServers()) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertEquals(RouteType.NEAREST, iceS.getRouteType());
- }
- }).verifyComplete();
- }
- }
-
- private CommunicationRelayAsyncClient setupAsyncClient(CommunicationRelayClientBuilder builder, String testName) {
- return addLoggingPolicy(builder, testName).buildAsyncClient();
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayBuilderTests.java b/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayBuilderTests.java
deleted file mode 100644
index 8b191e8e5889d..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayBuilderTests.java
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal;
-
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.net.MalformedURLException;
-import java.security.InvalidKeyException;
-import java.security.NoSuchAlgorithmException;
-import java.util.Map;
-
-import com.azure.communication.networktraversal.implementation.CommunicationRelayResponseMocker;
-import com.azure.core.credential.AzureKeyCredential;
-import com.azure.core.http.HttpClient;
-import com.azure.core.http.HttpRequest;
-import com.azure.core.http.HttpResponse;
-import com.azure.core.http.policy.ExponentialBackoffOptions;
-import com.azure.core.http.policy.HttpLogOptions;
-import com.azure.core.http.policy.RetryOptions;
-import com.azure.core.http.policy.RetryPolicy;
-import com.azure.core.util.ClientOptions;
-
-import org.junit.jupiter.api.Test;
-
-import reactor.core.publisher.Mono;
-
-public class CommunicationRelayBuilderTests {
- static final String MOCK_URL = "https://REDACTED.communication.azure.com";
- static final String MOCK_ACCESS_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaGfQSflKxwRJSMeKKF2QT4fwpMeJf36POk6yJVadQssw5c";
- static final String MOCK_CONNECTION_STRING = "endpoint=https://REDACTED.communication.azure.com/;accesskey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaGfQSflKxwRJSMeKKF2QT4fwpMeJf36POk6yJVadQssw5c";
-
- static class NoOpHttpClient implements HttpClient {
- @Override
- public Mono send(HttpRequest request) {
- return Mono.empty(); // NOP
- }
- }
-
- private final CommunicationRelayClientBuilder builder = new CommunicationRelayClientBuilder();
-
- @Test
- public void buildAsyncClientTest() {
- builder
- .endpoint(MOCK_URL)
- .credential(new AzureKeyCredential(MOCK_ACCESS_KEY))
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- });
- CommunicationRelayAsyncClient asyncClient = builder.buildAsyncClient();
- assertNotNull(asyncClient);
- }
-
- @Test
- public void buildSyncClientTest() {
- builder
- .endpoint(MOCK_URL)
- .credential(new AzureKeyCredential(MOCK_ACCESS_KEY))
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- });
- CommunicationRelayClient syncClient = builder.buildClient();
- assertNotNull(syncClient);
- }
-
- @Test
- public void buildAsyncClientTestUsingConnectionString() {
- builder
- .connectionString(MOCK_CONNECTION_STRING)
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
-
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- });
- CommunicationRelayAsyncClient asyncClient = builder.buildAsyncClient();
- assertNotNull(asyncClient);
- }
-
- @Test
- public void buildAsyncClientTestUsingConnectionStringAndClientOptions() {
- builder
- .connectionString(MOCK_CONNECTION_STRING)
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- });
- CommunicationRelayAsyncClient asyncClient = builder
- .clientOptions(new ClientOptions().setApplicationId("testApplicationId"))
- .buildAsyncClient();
- assertNotNull(asyncClient);
- }
-
- @Test
- public void buildAsyncClientTestUsingConnectionStringAndHttpLogOptions() {
- builder
- .connectionString(MOCK_CONNECTION_STRING)
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- });
- CommunicationRelayAsyncClient asyncClient = builder
- .httpLogOptions(new HttpLogOptions().setApplicationId("testApplicationId"))
- .buildAsyncClient();
- assertNotNull(asyncClient);
- }
-
- @Test
- public void createClientWithNoTokenCredentialThrows()
- throws NullPointerException, MalformedURLException, InvalidKeyException, NoSuchAlgorithmException {
- builder
- .endpoint(MOCK_URL)
- .httpClient(new NoOpHttpClient());
- assertThrows(Exception.class, () -> {
- builder.buildAsyncClient();
- });
- }
-
- @Test
- public void createClientWithNoUrlThrows()
- throws NullPointerException, MalformedURLException {
- builder
- .credential(new AzureKeyCredential(MOCK_ACCESS_KEY))
- .httpClient(new NoOpHttpClient());
- assertThrows(Exception.class, () -> {
- builder.buildAsyncClient();
- });
- }
-
- @Test
- public void nullTokenTest() {
- assertThrows(NullPointerException.class, () -> {
- builder.buildAsyncClient();
- });
- }
-
- @Test
- public void bothRetryOptionsAndRetryPolicySetSync() {
- assertThrows(IllegalStateException.class, () -> builder
- .endpoint(MOCK_URL)
- .credential(new AzureKeyCredential(MOCK_ACCESS_KEY))
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- })
- .retryOptions(new RetryOptions(new ExponentialBackoffOptions()))
- .retryPolicy(new RetryPolicy())
- .buildClient());
- }
-
- @Test
- public void bothRetryOptionsAndRetryPolicySetSyncAsync() {
- assertThrows(IllegalStateException.class, () -> builder
- .endpoint(MOCK_URL)
- .credential(new AzureKeyCredential(MOCK_ACCESS_KEY))
- .httpClient(new NoOpHttpClient() {
- @Override
- public Mono send(HttpRequest request) {
- Map headers = request.getHeaders().toMap();
- assertHMACHeadersExist(headers);
- return Mono.just(CommunicationRelayResponseMocker.createUserResult(request));
- }
- })
- .retryOptions(new RetryOptions(new ExponentialBackoffOptions()))
- .retryPolicy(new RetryPolicy())
- .buildAsyncClient());
- }
-
- private void assertHMACHeadersExist(Map headers) {
- assertTrue(headers.containsKey("Authorization"));
- assertTrue(headers.containsKey("x-ms-content-sha256"));
- assertNotNull(headers.get("Authorization"));
- assertNotNull(headers.get("x-ms-content-sha256"));
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayClientTestBase.java b/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayClientTestBase.java
deleted file mode 100644
index 880f9c55e321c..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayClientTestBase.java
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-package com.azure.communication.networktraversal;
-
-import com.azure.communication.common.implementation.CommunicationConnectionString;
-import com.azure.communication.identity.CommunicationIdentityClientBuilder;
-import com.azure.core.credential.AzureKeyCredential;
-import com.azure.core.http.HttpClient;
-import com.azure.core.http.HttpPipelineNextPolicy;
-import com.azure.core.http.HttpResponse;
-import com.azure.core.test.TestMode;
-import com.azure.core.test.TestProxyTestBase;
-import com.azure.core.test.models.CustomMatcher;
-import com.azure.core.test.models.TestProxySanitizer;
-import com.azure.core.test.models.TestProxySanitizerType;
-import com.azure.core.test.utils.MockTokenCredential;
-import com.azure.core.util.Configuration;
-import com.azure.core.util.UrlBuilder;
-import com.azure.identity.DefaultAzureCredentialBuilder;
-import reactor.core.publisher.Mono;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-public class CommunicationRelayClientTestBase extends TestProxyTestBase {
- protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration()
- .get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5");
-
- private static final List JSON_PROPERTIES_TO_REDACT
- = new ArrayList<>(Arrays.asList("token", "id", "credential"));
- private static List addBodyKeySanitizer() {
- return JSON_PROPERTIES_TO_REDACT.stream().map(key -> new TestProxySanitizer(String.format("$..%s", key), null,
- "REDACTED",
- TestProxySanitizerType.BODY_KEY)).collect(Collectors.toList());
- }
-
- protected CommunicationRelayClientBuilder createClientBuilder(HttpClient httpClient) {
- CommunicationRelayClientBuilder builder = new CommunicationRelayClientBuilder();
- builder.addPolicy((context, next) -> {
- try {
- URL url = context.getHttpRequest().getUrl();
- URL updatedUrl = UrlBuilder.parse(url).setQueryParameter("api-version", "2022-03-01-preview").toUrl();
- context.getHttpRequest().setUrl(updatedUrl);
- return next.process();
- } catch (MalformedURLException e) {
- throw new RuntimeException(e);
- }
- });
-
- CommunicationConnectionString communicationConnectionString = new CommunicationConnectionString(CONNECTION_STRING);
- String communicationEndpoint = communicationConnectionString.getEndpoint();
- String communicationAccessKey = communicationConnectionString.getAccessKey();
-
- builder.endpoint(communicationEndpoint)
- .credential(new AzureKeyCredential(communicationAccessKey))
- .httpClient(httpClient == null ? interceptorManager.getPlaybackClient() : httpClient);
-
- if (getTestMode() == TestMode.RECORD) {
- builder.addPolicy(interceptorManager.getRecordPolicy());
- }
- addSanitizersAndMatchers();
- return builder;
- }
-
- protected CommunicationRelayClientBuilder createClientBuilderUsingManagedIdentity(HttpClient httpClient) {
- CommunicationRelayClientBuilder builder = new CommunicationRelayClientBuilder();
- builder.addPolicy((context, next) -> {
- try {
- URL url = context.getHttpRequest().getUrl();
- URL updatedUrl = UrlBuilder.parse(url).setQueryParameter("api-version", "2022-03-01-preview").toUrl();
- context.getHttpRequest().setUrl(updatedUrl);
- return next.process();
- } catch (MalformedURLException e) {
- throw new RuntimeException(e);
- }
- });
-
- CommunicationConnectionString communicationConnectionString = new CommunicationConnectionString(CONNECTION_STRING);
- String communicationEndpoint = communicationConnectionString.getEndpoint();
-
- builder
- .endpoint(communicationEndpoint)
- .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient);
-
- if (getTestMode() == TestMode.PLAYBACK) {
- builder.credential(new MockTokenCredential());
- } else {
- builder.credential(new DefaultAzureCredentialBuilder().build());
- }
-
- if (getTestMode() == TestMode.RECORD) {
- builder.addPolicy(interceptorManager.getRecordPolicy());
- }
- addSanitizersAndMatchers();
- return builder;
- }
-
- protected CommunicationRelayClientBuilder createClientBuilderUsingConnectionString(HttpClient httpClient) {
- CommunicationRelayClientBuilder builder = new CommunicationRelayClientBuilder();
- builder.addPolicy((context, next) -> {
- try {
- URL url = context.getHttpRequest().getUrl();
- URL updatedUrl = UrlBuilder.parse(url).setQueryParameter("api-version", "2022-03-01-preview").toUrl();
- context.getHttpRequest().setUrl(updatedUrl);
- return next.process();
- } catch (MalformedURLException e) {
- throw new RuntimeException(e);
- }
- });
-
- builder
- .connectionString(CONNECTION_STRING)
- .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient);
-
- if (getTestMode() == TestMode.RECORD) {
- builder.addPolicy(interceptorManager.getRecordPolicy());
- }
- addSanitizersAndMatchers();
- return builder;
- }
-
- protected CommunicationIdentityClientBuilder createIdentityClientBuilder(HttpClient httpClient) {
- CommunicationIdentityClientBuilder builder = new CommunicationIdentityClientBuilder();
- builder
- .connectionString(CONNECTION_STRING)
- .httpClient(interceptorManager.isPlaybackMode() ? interceptorManager.getPlaybackClient() : httpClient);
-
- if (getTestMode() == TestMode.RECORD) {
- builder.addPolicy(interceptorManager.getRecordPolicy());
- }
- addSanitizersAndMatchers();
- return builder;
- }
-
- private void addSanitizersAndMatchers() {
- interceptorManager.addMatchers(Arrays.asList(new CustomMatcher().setHeadersKeyOnlyMatch(
- Arrays.asList("x-ms-hmac-string-to-sign-base64", "x-ms-content-sha", "x-ms-content-sha256"))));
- interceptorManager.addSanitizers(addBodyKeySanitizer());
- }
-
- protected CommunicationRelayClientBuilder addLoggingPolicy(CommunicationRelayClientBuilder builder, String testName) {
- return builder.addPolicy((context, next) -> logHeaders(testName, next));
- }
-
- private Mono logHeaders(String testName, HttpPipelineNextPolicy next) {
- return next.process()
- .flatMap(httpResponse -> {
- final HttpResponse bufferedResponse = httpResponse.buffer();
-
- // Should sanitize printed reponse url
- System.out.println("MS-CV header for " + testName + " request "
- + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
- return Mono.just(bufferedResponse);
- });
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayTests.java b/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayTests.java
deleted file mode 100644
index 5f82a2117e937..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/CommunicationRelayTests.java
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-
-import com.azure.communication.common.CommunicationUserIdentifier;
-import com.azure.communication.identity.CommunicationIdentityClient;
-import com.azure.communication.identity.CommunicationIdentityServiceVersion;
-import com.azure.communication.networktraversal.models.CommunicationRelayConfiguration;
-import com.azure.communication.networktraversal.models.RouteType;
-import com.azure.communication.networktraversal.models.CommunicationIceServer;
-import com.azure.communication.networktraversal.models.GetRelayConfigurationOptions;
-import com.azure.core.http.HttpClient;
-import com.azure.core.http.rest.Response;
-import com.azure.core.util.Context;
-
-import org.junit.jupiter.params.ParameterizedTest;
-import org.junit.jupiter.params.provider.MethodSource;
-import java.util.List;
-
-public class CommunicationRelayTests extends CommunicationRelayClientTestBase {
- private CommunicationRelayClient client;
- private CommunicationUserIdentifier user;
-
- @Override
- protected void afterTest() {
- super.afterTest();
- }
-
- private void setupTest(HttpClient httpClient) {
- CommunicationIdentityClient communicationIdentityClient = createIdentityClientBuilder(httpClient)
- .serviceVersion(CommunicationIdentityServiceVersion.V2022_10_01)
- .buildClient();
- user = communicationIdentityClient.createUser();
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingManagedIdentity(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- client = setupClient(builder, "createRelayClientUsingManagedIdentitySync");
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- // Action & Assert
- assertNotNull(client);
-
- CommunicationRelayConfiguration config = client.getRelayConfiguration(options);
- List iceServers = config.getIceServers();
-
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertNotNull(iceS.getRouteType());
- }
- } catch (Exception e) {
- System.out.println("Exception: " + e);
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientWithoutUserIdUsingManagedIdentity(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- client = setupClient(builder, "createRelayClientUsingManagedIdentitySync");
-
- // Action & Assert
- assertNotNull(client);
- CommunicationRelayConfiguration config = client.getRelayConfiguration();
- List iceServers = config.getIceServers();
-
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- } catch (Exception e) {
- System.out.println("Exception: " + e);
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingManagedIdentityWithRouteTypeAny(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingManagedIdentity(httpClient);
- client = setupClient(builder, "createRelayClientUsingManagedIdentitySync");
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- options.setRouteType(RouteType.ANY);
-
- // Action & Assert
- assertNotNull(client);
-
- CommunicationRelayConfiguration config = client.getRelayConfiguration(options);
- List iceServers = config.getIceServers();
-
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertEquals(RouteType.ANY, iceS.getRouteType());
- }
- } catch (Exception e) {
- System.out.println("Exception: " + e);
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingConnectionString(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingConnectionString(httpClient);
- client = setupClient(builder, "createIdentityClientUsingConnectionStringSync");
- assertNotNull(client);
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
-
- CommunicationRelayConfiguration config = client.getRelayConfiguration(options);
-
- // Action & Assert
- List iceServers = config.getIceServers();
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertNotNull(iceS.getRouteType());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientWithoutUserIdUsingConnectionString(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingConnectionString(httpClient);
- client = setupClient(builder, "createIdentityClientUsingConnectionStringSync");
- assertNotNull(client);
- CommunicationRelayConfiguration config = client.getRelayConfiguration();
-
- // Action & Assert
- List iceServers = config.getIceServers();
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void createRelayClientUsingConnectionStringWithRouteTypeNearest(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilderUsingConnectionString(httpClient);
- client = setupClient(builder, "createIdentityClientUsingConnectionStringSync");
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- options.setRouteType(RouteType.NEAREST);
-
- CommunicationRelayConfiguration config = client.getRelayConfiguration(options);
-
- // Action & Assert
- assertNotNull(client);
-
- List iceServers = config.getIceServers();
- assertNotNull(config);
- assertNotNull(config.getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertEquals(RouteType.NEAREST, iceS.getRouteType());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @ParameterizedTest
- @MethodSource("com.azure.core.test.TestBase#getHttpClients")
- public void getRelayConfigWithResponseWithRouteTypeNearest(HttpClient httpClient) {
- // Arrange
- try {
- setupTest(httpClient);
- CommunicationRelayClientBuilder builder = createClientBuilder(httpClient);
- client = setupClient(builder, "getRelayConfigWithResponse");
- Response response;
-
- GetRelayConfigurationOptions options = new GetRelayConfigurationOptions();
- options.setCommunicationUserIdentifier(user);
- options.setRouteType(RouteType.NEAREST);
-
- // Action & Assert
- response = client.getRelayConfigurationWithResponse(options, Context.NONE);
- List iceServers = response.getValue().getIceServers();
-
- assertNotNull(response.getValue());
- assertEquals(200, response.getStatusCode(), "Expect status code to be 200");
- assertNotNull(response.getValue().getExpiresOn());
-
- for (CommunicationIceServer iceS : iceServers) {
- assertNotNull(iceS.getUrls());
- assertNotNull(iceS.getUsername());
- assertNotNull(iceS.getCredential());
- assertEquals(RouteType.NEAREST, iceS.getRouteType());
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private CommunicationRelayClient setupClient(CommunicationRelayClientBuilder builder, String testName) {
- return addLoggingPolicy(builder, testName).buildClient();
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/implementation/CommunicationRelayResponseMocker.java b/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/implementation/CommunicationRelayResponseMocker.java
deleted file mode 100644
index 21eee6f48b800..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/src/test/java/com/azure/communication/networktraversal/implementation/CommunicationRelayResponseMocker.java
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-package com.azure.communication.networktraversal.implementation;
-
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-
-import com.azure.core.http.HttpHeaders;
-import com.azure.core.http.HttpRequest;
-import com.azure.core.http.HttpResponse;
-
-import reactor.core.publisher.Flux;
-import reactor.core.publisher.Mono;
-
-public class CommunicationRelayResponseMocker {
-
- public static HttpResponse createUserResult(HttpRequest request) {
- String body = String.format("{\"id\": \"Sanitized\"}");
- return generateMockResponse(body, request, 200);
- }
-
- public static HttpResponse deleteUserResult(HttpRequest request) {
- return generateMockResponse("", request, 200);
- }
-
- public static HttpResponse revokeTokenResult(HttpRequest request) {
- return generateMockResponse("", request, 200);
- }
-
- public static HttpResponse getTokenResult(HttpRequest request) {
- String body = String.format("{\"id\": \"Sanitized\",\n"
- + "\"token\": \"Sanitized\",\n"
- + "\"expiresOn\": \"2020-08-14T17:37:34.4564877-07:00\"}");
-
- return generateMockResponse(body, request, 200);
- }
-
- public static HttpResponse generateMockResponse(String body, HttpRequest request, int statusCode) {
- return new HttpResponse(request) {
- @Override
- public int getStatusCode() {
- return statusCode;
- }
-
- @Override
- public String getHeaderValue(String name) {
- return null;
- }
-
- @Override
- public HttpHeaders getHeaders() {
- return new HttpHeaders();
- }
-
- @Override
- public Flux getBody() {
- return Flux.just(ByteBuffer.wrap(body.getBytes(StandardCharsets.UTF_8)));
- }
-
- @Override
- public Mono getBodyAsByteArray() {
- return Mono.just(body.getBytes(StandardCharsets.UTF_8));
- }
-
- @Override
- public Mono getBodyAsString() {
- return Mono.just(body);
- }
-
- @Override
- public Mono getBodyAsString(Charset charset) {
- return Mono.just(body);
- }
- };
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/swagger/README.md b/sdk/communication/azure-communication-networktraversal/swagger/README.md
deleted file mode 100644
index bdb481cc0f541..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/swagger/README.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Azure Communication Network Traversal library for Java
-
-> see https://aka.ms/autorest
-## Getting Started
-
-To build the SDK for Communication Network Traversal library, simply Install AutoRest and in this folder, run:
-
-### Setup
-```ps
-Fork and clone https://github.com/Azure/autorest.java
-git checkout main
-git submodule update --init --recursive
-mvn package -Dlocal
-npm install
-npm install -g autorest
-```
-
-### Generation
-
-```ps
-cd
-autorest README.md --java --v4 --use=@autorest/java@4.0.2
-```
-
-### Code generation settings
-``` yaml
-tag: package-2022-02-01
-require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6282e522ef78366170de518e76b8adb0e27563a2/specification/communication/data-plane/NetworkTraversal/readme.md
-java: true
-output-folder: ..\
-license-header: MICROSOFT_MIT_SMALL
-namespace: com.azure.communication.networktraversal
-generate-client-as-impl: true
-service-interface-as-public: true
-custom-types: CommunicationIceServer,CommunicationRelayConfiguration,RouteType
-custom-types-subpackage: models
-models-subpackage: implementation.models
-sync-methods: all
-add-context-parameter: true
-context-client-method-parameter: true
-customization-class: src/main/java/CommunicationRelayCustomization.java
-```
diff --git a/sdk/communication/azure-communication-networktraversal/swagger/pom.xml b/sdk/communication/azure-communication-networktraversal/swagger/pom.xml
deleted file mode 100644
index 0da32b2900531..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/swagger/pom.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- 4.0.0
-
-
- com.azure
- azure-code-customization-parent
- 1.0.0-beta.1
- ../../../parents/azure-code-customization-parent
-
-
- Microsoft Azure Communication Services Network Traversal client for Java
- This package contains client functionality for Microsoft Azure Communication Services Network Traversal
-
- com.azure.tools
- azure-communication-services-network-traversal
- 1.0.0-beta.1
- jar
-
diff --git a/sdk/communication/azure-communication-networktraversal/swagger/src/main/java/CommunicationRelayCustomization.java b/sdk/communication/azure-communication-networktraversal/swagger/src/main/java/CommunicationRelayCustomization.java
deleted file mode 100644
index 19374f8bbbf16..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/swagger/src/main/java/CommunicationRelayCustomization.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-import com.azure.autorest.customization.ClassCustomization;
-import com.azure.autorest.customization.Customization;
-import com.azure.autorest.customization.LibraryCustomization;
-import com.azure.autorest.customization.PackageCustomization;
-import java.lang.reflect.Modifier;
-import org.slf4j.Logger;
-
-public class CommunicationRelayCustomization extends Customization {
-
- @Override
- public void customize(LibraryCustomization libraryCustomization, Logger logger) {
- PackageCustomization models = libraryCustomization.getPackage("com.azure.communication.networktraversal.models");
- String modelToModify = "CommunicationIceServer";
-
- models.getClass(modelToModify).getMethod("setUrls").setModifier(0);
- models.getClass(modelToModify).getMethod("setUsername").setModifier(0);
- models.getClass(modelToModify).getMethod("setRouteType").setModifier(0);
- models.getClass(modelToModify).getMethod("setCredential").setModifier(0);
- models.getClass(modelToModify).removeAnnotation("Fluent");
-
- modelToModify = "CommunicationRelayConfiguration";
-
- models.getClass(modelToModify).getMethod("setExpiresOn").setModifier(0);
- models.getClass(modelToModify).getMethod("setIceServers").setModifier(0);
- models.getClass(modelToModify).removeAnnotation("Fluent");
- }
-}
diff --git a/sdk/communication/azure-communication-networktraversal/tests.yml b/sdk/communication/azure-communication-networktraversal/tests.yml
deleted file mode 100644
index 407ac8b620b13..0000000000000
--- a/sdk/communication/azure-communication-networktraversal/tests.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-trigger: none
-
-extends:
- template: /sdk/communication/communication-tests-template.yml
- parameters:
- PackageName: azure-communication-networktraversal
- SafeName: azurecommunicationnetworktraversal
- Clouds: 'Public'
diff --git a/sdk/communication/azure-communication-phonenumbers/pom.xml b/sdk/communication/azure-communication-phonenumbers/pom.xml
index f595b0db6c38e..29ef3727cd5af 100644
--- a/sdk/communication/azure-communication-phonenumbers/pom.xml
+++ b/sdk/communication/azure-communication-phonenumbers/pom.xml
@@ -63,7 +63,7 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
@@ -103,7 +103,7 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
@@ -129,19 +129,19 @@
com.azure
azure-core-http-okhttp
- 1.11.20
+ 1.11.21
test
com.azure
azure-core-http-vertx
- 1.0.0-beta.17
+ 1.0.0-beta.18
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
@@ -203,7 +203,7 @@
com.azure
azure-core-http-jdk-httpclient
- 1.0.0-beta.12
+ 1.0.0-beta.13
test
diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java
index 43789327783c4..15d95cadd7c3f 100644
--- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java
+++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java
@@ -16,12 +16,16 @@
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import com.azure.identity.DefaultAzureCredentialBuilder;
import reactor.core.publisher.Mono;
import java.util.Arrays;
public class PhoneNumbersIntegrationTestBase extends TestProxyTestBase {
+ private static final ClientLogger LOGGER = new ClientLogger(PhoneNumbersIntegrationTestBase.class);
+
private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration()
.get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING",
"endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5");
@@ -141,8 +145,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne
final HttpResponse bufferedResponse = httpResponse.buffer();
// Should sanitize printed reponse url
- System.out.println("MS-CV header for " + testName + " request "
- + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
+ LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request "
+ + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
return Mono.just(bufferedResponse);
});
}
diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java
index b74c96e538055..8d0b33036d340 100644
--- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java
+++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/siprouting/SipRoutingIntegrationTestBase.java
@@ -19,16 +19,20 @@
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import com.azure.identity.DefaultAzureCredentialBuilder;
import reactor.core.publisher.Mono;
import java.util.Arrays;
import java.util.List;
-import java.util.UUID;
import static java.util.Arrays.asList;
public class SipRoutingIntegrationTestBase extends TestProxyTestBase {
+ private static final ClientLogger LOGGER = new ClientLogger(SipRoutingIntegrationTestBase.class);
+
private static final String CONNECTION_STRING = Configuration.getGlobalConfiguration()
.get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5");
private static final String AZURE_TEST_DOMAIN = Configuration.getGlobalConfiguration()
@@ -192,7 +196,7 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne
final HttpResponse bufferedResponse = httpResponse.buffer();
// Should sanitize printed reponse url
- System.out.println("MS-CV header for " + testName + " request "
+ LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request "
+ bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
return Mono.just(bufferedResponse);
});
@@ -203,7 +207,7 @@ private static String getUniqueFqdn(String order) {
return order + ".redacted" + "." + AZURE_TEST_DOMAIN;
}
- String unique = UUID.randomUUID().toString().replace("-", "");
+ String unique = CoreUtils.randomUuid().toString().replace("-", "");
return order + "-" + unique + "." + AZURE_TEST_DOMAIN;
}
}
diff --git a/sdk/communication/azure-communication-rooms/CHANGELOG.md b/sdk/communication/azure-communication-rooms/CHANGELOG.md
index 5fe6b5e09332b..1dc38d67f00f7 100644
--- a/sdk/communication/azure-communication-rooms/CHANGELOG.md
+++ b/sdk/communication/azure-communication-rooms/CHANGELOG.md
@@ -10,6 +10,10 @@
### Other Changes
+#### Dependency Updates
+
+- Specified `azure-core-http-netty` as version `1.14.2`.
+
## 1.1.1 (2024-04-23)
diff --git a/sdk/communication/azure-communication-rooms/assets.json b/sdk/communication/azure-communication-rooms/assets.json
index d1bfcc8c59d3f..5145793110efd 100644
--- a/sdk/communication/azure-communication-rooms/assets.json
+++ b/sdk/communication/azure-communication-rooms/assets.json
@@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/communication/azure-communication-rooms",
- "Tag": "java/communication/azure-communication-rooms_c1bfd681a1"
+ "Tag": "java/communication/azure-communication-rooms_5116842cd0"
}
diff --git a/sdk/communication/azure-communication-rooms/pom.xml b/sdk/communication/azure-communication-rooms/pom.xml
index 788d1a506a41c..aaebb8acefae9 100644
--- a/sdk/communication/azure-communication-rooms/pom.xml
+++ b/sdk/communication/azure-communication-rooms/pom.xml
@@ -59,7 +59,7 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
@@ -75,7 +75,7 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
@@ -105,21 +105,26 @@
com.azure
azure-core-http-okhttp
- 1.11.20
+ 1.11.21
test
com.azure
azure-core-http-vertx
- 1.0.0-beta.17
+ 1.0.0-beta.18
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
+
+ com.azure
+ azure-core-http-netty
+ 1.15.0
+
@@ -131,7 +136,7 @@
com.azure
azure-core-http-jdk-httpclient
- 1.0.0-beta.12
+ 1.0.0-beta.13
test
diff --git a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java
index dc472774da6fe..6fe6e520b73d6 100644
--- a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java
+++ b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsAsyncClientTests.java
@@ -3,33 +3,42 @@
package com.azure.communication.rooms;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
+import com.azure.communication.common.CommunicationIdentifier;
+import com.azure.communication.common.CommunicationUserIdentifier;
import com.azure.communication.identity.CommunicationIdentityClient;
-import com.azure.communication.rooms.models.*;
import com.azure.communication.rooms.implementation.models.CommunicationErrorResponseException;
+import com.azure.communication.rooms.models.AddOrUpdateParticipantsResult;
+import com.azure.communication.rooms.models.CommunicationRoom;
+import com.azure.communication.rooms.models.CreateRoomOptions;
+import com.azure.communication.rooms.models.ParticipantRole;
+import com.azure.communication.rooms.models.RemoveParticipantsResult;
+import com.azure.communication.rooms.models.RoomParticipant;
+import com.azure.communication.rooms.models.UpdateRoomOptions;
import com.azure.core.http.HttpClient;
-import com.azure.core.http.rest.Response;
-import com.azure.core.util.Context;
import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.Response;
import com.azure.core.test.http.AssertingHttpClientBuilder;
-import java.util.Arrays;
-import java.util.List;
-
-import com.azure.communication.common.CommunicationIdentifier;
-import com.azure.communication.common.CommunicationUserIdentifier;
-
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
-
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class RoomsAsyncClientTests extends RoomsTestBase {
+ private static final ClientLogger LOGGER = new ClientLogger(RoomsAsyncClientTests.class);
+
private RoomsAsyncClient roomsAsyncClient;
private CommunicationIdentityClient communicationClient;
private final String nonExistRoomId = "NotExistingRoomID";
@@ -78,7 +87,7 @@ public void createRoomFullCycleWithResponseStep(HttpClient httpClient) {
Mono> response3 = roomsAsyncClient.updateRoomWithResponse(roomId, updateOptions);
- System.out.println(VALID_FROM.plusMonths(3).getDayOfYear());
+ LOGGER.log(LogLevel.VERBOSE, () -> String.valueOf(VALID_FROM.plusMonths(3).getDayOfYear()));
StepVerifier.create(response3)
.assertNext(roomResult -> {
@@ -121,10 +130,10 @@ public void createRoomFullCycleWithOutResponseStep(HttpClient httpClient) {
StepVerifier.create(response1)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertTrue(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -139,7 +148,7 @@ public void createRoomFullCycleWithOutResponseStep(HttpClient httpClient) {
StepVerifier.create(response3)
.assertNext(result3 -> {
- assertEquals(true, result3.getValidUntil().toEpochSecond() > result3.getValidFrom().toEpochSecond());
+ assertTrue(result3.getValidUntil().toEpochSecond() > result3.getValidFrom().toEpochSecond());
assertTrue(result3.isPstnDialOutEnabled());
}).verifyComplete();
@@ -168,10 +177,10 @@ public void createRoomWithNoAttributes(HttpClient httpClient) {
StepVerifier.create(response1)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertFalse(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -210,10 +219,10 @@ public void createRoomWithOnlyParticipantAttributes(HttpClient httpClient) {
StepVerifier.create(response1)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertTrue(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -241,10 +250,10 @@ public void createRoomWithOnlyPstnEnabledAttribute(HttpClient httpClient) {
StepVerifier.create(response1)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertTrue(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -566,10 +575,10 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http
StepVerifier.create(createCommunicationRoom)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertTrue(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -627,7 +636,7 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http
StepVerifier.create(updateParticipantResponse)
.assertNext(result -> {
- assertEquals(true, result instanceof AddOrUpdateParticipantsResult);
+ assertInstanceOf(AddOrUpdateParticipantsResult.class, result);
})
.verifyComplete();
@@ -680,7 +689,7 @@ public void addUpdateAndRemoveParticipantsOperationsWithFullFlow(HttpClient http
StepVerifier.create(removeParticipantResponse2)
.assertNext(result -> {
- assertEquals(true, result instanceof RemoveParticipantsResult);
+ assertInstanceOf(RemoveParticipantsResult.class, result);
})
.verifyComplete();
@@ -716,10 +725,10 @@ public void addParticipantsOperationWithOutResponse(HttpClient httpClient) {
StepVerifier.create(createCommunicationRoom)
.assertNext(roomResult -> {
- assertTrue(roomResult.getRoomId() != null);
- assertTrue(roomResult.getCreatedAt() != null);
- assertTrue(roomResult.getValidFrom() != null);
- assertTrue(roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
assertTrue(roomResult.isPstnDialOutEnabled());
}).verifyComplete();
@@ -772,10 +781,10 @@ public void addUpdateInvalidParticipants(HttpClient httpClient) {
StepVerifier.create(createCommunicationRoom)
.assertNext(roomResult -> {
- assertEquals(true, roomResult.getRoomId() != null);
- assertEquals(true, roomResult.getCreatedAt() != null);
- assertEquals(true, roomResult.getValidFrom() != null);
- assertEquals(true, roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
}).verifyComplete();
String roomId = createCommunicationRoom.block().getRoomId();
@@ -822,10 +831,10 @@ public void listRoomTestFirstRoomIsNotNullThenDeleteRoomWithOutResponse(HttpClie
StepVerifier.create(createCommunicationRoom)
.assertNext(roomResult -> {
- assertEquals(true, roomResult.getRoomId() != null);
- assertEquals(true, roomResult.getCreatedAt() != null);
- assertEquals(true, roomResult.getValidFrom() != null);
- assertEquals(true, roomResult.getValidUntil() != null);
+ assertNotNull(roomResult.getRoomId());
+ assertNotNull(roomResult.getCreatedAt());
+ assertNotNull(roomResult.getValidFrom());
+ assertNotNull(roomResult.getValidUntil());
}).verifyComplete();
String roomId = createCommunicationRoom.block().getRoomId();
@@ -835,10 +844,10 @@ public void listRoomTestFirstRoomIsNotNullThenDeleteRoomWithOutResponse(HttpClie
StepVerifier.create(listRoomResponse.take(1))
.assertNext(room -> {
- assertEquals(true, room.getRoomId() != null);
- assertEquals(true, room.getCreatedAt() != null);
- assertEquals(true, room.getValidFrom() != null);
- assertEquals(true, room.getValidUntil() != null);
+ assertNotNull(room.getRoomId());
+ assertNotNull(room.getCreatedAt());
+ assertNotNull(room.getValidFrom());
+ assertNotNull(room.getValidUntil());
})
.expectComplete()
.verify();
diff --git a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java
index c78a43f7207b0..d845723cd19b7 100644
--- a/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java
+++ b/sdk/communication/azure-communication-rooms/src/test/java/com/azure/communication/rooms/RoomsTestBase.java
@@ -5,10 +5,14 @@
import com.azure.communication.common.implementation.CommunicationConnectionString;
import com.azure.communication.identity.CommunicationIdentityClientBuilder;
-import com.azure.communication.rooms.models.*;
+import com.azure.communication.rooms.models.CommunicationRoom;
+import com.azure.communication.rooms.models.RoomParticipant;
import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipelineNextPolicy;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
import com.azure.core.test.TestMode;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.test.models.BodilessMatcher;
@@ -16,18 +20,17 @@
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
+import reactor.core.publisher.Mono;
import java.time.OffsetDateTime;
import java.util.Arrays;
-import java.util.Locale;
-import reactor.core.publisher.Mono;
-import com.azure.core.http.HttpPipelineNextPolicy;
-import com.azure.core.http.HttpResponse;
-import com.azure.core.http.rest.Response;
-import static org.junit.jupiter.api.Assertions.*;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
public class RoomsTestBase extends TestProxyTestBase {
- protected static final TestMode TEST_MODE = initializeTestMode();
+ private static final ClientLogger LOGGER = new ClientLogger(RoomsTestBase.class);
protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration().get(
"COMMUNICATION_CONNECTION_STRING_ROOMS",
@@ -112,23 +115,6 @@ protected void configureTestMode(RoomsClientBuilder builder) {
}
}
- private static TestMode initializeTestMode() {
- ClientLogger logger = new ClientLogger(RoomsTestBase.class);
- String azureTestMode = Configuration.getGlobalConfiguration().get("AZURE_TEST_MODE");
- if (azureTestMode != null) {
- System.out.println("azureTestMode: " + azureTestMode);
- try {
- return TestMode.valueOf(azureTestMode.toUpperCase(Locale.US));
- } catch (IllegalArgumentException var3) {
- logger.error("Could not parse '{}' into TestEnum. Using 'Playback' mode.", azureTestMode);
- return TestMode.PLAYBACK;
- }
- } else {
- logger.info("Environment variable '{}' has not been set yet. Using 'Playback' mode.", "AZURE_TEST_MODE");
- return TestMode.PLAYBACK;
- }
- }
-
protected RoomsClientBuilder addLoggingPolicy(RoomsClientBuilder builder, String testName) {
return builder.addPolicy((context, next) -> logHeaders(testName, next));
}
@@ -153,8 +139,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne
final HttpResponse bufferedResponse = httpResponse.buffer();
// Should sanitize printed reponse url
- System.out.println("MS-CV header for " + testName + " request " + bufferedResponse.getRequest().getUrl()
- + ": " + bufferedResponse.getHeaderValue("MS-CV"));
+ LOGGER.log(LogLevel.VERBOSE, () -> "MS-CV header for " + testName + " request "
+ + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
return Mono.just(bufferedResponse);
});
}
diff --git a/sdk/communication/azure-communication-sms/pom.xml b/sdk/communication/azure-communication-sms/pom.xml
index 39d958e5375f5..6239888d59e92 100644
--- a/sdk/communication/azure-communication-sms/pom.xml
+++ b/sdk/communication/azure-communication-sms/pom.xml
@@ -55,7 +55,7 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
@@ -65,7 +65,7 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
@@ -101,19 +101,19 @@
com.azure
azure-core-http-okhttp
- 1.11.20
+ 1.11.21
test
com.azure
azure-core-http-vertx
- 1.0.0-beta.17
+ 1.0.0-beta.18
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
@@ -159,7 +159,7 @@
com.azure
azure-core-http-jdk-httpclient
- 1.0.0-beta.12
+ 1.0.0-beta.13
test
diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java
index fdffac7a54790..bbfcda8cc29fd 100644
--- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java
+++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java
@@ -15,11 +15,15 @@
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import reactor.core.publisher.Mono;
import java.util.Arrays;
public class SmsTestBase extends TestProxyTestBase {
+ private static final ClientLogger LOGGER = new ClientLogger(SmsTestBase.class);
+
protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration()
.get("COMMUNICATION_LIVETEST_STATIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5");
@@ -95,8 +99,8 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne
final HttpResponse bufferedResponse = httpResponse.buffer();
// Should sanitize printed reponse url
- System.out.println("MS-CV header for " + testName + " request "
- + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV"));
+ LOGGER.log(LogLevel.VERBOSE, () -> ("MS-CV header for " + testName + " request "
+ + bufferedResponse.getRequest().getUrl() + ": " + bufferedResponse.getHeaderValue("MS-CV")));
return Mono.just(bufferedResponse);
});
}
diff --git a/sdk/communication/azure-resourcemanager-communication/pom.xml b/sdk/communication/azure-resourcemanager-communication/pom.xml
index cfacdc3336774..f23890aa15ba7 100644
--- a/sdk/communication/azure-resourcemanager-communication/pom.xml
+++ b/sdk/communication/azure-resourcemanager-communication/pom.xml
@@ -50,23 +50,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/communication/pom.xml b/sdk/communication/pom.xml
index 49476b17c49da..b3834304553df 100644
--- a/sdk/communication/pom.xml
+++ b/sdk/communication/pom.xml
@@ -16,7 +16,6 @@
azure-communication-common
azure-communication-email
azure-communication-identity
- azure-communication-networktraversal
azure-communication-phonenumbers
azure-communication-sms
azure-communication-rooms
diff --git a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml
index 9c728ee997e3a..ed292f0f8dd0d 100644
--- a/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml
+++ b/sdk/confidentialledger/azure-resourcemanager-confidentialledger/pom.xml
@@ -51,23 +51,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/confidentialledger/azure-security-confidentialledger/README.md b/sdk/confidentialledger/azure-security-confidentialledger/README.md
index 3e860f7c9dc49..5a41a30d9e043 100644
--- a/sdk/confidentialledger/azure-security-confidentialledger/README.md
+++ b/sdk/confidentialledger/azure-security-confidentialledger/README.md
@@ -49,7 +49,7 @@ To use the [DefaultAzureCredential][DefaultAzureCredential] provider shown below
com.azure
azure-identity
- 1.11.4
+ 1.12.0
```
diff --git a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml
index 35a1a22c1f870..fbabf480ce884 100644
--- a/sdk/confidentialledger/azure-security-confidentialledger/pom.xml
+++ b/sdk/confidentialledger/azure-security-confidentialledger/pom.xml
@@ -46,12 +46,12 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-http-netty
- 1.14.2
+ 1.15.0
@@ -64,19 +64,19 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
com.azure
azure-core-serializer-json-jackson
- 1.4.11
+ 1.4.12
test
diff --git a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java
index c91b8d5c6cf1d..d9c220dd946f6 100644
--- a/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java
+++ b/sdk/confidentialledger/azure-security-confidentialledger/src/test/java/com/azure/security/confidentialledger/ConfidentialLedgerClientTestBase.java
@@ -18,6 +18,8 @@
import com.azure.core.test.models.TestProxySanitizer;
import com.azure.core.test.models.TestProxySanitizerType;
import com.azure.core.util.BinaryData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.logging.LogLevel;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClient;
import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClientBuilder;
@@ -39,6 +41,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
class ConfidentialLedgerClientTestBase extends TestProxyTestBase {
+ private static final ClientLogger LOGGER = new ClientLogger(ConfidentialLedgerClientTestBase.class);
protected static final String TRANSACTION_ID = "transactionId";
protected static final String COLLECTION_ID = "collectionId";
@@ -82,7 +85,7 @@ protected void beforeTest() {
try {
jsonNode = mapper.readTree(identityResponse.toBytes());
} catch (IOException ex) {
- System.out.println("Caught IO exception " + ex);
+ LOGGER.log(LogLevel.VERBOSE, () -> "Caught IO exception", ex);
Assertions.fail();
}
@@ -104,7 +107,7 @@ protected void beforeTest() {
reactorClient = reactor.netty.http.client.HttpClient.create()
.secure(sslContextSpec -> sslContextSpec.sslContext(sslContext));
} catch (SSLException ex) {
- System.out.println("Caught SSL exception " + ex);
+ LOGGER.log(LogLevel.VERBOSE, () -> "Caught SSL exception", ex);
Assertions.fail();
}
diff --git a/sdk/confluent/azure-resourcemanager-confluent/pom.xml b/sdk/confluent/azure-resourcemanager-confluent/pom.xml
index 77ce69f47f927..305e4aac16b3e 100644
--- a/sdk/confluent/azure-resourcemanager-confluent/pom.xml
+++ b/sdk/confluent/azure-resourcemanager-confluent/pom.xml
@@ -50,23 +50,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml
index 9668138eecd0f..465bfa840c1c3 100644
--- a/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml
+++ b/sdk/connectedvmware/azure-resourcemanager-connectedvmware/pom.xml
@@ -50,23 +50,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml
index c3d2648eb1e8b..4a3878aaaebd8 100644
--- a/sdk/consumption/azure-resourcemanager-consumption/pom.xml
+++ b/sdk/consumption/azure-resourcemanager-consumption/pom.xml
@@ -44,23 +44,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
diff --git a/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml b/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml
index 63c656c6f0508..16c88d8391dfc 100644
--- a/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml
+++ b/sdk/containerregistry/azure-containers-containerregistry-perf/pom.xml
@@ -36,18 +36,18 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-http-netty
- 1.14.2
+ 1.15.0
com.azure
azure-core-http-okhttp
- 1.11.20
+ 1.11.21
@@ -58,7 +58,7 @@
com.azure
azure-identity
- 1.12.0
+ 1.12.1
diff --git a/sdk/containerregistry/azure-containers-containerregistry/pom.xml b/sdk/containerregistry/azure-containers-containerregistry/pom.xml
index 4821b8f4cab06..311fc4bc5a522 100644
--- a/sdk/containerregistry/azure-containers-containerregistry/pom.xml
+++ b/sdk/containerregistry/azure-containers-containerregistry/pom.xml
@@ -46,7 +46,7 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
@@ -56,7 +56,7 @@
com.azure
azure-core-http-netty
- 1.14.2
+ 1.15.0
org.junit.jupiter
@@ -105,19 +105,19 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-core-http-okhttp
- 1.11.20
+ 1.11.21
test
com.azure
azure-core-http-vertx
- 1.0.0-beta.17
+ 1.0.0-beta.18
test
@@ -129,7 +129,7 @@
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
@@ -160,7 +160,7 @@
com.azure
azure-core-http-jdk-httpclient
- 1.0.0-beta.12
+ 1.0.0-beta.13
test
diff --git a/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java b/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java
index d844c0558d860..839f886a4b872 100644
--- a/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java
+++ b/sdk/containerregistry/azure-containers-containerregistry/src/test/java/com/azure/containers/containerregistry/TestUtils.java
@@ -125,7 +125,6 @@ static TokenCredential getCredentialByAuthority(TestMode testMode, String author
static void importImage(TestMode mode, String repository, List tags) {
try {
importImage(mode, REGISTRY_NAME, repository, tags, REGISTRY_ENDPOINT);
- Thread.sleep(SLEEP_TIME_IN_MILLISECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
@@ -190,6 +189,8 @@ static void importImage(TestMode mode, String registryName, String repository, L
Thread.sleep(SLEEP_TIME_IN_MILLISECONDS);
}
} while (++index < 3);
+
+ Thread.sleep(SLEEP_TIME_IN_MILLISECONDS);
}
private static OciImageManifest createManifest() {
diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml
index 4c9c3551bf495..790015e76d794 100644
--- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml
+++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml
@@ -51,23 +51,23 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-management
- 1.13.0
+ 1.14.0
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/contentsafety/azure-ai-contentsafety/pom.xml b/sdk/contentsafety/azure-ai-contentsafety/pom.xml
index 5be92c41dc2ea..e249c7a46e08d 100644
--- a/sdk/contentsafety/azure-ai-contentsafety/pom.xml
+++ b/sdk/contentsafety/azure-ai-contentsafety/pom.xml
@@ -50,12 +50,12 @@
com.azure
azure-core
- 1.48.0
+ 1.49.0
com.azure
azure-core-http-netty
- 1.14.2
+ 1.15.0
org.junit.jupiter
@@ -72,13 +72,13 @@
com.azure
azure-core-test
- 1.24.2
+ 1.25.0
test
com.azure
azure-identity
- 1.12.0
+ 1.12.1
test
diff --git a/sdk/core/azure-core-amqp/CHANGELOG.md b/sdk/core/azure-core-amqp/CHANGELOG.md
index c7a707fe0e08a..90af453d028b6 100644
--- a/sdk/core/azure-core-amqp/CHANGELOG.md
+++ b/sdk/core/azure-core-amqp/CHANGELOG.md
@@ -4,16 +4,25 @@
### Features Added
-- `WindowedSubscriber` to translate the asynchronous stream of events or messages to `IterableStream` ([38705](https://github.com/Azure/azure-sdk-for-java/pull/38705)).
-
### Breaking Changes
### Bugs Fixed
### Other Changes
+## 2.9.4 (2024-05-01)
+
+### Features Added
+
+- `WindowedSubscriber` to translate the asynchronous stream of events or messages to `IterableStream` ([38705](https://github.com/Azure/azure-sdk-for-java/pull/38705)).
+
+### Other Changes
+
+- Improvements to logging. ([#39904](https://github.com/Azure/azure-sdk-for-java/pull/39904))
+
#### Dependency Updates
+- Upgraded `azure-core` from `1.48.0` to `1.49.0`.
- Upgraded `qpid-proton-j-extensions` from `1.2.4` to `1.2.5`.
## 2.9.3 (2024-04-05)
diff --git a/sdk/core/azure-core-amqp/README.md b/sdk/core/azure-core-amqp/README.md
index 3e3826b174180..3eca2e73753ce 100644
--- a/sdk/core/azure-core-amqp/README.md
+++ b/sdk/core/azure-core-amqp/README.md
@@ -48,7 +48,7 @@ add the direct dependency to your project as follows.
com.azure
azure-core-amqp
- 2.9.3
+ 2.9.4
```
[//]: # ({x-version-update-end})
diff --git a/sdk/core/azure-core-amqp/pom.xml b/sdk/core/azure-core-amqp/pom.xml
index 81568ec89a30a..5a9c092cd4992 100644
--- a/sdk/core/azure-core-amqp/pom.xml
+++ b/sdk/core/azure-core-amqp/pom.xml
@@ -78,7 +78,7 @@
com.azure
azure-core
- 1.49.0-beta.1
+ 1.50.0-beta.1
com.microsoft.azure
@@ -139,7 +139,7 @@
com.azure
azure-core-test
- 1.25.0-beta.1
+ 1.26.0-beta.1
test
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ActiveClientTokenManager.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ActiveClientTokenManager.java
index d16abff5d0a83..06823c3127048 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ActiveClientTokenManager.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ActiveClientTokenManager.java
@@ -145,7 +145,7 @@ private Disposable scheduleRefreshTokenTask(Duration initialRefresh) {
(amqpException, interval) -> {
final Duration lastRefresh = lastRefreshInterval.get();
- LOGGER.atError()
+ LOGGER.atWarning()
.addKeyValue("scopes", scopes)
.addKeyValue(INTERVAL_KEY, interval)
.log("Error is transient. Rescheduling authorization task.", amqpException);
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/AmqpChannelProcessor.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/AmqpChannelProcessor.java
index 1d766902842f6..3c1eef933a389 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/AmqpChannelProcessor.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/AmqpChannelProcessor.java
@@ -232,7 +232,7 @@ public void onError(Throwable throwable) {
}
});
} else {
- logger.atWarning()
+ logger.atError()
.addKeyValue(TRY_COUNT_KEY, attemptsMade)
.log("Retry attempts exhausted or exception was not retriable.", throwable);
@@ -267,8 +267,9 @@ public void subscribe(CoreSubscriber super T> actual) {
actual.onSubscribe(Operators.emptySubscription());
actual.onError(lastError);
} else {
- Operators.error(actual, logger.logExceptionAsError(
- new IllegalStateException("Cannot subscribe. Processor is already terminated.")));
+ IllegalStateException error
+ = new IllegalStateException("Cannot subscribe. Processor is already terminated.");
+ Operators.error(actual, logger.logExceptionAsWarning(error));
}
return;
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ManagementChannel.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ManagementChannel.java
index b6a016be75c81..4a40a9737a2ac 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ManagementChannel.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ManagementChannel.java
@@ -138,7 +138,7 @@ private Mono errorIfEmpty(RequestResponseChannel channel,
= String.format("entityPath[%s] deliveryState[%s] No response received from management channel.",
entityPath, deliveryState);
AmqpException exception = new AmqpException(true, error, channel.getErrorContext());
- return logger.atError().addKeyValue(DELIVERY_STATE_KEY, deliveryState).log(exception);
+ return logger.atWarning().addKeyValue(DELIVERY_STATE_KEY, deliveryState).log(exception);
});
}
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnection.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnection.java
index eff5d3deb4e90..09766e2ddfc4b 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnection.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnection.java
@@ -24,7 +24,6 @@
import org.apache.qpid.proton.reactor.Reactor;
import reactor.core.Disposable;
import reactor.core.Disposables;
-import reactor.core.Exceptions;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Sinks;
@@ -176,7 +175,8 @@ public ReactorConnection(String connectionId, ConnectionOptions connectionOption
}
}).cache(1);
- this.subscriptions = Disposables.composite(this.endpointStates.subscribe());
+ this.subscriptions = Disposables.composite(this.endpointStates.subscribe(null,
+ e -> logger.warning("Error occurred while processing connection state.", e)));
}
/**
@@ -222,8 +222,8 @@ public Flux getShutdownSignals() {
public Mono getManagementNode(String entityPath) {
return Mono.defer(() -> {
if (isDisposed()) {
- return monoError(logger.atError().addKeyValue(ENTITY_PATH_KEY, entityPath), Exceptions
- .propagate(new IllegalStateException("Connection is disposed. Cannot get management instance.")));
+ return monoError(logger.atWarning().addKeyValue(ENTITY_PATH_KEY, entityPath),
+ new IllegalStateException("Connection is disposed. Cannot get management instance."));
}
final AmqpManagementNode existing = managementNodes.get(entityPath);
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnectionCache.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnectionCache.java
index f74831520dcc1..09345d97b5275 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnectionCache.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorConnectionCache.java
@@ -227,7 +227,7 @@ Retry retryWhenSpec(AmqpRetryPolicy retryPolicy) {
|| (error instanceof RejectedExecutionException));
if (!shouldRetry) {
- logger.atWarning()
+ logger.atError()
.addKeyValue(TRY_COUNT_KEY, iteration)
.log("Exception is non-retriable, not retrying for a new connection.", error);
return Mono.error(error);
@@ -246,7 +246,7 @@ Retry retryWhenSpec(AmqpRetryPolicy retryPolicy) {
final Duration backoff = retryPolicy.calculateRetryDelay(errorToUse, (int) attempts);
if (backoff == null) {
- logger.atWarning()
+ logger.atError()
.addKeyValue(TRY_COUNT_KEY, iteration)
.log("Retry is disabled, not retrying for a new connection.", error);
return Mono.error(error);
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorReceiver.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorReceiver.java
index 08cd26208f0fc..5fdf1ce8d5b30 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorReceiver.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorReceiver.java
@@ -228,7 +228,8 @@ public Mono updateDisposition(String deliveryTag, DeliveryState deliverySt
@Override
public Mono addCredits(int credits) {
if (isDisposed()) {
- return monoError(logger, new IllegalStateException("Cannot add credits to closed link: " + getLinkName()));
+ return monoError(logger.atWarning(),
+ new IllegalStateException("Cannot add credits to closed link: " + getLinkName()));
}
return Mono.create(sink -> {
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSender.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSender.java
index c9763e44d8dcb..7b4490a9ad75e 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSender.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSender.java
@@ -14,7 +14,6 @@
import com.azure.core.amqp.implementation.handler.SendLinkHandler;
import com.azure.core.util.AsyncCloseable;
import com.azure.core.util.CoreUtils;
-import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import org.apache.qpid.proton.Proton;
import org.apache.qpid.proton.amqp.Binary;
@@ -70,6 +69,7 @@
import static com.azure.core.amqp.implementation.ClientConstants.MAX_AMQP_HEADER_SIZE_BYTES;
import static com.azure.core.amqp.implementation.ClientConstants.NOT_APPLICABLE;
import static com.azure.core.amqp.implementation.ClientConstants.SERVER_BUSY_BASE_SLEEP_TIME_IN_SECS;
+import static com.azure.core.util.FluxUtil.monoError;
import static java.nio.charset.StandardCharsets.UTF_8;
/**
@@ -153,7 +153,7 @@ class ReactorSender implements AmqpSendLink, AsyncCloseable, AutoCloseable {
handler.getConnectionId(), handler.getLinkName());
this.endpointStates = this.handler.getEndpointStates().map(state -> {
- logger.verbose("State {}", state);
+ logger.atVerbose().addKeyValue("state", state).log("onEndpointState");
this.hasConnected.set(state == EndpointState.ACTIVE);
return AmqpEndpointStateUtil.getConnectionState(state);
}).doOnError(error -> {
@@ -332,7 +332,7 @@ private byte[] batchBinaryDataSectionBytes(Message sectionMessage, int maxMessag
}
private Mono batchBufferOverflowError(int maxMessageSize) {
- return FluxUtil.monoError(logger,
+ return monoError(logger,
new AmqpException(
false, AmqpErrorCondition.LINK_PAYLOAD_SIZE_EXCEEDED, String.format(Locale.US,
"Size of the payload exceeded maximum message size: %s kb", maxMessageSize / 1024),
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSession.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSession.java
index 97b4977212727..86317730c41dd 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSession.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/ReactorSession.java
@@ -33,7 +33,6 @@
import org.apache.qpid.proton.engine.Session;
import reactor.core.Disposable;
import reactor.core.Disposables;
-import reactor.core.Exceptions;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.core.publisher.MonoSink;
@@ -61,6 +60,7 @@
import static com.azure.core.amqp.implementation.ClientConstants.LINK_NAME_KEY;
import static com.azure.core.amqp.implementation.ClientConstants.NOT_APPLICABLE;
import static com.azure.core.amqp.implementation.ClientConstants.SESSION_NAME_KEY;
+import static com.azure.core.util.FluxUtil.monoError;
/**
* Represents an AMQP session using proton-j reactor.
@@ -297,11 +297,9 @@ Mono closeAsync(String message, ErrorCondition errorCondition, boolean dis
@Override
public Mono extends AmqpTransactionCoordinator> getOrCreateTransactionCoordinator() {
if (isDisposed()) {
- return Mono.error(logger.atError()
- .addKeyValue(SESSION_NAME_KEY, sessionName)
- .log(new AmqpException(true, String
- .format("Cannot create coordinator send link %s from a closed session.", TRANSACTION_LINK_NAME),
- sessionHandler.getErrorContext())));
+ return monoError(logger.atWarning().addKeyValue(SESSION_NAME_KEY, sessionName), new AmqpException(true,
+ String.format("Cannot create coordinator send link %s from a closed session.", TRANSACTION_LINK_NAME),
+ sessionHandler.getErrorContext()));
}
final TransactionCoordinator existing = transactionCoordinator.get();
@@ -354,16 +352,13 @@ protected Mono createConsumer(String linkName, String entityPat
ConsumerFactory consumerFactory) {
if (isDisposed()) {
- LoggingEventBuilder logBuilder = logger.atError()
+ LoggingEventBuilder logBuilder = logger.atWarning()
.addKeyValue(SESSION_NAME_KEY, sessionName)
.addKeyValue(ENTITY_PATH_KEY, entityPath)
.addKeyValue(LINK_NAME_KEY, linkName);
- // TODO(limolkova) this can be simplified with FluxUtil.monoError(LoggingEventBuilder), not using it for now
- // to allow using azure-core-amqp with stable azure-core 1.24.0 to simplify dependency management
- // we should switch to it once monoError(LoggingEventBuilder) ships in stable azure-core
- return Mono.error(logBuilder.log(Exceptions.propagate(new AmqpException(true,
- "Cannot create receive link from a closed session.", sessionHandler.getErrorContext()))));
+ return monoError(logBuilder, new AmqpException(true, "Cannot create receive link from a closed session.",
+ sessionHandler.getErrorContext()));
}
final LinkSubscription existingLink = openReceiveLinks.get(linkName);
@@ -447,16 +442,13 @@ private Mono createProducer(String linkName, String entityPath,
Map linkProperties, boolean requiresAuthorization) {
if (isDisposed()) {
- LoggingEventBuilder logBuilder = logger.atError()
+ LoggingEventBuilder logBuilder = logger.atWarning()
.addKeyValue(SESSION_NAME_KEY, sessionName)
.addKeyValue(ENTITY_PATH_KEY, entityPath)
.addKeyValue(LINK_NAME_KEY, linkName);
- // TODO(limolkova) this can be simplified with FluxUtil.monoError(LoggingEventBuilder), not using it for now
- // to allow using azure-core-amqp with stable azure-core 1.24.0 to simplify dependency management
- // we should switch to it once monoError(LoggingEventBuilder) ships in stable azure-core
- return Mono.error(logBuilder.log(Exceptions.propagate(new AmqpException(true,
- "Cannot create send link from a closed session.", sessionHandler.getErrorContext()))));
+ return monoError(logBuilder, new AmqpException(true, "Cannot create send link from a closed session.",
+ sessionHandler.getErrorContext()));
}
final LinkSubscription existing = openSendLinks.get(linkName);
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ConnectionHandler.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ConnectionHandler.java
index 542c925c80d5d..4db6799122b34 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ConnectionHandler.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ConnectionHandler.java
@@ -53,22 +53,6 @@ public class ConnectionHandler extends Handler {
private final SslPeerDetails peerDetails;
private final AmqpMetricsProvider metricProvider;
- /**
- * Creates a handler that handles proton-j's connection events.
- *
- * @param connectionId Identifier for this connection.
- * @param connectionOptions Options used when creating the AMQP connection.
- * @param peerDetails The peer details for this connection.
- * @deprecated use {@link ConnectionHandler#ConnectionHandler(String, ConnectionOptions, SslPeerDetails, AmqpMetricsProvider)} instead.
- * @throws NullPointerException if {@code connectionOptions} or {@code peerDetails} is null.
- */
- @Deprecated
- public ConnectionHandler(final String connectionId, final ConnectionOptions connectionOptions,
- SslPeerDetails peerDetails) {
- this(connectionId, connectionOptions, peerDetails,
- new AmqpMetricsProvider(null, connectionOptions.getFullyQualifiedNamespace(), null));
- }
-
/**
* Creates a handler that handles proton-j's connection events.
*
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiveLinkHandler.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiveLinkHandler.java
index f5a6852b8e8a8..89f31f7baa673 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiveLinkHandler.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiveLinkHandler.java
@@ -50,20 +50,6 @@ public class ReceiveLinkHandler extends LinkHandler {
private final Set queuedDeliveries = Collections.newSetFromMap(new ConcurrentHashMap<>());
private final String entityPath;
- /**
- * Creates a new instance of ReceiveLinkHandler.
- *
- * @param connectionId Identifier for the connection.
- * @param hostname Hostname of the connection.
- * @param linkName Name of the link.
- * @param entityPath Address to the entity.
- * @deprecated use {@link #ReceiveLinkHandler(String, String, String, String, AmqpMetricsProvider)} instead.
- */
- @Deprecated
- public ReceiveLinkHandler(String connectionId, String hostname, String linkName, String entityPath) {
- this(connectionId, hostname, linkName, entityPath, new AmqpMetricsProvider(null, hostname, entityPath));
- }
-
/**
* Creates a new instance of ReceiveLinkHandler.
*
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiverUnsettledDeliveries.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiverUnsettledDeliveries.java
index df9c0cc4a0fc3..d25ab68c7d6d2 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiverUnsettledDeliveries.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ReceiverUnsettledDeliveries.java
@@ -181,7 +181,7 @@ public boolean containsDelivery(UUID deliveryTag) {
*/
public Mono sendDisposition(String deliveryTag, DeliveryState desiredState) {
if (isTerminated.get()) {
- return monoError(logger, DeliveryNotOnLinkException.linkClosed(deliveryTag, desiredState));
+ return monoError(logger.atWarning(), DeliveryNotOnLinkException.linkClosed(deliveryTag, desiredState));
} else {
return sendDispositionImpl(deliveryTag, desiredState);
}
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SendLinkHandler.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SendLinkHandler.java
index 052dc661802d2..18c10544fae8d 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SendLinkHandler.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SendLinkHandler.java
@@ -46,21 +46,6 @@ public class SendLinkHandler extends LinkHandler {
private final Sinks.Many creditProcessor = Sinks.many().unicast().onBackpressureBuffer();
private final Sinks.Many deliveryProcessor = Sinks.many().multicast().onBackpressureBuffer();
- /**
- * Creates a new instance of SendLinkHandler.
- *
- * @param connectionId The identifier of the connection this link belongs to.
- * @param hostname The hostname for the connection.
- * @param linkName The name of the link.
- * @param entityPath The entity path this link is connected to.
- * @deprecated use {@link SendLinkHandler#SendLinkHandler(String, String, String, String, AmqpMetricsProvider)}
- * instead.
- */
- @Deprecated
- public SendLinkHandler(String connectionId, String hostname, String linkName, String entityPath) {
- this(connectionId, hostname, linkName, entityPath, new AmqpMetricsProvider(null, hostname, null));
- }
-
/**
* Creates a new instance of SendLinkHandler.
*
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SessionHandler.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SessionHandler.java
index c04dacd3dc3aa..eee9eaee0feda 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SessionHandler.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/SessionHandler.java
@@ -32,24 +32,6 @@ public class SessionHandler extends Handler {
private final ReactorDispatcher reactorDispatcher;
private final AmqpMetricsProvider metricsProvider;
- /**
- * Creates a session handler.
- *
- * @param connectionId Identifier for the connection.
- * @param hostname Hostname of the connection.
- * @param sessionName Name of the session.
- * @param reactorDispatcher Reactor dispatcher.
- * @param openTimeout Timeout for opening the session.
- * @deprecated use {@link #SessionHandler(String, String, String, ReactorDispatcher, Duration, AmqpMetricsProvider)}
- * instead.
- */
- @Deprecated
- public SessionHandler(String connectionId, String hostname, String sessionName, ReactorDispatcher reactorDispatcher,
- Duration openTimeout) {
- this(connectionId, hostname, sessionName, reactorDispatcher, openTimeout,
- new AmqpMetricsProvider(null, hostname, null));
- }
-
/**
* Creates a session handler.
*
diff --git a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/WebSocketsProxyConnectionHandler.java b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/WebSocketsProxyConnectionHandler.java
index 89f8bbd379cfc..0f60e64f3c8c7 100644
--- a/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/WebSocketsProxyConnectionHandler.java
+++ b/sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/WebSocketsProxyConnectionHandler.java
@@ -190,8 +190,10 @@ public void onTransportError(Event event) {
final URI url = createURI(fullyQualifiedNamespace, port);
final InetSocketAddress address = new InetSocketAddress(hostNameParts[0], port);
- logger.atError()
- .log("Failed to connect to url: '{}', proxy host: '{}'", url, address.getHostString(), ioException);
+ logger.atWarning()
+ .addKeyValue("url", url)
+ .addKeyValue("proxyHost", address.getHostString())
+ .log("Failed to connect.", ioException);
final ProxySelector proxySelector = ProxySelector.getDefault();
if (proxySelector != null) {
diff --git a/sdk/core/azure-core-amqp/src/test/java/com/azure/core/amqp/implementation/ReactorHandlerProviderTest.java b/sdk/core/azure-core-amqp/src/test/java/com/azure/core/amqp/implementation/ReactorHandlerProviderTest.java
index 198f89602797b..1fcf1bd9437b4 100644
--- a/sdk/core/azure-core-amqp/src/test/java/com/azure/core/amqp/implementation/ReactorHandlerProviderTest.java
+++ b/sdk/core/azure-core-amqp/src/test/java/com/azure/core/amqp/implementation/ReactorHandlerProviderTest.java
@@ -131,7 +131,7 @@ public void teardown() throws Exception {
@SuppressWarnings("deprecation")
public void constructorNull() {
// Act
- assertThrows(NullPointerException.class, () -> new ReactorHandlerProvider(null));
+ assertThrows(NullPointerException.class, () -> new ReactorHandlerProvider(null, null));
}
@Test
diff --git a/sdk/core/azure-core-experimental/CHANGELOG.md b/sdk/core/azure-core-experimental/CHANGELOG.md
index fa653bcd45108..10f571930bb79 100644
--- a/sdk/core/azure-core-experimental/CHANGELOG.md
+++ b/sdk/core/azure-core-experimental/CHANGELOG.md
@@ -1,6 +1,6 @@
# Release History
-## 1.0.0-beta.50 (Unreleased)
+## 1.0.0-beta.51 (Unreleased)
### Features Added
@@ -10,6 +10,14 @@
### Other Changes
+## 1.0.0-beta.50 (2024-05-01)
+
+### Other Changes
+
+#### Dependency Updates
+
+- Upgraded `azure-core` from `1.48.0` to `1.49.0`.
+
## 1.0.0-beta.49 (2024-04-05)
### Breaking Changes
diff --git a/sdk/core/azure-core-experimental/README.md b/sdk/core/azure-core-experimental/README.md
index 1284eeb0cda5f..565e9c4702f02 100644
--- a/sdk/core/azure-core-experimental/README.md
+++ b/sdk/core/azure-core-experimental/README.md
@@ -17,7 +17,7 @@ Azure Core Experimental contains types that are being evaluated and might eventu
com.azure
azure-core-experimental
- 1.0.0-beta.49
+ 1.0.0-beta.50
```
[//]: # ({x-version-update-end})
diff --git a/sdk/core/azure-core-experimental/pom.xml b/sdk/core/azure-core-experimental/pom.xml
index d4c7023fbfff0..aaacbfc94d448 100644
--- a/sdk/core/azure-core-experimental/pom.xml
+++ b/sdk/core/azure-core-experimental/pom.xml
@@ -15,7 +15,7 @@
com.azure
azure-core-experimental
jar
- 1.0.0-beta.50
+ 1.0.0-beta.51
Microsoft Azure Java Core Experimental Library
This package contains experimental core types for Azure Java clients.
@@ -80,7 +80,7 @@
com.azure
azure-core
- 1.49.0-beta.1
+ 1.50.0-beta.1
diff --git a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md
index 6279829fdd037..3c59c64f53dfc 100644
--- a/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md
+++ b/sdk/core/azure-core-http-jdk-httpclient/CHANGELOG.md
@@ -1,6 +1,6 @@
# Release History
-## 1.0.0-beta.13 (Unreleased)
+## 1.0.0-beta.14 (Unreleased)
### Features Added
@@ -10,6 +10,14 @@
### Other Changes
+## 1.0.0-beta.13 (2024-05-01)
+
+### Other Changes
+
+#### Dependency Updates
+
+- Upgraded `azure-core` from `1.48.0` to `1.49.0`.
+
## 1.0.0-beta.12 (2024-04-05)
### Features Added
diff --git a/sdk/core/azure-core-http-jdk-httpclient/README.md b/sdk/core/azure-core-http-jdk-httpclient/README.md
index b3181a427a837..a197e383467f3 100644
--- a/sdk/core/azure-core-http-jdk-httpclient/README.md
+++ b/sdk/core/azure-core-http-jdk-httpclient/README.md
@@ -16,7 +16,7 @@ part of JDK 11.