Class OperationLocationPollingStrategy<T,U>
java.lang.Object
com.azure.core.util.polling.OperationResourcePollingStrategy<T,U>
com.azure.core.experimental.util.polling.OperationLocationPollingStrategy<T,U>
- Type Parameters:
T- the type of the response type from a polling call, or BinaryData if raw response body should be keptU- the type of the final result object to deserialize into, or BinaryData if raw response body should be kept
- All Implemented Interfaces:
PollingStrategy<T,U>
Implements an operation location polling strategy, from Operation-Location.
-
Constructor Summary
ConstructorsConstructorDescriptionOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) Creates an instance of the operation resource polling strategy. -
Method Summary
Modifier and TypeMethodDescriptiongetResult(PollingContext<T> pollingContext, TypeReference<U> resultType) Parses the response from the final GET call into the result type of the long-running operation.onInitialResponse(Response<?> response, PollingContext<T> pollingContext, TypeReference<T> pollResponseType) Parses the initial response into aLongRunningOperationStatus, and stores information useful for polling in thePollingContext.Methods inherited from class com.azure.core.util.polling.OperationResourcePollingStrategy
canPoll, pollMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.core.util.polling.PollingStrategy
cancel
-
Constructor Details
-
OperationLocationPollingStrategy
Creates an instance of the operation resource polling strategy.- Parameters:
pollingStrategyOptions- options to configure this polling strategy.- Throws:
NullPointerException- ifpollingStrategyOptionsis null.
-
-
Method Details
-
onInitialResponse
public Mono<PollResponse<T>> onInitialResponse(Response<?> response, PollingContext<T> pollingContext, TypeReference<T> pollResponseType) Parses the initial response into aLongRunningOperationStatus, and stores information useful for polling in thePollingContext. If the result is anything other thanLongRunningOperationStatus.IN_PROGRESS, the long-running operation will be terminated and none of the other methods will be invoked.- Specified by:
onInitialResponsein interfacePollingStrategy<T,U> - Overrides:
onInitialResponsein classOperationResourcePollingStrategy<T,U> - Parameters:
response- the response from the initial method call to activate the long-running operationpollingContext- thePollingContextfor the current polling operationpollResponseType- theTypeReferenceof the response type from a polling call, or BinaryData if raw response body should be kept. This should match the generic parameterPollingStrategy.- Returns:
- a publisher emitting the poll response containing the status and the response content
-
getResult
Parses the response from the final GET call into the result type of the long-running operation.- Specified by:
getResultin interfacePollingStrategy<T,U> - Overrides:
getResultin classOperationResourcePollingStrategy<T,U> - Parameters:
pollingContext- thePollingContextfor the current polling operationresultType- theTypeReferenceof the final result object to deserialize into, or BinaryData if raw response body should be kept.- Returns:
- a publisher emitting the final result
-