Package com.azure.core.util.polling
Class PollingContext<T>
- java.lang.Object
-
- com.azure.core.util.polling.PollingContext<T>
-
- Type Parameters:
T
- the type of the poll response.
public final class PollingContext<T> extends Object
A key/value store that is propagated between various poll related operations associated withPollerFlux
andSyncPoller
poller. The context also expose activation and latestPollResponse
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PollResponse<T>
getActivationResponse()
String
getData(String name)
Get a value from the context with the provided key.PollResponse<T>
getLatestResponse()
PollingContext<T>
setData(String name, String value)
Set a key-value pair in the context.
-
-
-
Method Detail
-
getData
public String getData(String name)
Get a value from the context with the provided key.- Parameters:
name
- the key to look for- Returns:
- the value of the key if exists, else null
-
setData
public PollingContext<T> setData(String name, String value)
Set a key-value pair in the context.- Parameters:
name
- the keyvalue
- the value- Returns:
- an updated PollingContext
-
getActivationResponse
public PollResponse<T> getActivationResponse()
- Returns:
- the activation
PollResponse
holding result of activation operation call.
-
getLatestResponse
public PollResponse<T> getLatestResponse()
- Returns:
- the latest
PollResponse
from pollOperation.
-
-