T
- the type of the resource the operation returns.public class PollingState<T> extends Object
Modifier and Type | Method and Description |
---|---|
String |
azureAsyncOperationHeaderLink()
Gets the value captured from Azure-AsyncOperation header.
|
static <T> PollingState<T> |
create(retrofit2.Response<okhttp3.ResponseBody> response,
int defaultRetryTimeout,
Type resourceType,
SerializerAdapter<?> serializerAdapter)
Creates a polling state.
|
static <ResultT> PollingState<ResultT> |
createFromJSONString(String serializedPollingState)
Creates PollingState from the json string.
|
static <ResultT> PollingState<ResultT> |
createFromPollingState(PollingState<?> other,
ResultT result)
Creates PollingState from another polling state.
|
String |
locationHeaderLink()
Gets the value captured from Location header.
|
T |
resource()
Gets the resource.
|
retrofit2.Response<okhttp3.ResponseBody> |
response()
Gets the operation response.
|
String |
serialize() |
String |
status()
Gets the polling status.
|
int |
statusCode()
Gets the polling HTTP status code.
|
public static <T> PollingState<T> create(retrofit2.Response<okhttp3.ResponseBody> response, int defaultRetryTimeout, Type resourceType, SerializerAdapter<?> serializerAdapter) throws IOException
T
- the result typeresponse
- the response from Retrofit REST call that initiate the long running operation.defaultRetryTimeout
- the long running operation retry timeout.resourceType
- the type of the resource the long running operation returnsserializerAdapter
- the adapter for the Jackson object mapperIOException
- thrown by deserializationpublic static <ResultT> PollingState<ResultT> createFromJSONString(String serializedPollingState)
ResultT
- the result that the poll operation producesserializedPollingState
- polling state as json stringpublic static <ResultT> PollingState<ResultT> createFromPollingState(PollingState<?> other, ResultT result)
ResultT
- the result that the poll operation producesother
- other polling stateresult
- the final result of the LROpublic String serialize()
public T resource()
public retrofit2.Response<okhttp3.ResponseBody> response()
public String status()
public int statusCode()
public String azureAsyncOperationHeaderLink()
public String locationHeaderLink()
Copyright © 2019. All rights reserved.