PollingContext<T> Class

  • java.lang.Object
    • com.azure.core.util.polling.PollingContext<T>

Type Parameters

T

the type of the poll response.

public final class PollingContext

A key/value store that is propagated between various poll related operations associated with PollerFlux<T,U> and SyncPoller<T,U> poller. The context also expose activation and latest PollResponse<T>.

Method Summary

Modifier and Type Method and Description
PollResponse<T> getActivationResponse()

Gets the activation PollResponse<T> holding the result of an activation operation call.

String getData(String name)

Get a value from the context with the provided key.

PollResponse<T> getLatestResponse()

Gets the latest PollResponse<T> in the polling operation.

PollingContext<T> setData(String name, String value)

Set a key-value pair in the context.

Methods inherited from java.lang.Object

Method Details

getActivationResponse

public PollResponse getActivationResponse()

Gets the activation PollResponse<T> holding the result of an activation operation call.

Returns:

The activation PollResponse<T> holding the result of an activation operation call.

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

getLatestResponse

public PollResponse getLatestResponse()

Gets the latest PollResponse<T> in the polling operation.

Returns:

The latest PollResponse<T> in the polling operation.

setData

public PollingContext setData(String name, String value)

Set a key-value pair in the context.

Parameters:

name - the key
value - the value

Returns:

an updated PollingContext

Applies to