diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/cryptography/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/cryptography/package-info.java index 5e39ad45fb6d..5434c53876d9 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/cryptography/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/cryptography/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing core cryptography interfaces + * Package containing core cryptography interfaces. */ package com.azure.core.cryptography; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/exception/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/exception/package-info.java index 8bd839a535ff..82842d066095 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/exception/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/exception/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing core exception classes + * Package containing core exception classes. */ package com.azure.core.exception; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/package-info.java index 37a44935af1c..9a231a4ea7a7 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing the HTTP abstractions between the AnnotationParser, RestProxy and HTTP client. + * Package containing HTTP abstractions between the AnnotationParser, RestProxy, and HTTP client. */ package com.azure.core.http; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/package-info.java index 5d138f009c81..3440337a13d9 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/http/policy/package-info.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. /** - * Package containing HttpPipelinePolicy interface and it's implementations. + * Package containing HttpPipelinePolicy interface and its implementations. */ package com.azure.core.http.policy; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java index f735b3fef2a2..0fe19a86758f 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/ClientLogger.java @@ -11,15 +11,15 @@ import java.util.Objects; /** - * This is a fluent logger helper class that wraps a plug-able {@link Logger}. + * This is a fluent logger helper class that wraps a pluggable {@link Logger}. * - *
This logger logs formattable messages that use {@code {}} as the placeholder. When a throwable is the last - * argument of the format varargs and the logger is enabled for {@link ClientLogger#verbose(String, Object...) verbose} - * logging the stack trace for the throwable will be included in the log message.
+ *This logger logs formattable messages that use {@code {}} as the placeholder. When a {@link Throwable throwable} + * is the last argument of the format varargs and the logger is enabled for + * {@link ClientLogger#verbose(String, Object...) verbose}, the stack trace for the throwable is logged.
* *A minimum logging level threshold is determined by the - * {@link Configuration#PROPERTY_AZURE_LOG_LEVEL AZURE_LOG_LEVEL} environment configuration, by default logging is - * disabled.
+ * {@link Configuration#PROPERTY_AZURE_LOG_LEVEL AZURE_LOG_LEVEL} environment configuration. By default logging is + * disabled. * *Log level hierarchy
*Code Samples
+ *Code samples
*- * Logging a message at verbose log level - * {@codesnippet com.azure.core.implementation.util.clientlogger.verbose} + * Logging a message at verbose log level. + * {@codesnippet com.azure.core.util.logging.clientlogger.verbose} * - * @param format The formattable message to log - * @param args Arguments for the message, if an exception is being logged last argument is the throwable. + * @param format The formattable message to log. + * @param args Arguments for the message. If an exception is being logged, the last argument should be the + * {@link Throwable}. */ public void verbose(String format, Object... args) { log(VERBOSE_LEVEL, format, args); } /** - * Logs a formattable message that uses {@code {}} as the placeholder at {@code informational} log level + * Logs a formattable message that uses {@code {}} as the placeholder at {@code informational} log level. * - *
Code Samples
+ *Code samples
*- * Logging a message at informational log level - * {@codesnippet com.azure.core.implementation.util.clientlogger.info} + * Logging a message at informational log level. + * {@codesnippet com.azure.core.util.logging.clientlogger.info} * * @param format The formattable message to log - * @param args Arguments for the message, if an exception is being logged last argument is the throwable. + * @param args Arguments for the message. If an exception is being logged, the last argument should be the + * {@link Throwable}. */ public void info(String format, Object... args) { log(INFORMATIONAL_LEVEL, format, args); } /** - * Logs a formattable message that uses {@code {}} as the placeholder at {@code warning} log level + * Logs a formattable message that uses {@code {}} as the placeholder at {@code warning} log level. * - *
Code Samples
+ *Code samples
*- * Logging a message at warning log level - * {@codesnippet com.azure.core.implementation.util.clientlogger.warning} + * Logging a message at warning log level. + * {@codesnippet com.azure.core.util.logging.clientlogger.warning} * - * @param format The formattable message to log - * @param args Arguments for the message, if an exception is being logged last argument is the throwable. + * @param format The formattable message to log. + * @param args Arguments for the message. If an exception is being logged, the last argument should be the + * {@link Throwable}. */ public void warning(String format, Object... args) { log(WARNING_LEVEL, format, args); } /** - * Logs a formattable message that uses {@code {}} as the placeholder at {@code error} log level + * Logs a formattable message that uses {@code {}} as the placeholder at {@code error} log level. * - *
Code Samples
+ *Code samples
*- * Logging an error with stack trace - * {@codesnippet com.azure.core.implementation.util.clientlogger.error} + * Logging an error with stack trace. + * {@codesnippet com.azure.core.util.logging.clientlogger.error} * - * @param format The formattable message to log - * @param args Arguments for the message, if an exception is being logged last argument is the throwable. + * @param format The formattable message to log. + * @param args Arguments for the message. If an exception is being logged, the last argument should be the + * {@link Throwable}. */ public void error(String format, Object... args) { log(ERROR_LEVEL, format, args); @@ -151,10 +155,10 @@ private void log(int logLevel, String format, Object... args) { } /** - * Attempts to log the {@link RuntimeException} at the warning level and returns it to be thrown. + * Logs the {@link RuntimeException} at the warning level and returns it to be thrown. * * @param runtimeException RuntimeException to be logged and returned. - * @return the passed {@code RuntimeException} + * @return The passed {@code RuntimeException}. * @throws NullPointerException If {@code runtimeException} is {@code null}. */ public RuntimeException logExceptionAsWarning(RuntimeException runtimeException) { @@ -162,10 +166,10 @@ public RuntimeException logExceptionAsWarning(RuntimeException runtimeException) } /** - * Attempts to log the {@link RuntimeException} at the error level and returns it to be thrown. + * Logs the {@link RuntimeException} at the error level and returns it to be thrown. * * @param runtimeException RuntimeException to be logged and returned. - * @return the passed {@code RuntimeException} + * @return The passed {@code RuntimeException}. * @throws NullPointerException If {@code runtimeException} is {@code null}. */ public RuntimeException logExceptionAsError(RuntimeException runtimeException) { diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/package-info.java index 8be79d3fe823..312d35c2a517 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/logging/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing implementation-specific APIs that should not be used by end-users. + * Package containing logging APIs. */ package com.azure.core.util.logging; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/package-info.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/package-info.java index 6a5dc5f88872..2b6e9bec6928 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/package-info.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/package-info.java @@ -2,6 +2,6 @@ // Licensed under the MIT License. /** - * Package containing core utility classes + * Package containing core utility classes. */ package com.azure.core.util; diff --git a/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/Poller.java b/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/Poller.java index 0050f79f6d4d..aad002fecdbd 100644 --- a/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/Poller.java +++ b/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/Poller.java @@ -14,11 +14,12 @@ import java.util.function.Function; /** - * This class offers API that simplifies the task of executing long-running operations against Azure service. - * The {@link Poller} consist of poll operation, cancel operation if supported by Azure service and polling interval. + * This class offers API that simplifies the task of executing long-running operations against an Azure service. + * The {@link Poller} consists of a poll operation, a cancel operation, if it is supported by the Azure service, and a + * polling interval. + * *
* It provides the following functionality: - * *
Auto Polling
- * Auto-polling is enabled by-default. It means that the {@link Poller} starts polling as soon as its instance is - * created. The {@link Poller} will transparently call the poll operation every polling cycle and track the state of - * the long-running operation. Azure services can return {@link PollResponse#getRetryAfter()} to override the - * {@code Poller.pollInterval} defined in the {@link Poller}. The {@link Poller#getStatus()} represents the status - * returned by the successful long-running operation at the time the last auto-polling or last manual polling, whichever - * happened most recently. + *Auto polling
+ * Auto-polling is enabled by default. The {@link Poller} starts polling as soon as the instance is created. The + * {@link Poller} will transparently call the poll operation every polling cycle and track the state of the + * long-running operation. Azure services can return {@link PollResponse#getRetryAfter()} to override the + * {@code Poller.pollInterval} defined in the {@link Poller}. {@link #getStatus()} represents the status returned by a + * successful long-running operation at the time the last auto-polling or last manual polling, whichever happened most + * recently. * - *Disable Auto Polling
- * For those scenarios which require manual control of the polling cycle, disable auto-poling by calling - * {@code setAutoPollingEnabled#false} and perform manual poll by invoking {@link Poller#poll()} function. It will call - * poll operation once and update the {@link Poller} with the latest status. + *Disable auto polling
+ * For those scenarios which require manual control of the polling cycle, disable auto-polling by calling + * {@link #setAutoPollingEnabled(boolean) setAutoPollingEnabled(false)}. Then perform manual polling by invoking + * {@link #poll()} function. It will call poll operation once and update {@link #getStatus()} with the latest status. * - *When auto-polling is disabled, the {@link Poller} will not update its status or other information, unless - * manual polling is triggered by calling {@link Poller#poll()} function. + *
When auto-polling is disabled, the {@link Poller} will not update its status or any other information, unless + * manual polling is triggered by calling {@link #poll()} function. * - *
The {@link Poller} will stop polling when the long-running operation is complete or it is disabled. The polling - * is considered complete based on status defined in {@link OperationStatus}. + *
The {@link Poller} will stop polling when the long-running operation is complete or disabled. Polling is + * considered complete based on status defined in {@link OperationStatus}. * - *
Code Samples
+ *Code samples
* - *Instantiating and Subscribing to Poll Response
+ *Instantiating and subscribing to PollResponse
* {@codesnippet com.azure.core.util.polling.poller.instantiationAndSubscribe} * - *Wait/Block for Polling to complete
+ *Wait for polling to complete
* {@codesnippet com.azure.core.util.polling.poller.block} * - *Disable auto polling and polling manually
+ *Disable auto polling and poll manually
* {@codesnippet com.azure.core.util.polling.poller.poll-manually} * * @paramCode Sample - Create poller object
+ *Create poller object
* {@codesnippet com.azure.core.util.polling.poller.initialize.interval.polloperation} * - * @param pollInterval Not-null and greater than zero poll interval. - * @param pollOperation The polling operation to be called by the {@link Poller} instance. This is a callback into - * the client library, which must never return {@code null}, and which must always have a non-null - * {@link OperationStatus}. {@link Mono} returned from poll operation should never return - * {@link Mono#error(Throwable)}.If any unexpected scenario happens in poll operation, it should be handled by - * client library and return a valid {@link PollResponse}. However if poll operation returns - * {@link Mono#error(Throwable)}, the {@link Poller} will disregard that and continue to poll. + * @param pollInterval Non null and greater than zero poll interval. + * @param pollOperation The polling operation to be called by the {@link Poller} instance. This must never return + * {@code null} and always have a non-null {@link OperationStatus}. {@link Mono} returned from poll operation + * should never return {@link Mono#error(Throwable)}. If an unexpected scenario happens during the poll + * operation, it should be handled by the client library and return a valid {@link PollResponse}. However if + * the poll operation returns {@link Mono#error(Throwable)}, the {@link Poller} will disregard it and continue + * to poll. * @throws IllegalArgumentException if {@code pollInterval} is less than or equal to zero and if * {@code pollInterval} or {@code pollOperation} are {@code null} */ @@ -128,20 +129,20 @@ public Poller(Duration pollInterval, FunctionCode Samples
- * - *Manual Polling
+ *Manual polling
*
* {@codesnippet com.azure.core.util.polling.poller.poll-indepth}
*
- * @return a Mono of {@link PollResponse} This will call poll operation once. The {@link Mono} returned here could
- * be subscribed for receiving {@link PollResponse} in async manner.
+ * @return A {@link Mono} that returns {@link PollResponse}. This will call poll operation once.
*/
public Mono It will enable auto-polling if it was disable by user.
+ * Blocks execution and wait for polling to complete. The polling is considered complete based on the status defined
+ * in {@link OperationStatus}.
*
- * @return returns final {@link PollResponse} when polling is complete as defined in {@link OperationStatus}.
+ * It will enable auto-polling if it was disabled by the user.
+ *
+ * @return A {@link PollResponse} when polling is complete.
*/
public PollResponse
- * The {@code context} will be checked for containing information about a parent span. If a parent span is found,
- * the new span will be added as a child. Otherwise the parent span will be created and added to the {@code context}
- * and any downstream {@code start()} calls will use the created span as the parent.
+ * The {@code context} will be checked for information about a parent span. If a parent span is found, the new span
+ * will be added as a child. Otherwise, the parent span will be created and added to the {@code context} and any
+ * downstream {@code start()} calls will use the created span as the parent.
*
* Code samples
- * The {@code context} will be checked for containing information about a parent span. If a parent span is found the
- * new span will be added as a child. Otherwise the span will be created and added to the {@code context} and any
+ * The {@code context} will be checked for information about a parent span. If a parent span is found, the new span
+ * will be added as a child. Otherwise, the parent span will be created and added to the {@code context} and any
* downstream {@code start()} calls will use the created span as the parent.
*
*
@@ -126,14 +124,14 @@ public interface Tracer {
void end(int responseCode, Throwable error, Context context);
/**
- * Completes the current tracing span.
+ * Completes the current tracing span for AMQP calls.
*
* Code samples Completes the tracing span with the corresponding OpenCensus status for the given status message