SyncDefaultPollingStrategy<T,U> Class
- java.
lang. Object - com.
azure. core. util. polling. SyncDefaultPollingStrategy<T,U>
- com.
Type Parameters
- T
the type of the response type from a polling call, or BinaryData if raw response body should be kept
- U
the type of the final result object to deserialize into, or BinaryData if raw response body should be kept
Implements
public final class SyncDefaultPollingStrategy<T,U>
implements SyncPollingStrategy<T,U>
The default synchronous polling strategy to use with Azure data plane services. The default polling strategy will attempt three known strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order. The first strategy that can poll on the initial response will be used. The created chained polling strategy is capable of handling most of the polling scenarios in Azure.
Modifier and Type | Method and Description |
---|---|
T |
cancel(Polling Cancels the long-running operation if service supports cancellation. |
boolean |
can Checks if this strategy is able to handle polling for this long-running operation based on the information in the initial response. |
U |
get Parses the response from the final GET call into the result type of the long-running operation. |
Poll |
on Parses the initial response into a LongRunningOperationStatus, and stores information useful for polling in the PollingContext<T>. |
Poll |
poll(Polling Parses the response from the polling URL into a PollResponse<T>, and stores information useful for further polling and final response in the PollingContext<T>. |
Methods inherited from java.lang.Object
SyncDefaultPollingStrategy
public SyncDefaultPollingStrategy(HttpPipeline httpPipeline)
Creates a synchronous chained polling strategy with three known polling strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order, with a JSON serializer.
Parameters:
SyncDefaultPollingStrategy
public SyncDefaultPollingStrategy(HttpPipeline httpPipeline, JsonSerializer serializer)
Creates a synchronous chained polling strategy with three known polling strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order, with a JSON serializer.
Parameters:
SyncDefaultPollingStrategy
public SyncDefaultPollingStrategy(HttpPipeline httpPipeline, JsonSerializer serializer, Context context)
Creates a synchronous chained polling strategy with three known polling strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order, with a JSON serializer.
Parameters:
SyncDefaultPollingStrategy
public SyncDefaultPollingStrategy(HttpPipeline httpPipeline, String endpoint, JsonSerializer serializer, Context context)
Creates a synchronous chained polling strategy with three known polling strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order, with a JSON serializer.
Parameters:
SyncDefaultPollingStrategy
public SyncDefaultPollingStrategy(PollingStrategyOptions pollingStrategyOptions)
Creates a chained polling strategy with 3 known polling strategies, SyncOperationResourcePollingStrategy<T,U>, SyncLocationPollingStrategy<T,U>, and SyncStatusCheckPollingStrategy<T,U>, in this order, with a custom serializer.
Parameters:
cancel
public T cancel(PollingContext
Cancels the long-running operation if service supports cancellation. If service does not support cancellation then the implementer should throw an IllegalStateException with an error message indicating absence of cancellation.
Implementing this method is optional - by default, cancellation will not be supported unless overridden.
Parameters:
canPoll
public boolean canPoll(Response initialResponse)
Checks if this strategy is able to handle polling for this long-running operation based on the information in the initial response.
Parameters:
getResult
public U getResult(PollingContext
Parses the response from the final GET call into the result type of the long-running operation.
Parameters:
onInitialResponse
public PollResponse
Parses the initial response into a LongRunningOperationStatus, and stores information useful for polling in the PollingContext<T>. If the result is anything other than IN_PROGRESS, the long-running operation will be terminated and none of the other methods will be invoked.
Parameters:
poll
public PollResponse
Parses the response from the polling URL into a PollResponse<T>, and stores information useful for further polling and final response in the PollingContext<T>. The result must have the LongRunningOperationStatus specified, and the entire polling response content as a BinaryData.
Parameters:
Applies to
Azure SDK for Java
Azure SDK for Java geri bildirimi
Azure SDK for Java, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: