Package com.azure.android.core.http
Class PolicyCompleter
- java.lang.Object
-
- com.azure.android.core.http.PolicyCompleter
-
public final class PolicyCompleter extends java.lang.Object
A completer provided toNextPolicyCallback.onSuccess
andNextPolicyCallback.onError
methods along with the result (response or error) produced from the next policy. TheNextPolicyCallback.onSuccess
andNextPolicyCallback.onError
implementations must use the completer it received to notify the current policy's completion of result interception.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PolicyCompleter.CompletionState
The type representsNextPolicyCallback.onSuccess
andNextPolicyCallback.onError
return value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolicyCompleter.CompletionState
completed(HttpResponse response)
The method to notify the successful completion of result interception.PolicyCompleter.CompletionState
completedError(java.lang.Throwable error)
The method to notify that interception is completed with error.PolicyCompleter.CompletionState
defer()
Defers the execution of a previous policy's response interception until one of the completed method i.e.
-
-
-
Method Detail
-
completed
public PolicyCompleter.CompletionState completed(HttpResponse response)
The method to notify the successful completion of result interception.This notification indicates the current policy's completion of result interception. It signals that the pipeline can invoke the previous policy for it to intercept the
response
.- Parameters:
response
- The response.- Returns:
- The completion state.
-
completedError
public PolicyCompleter.CompletionState completedError(java.lang.Throwable error)
The method to notify that interception is completed with error.This notification indicates the current policy's completion of result interception. It signals that the pipeline can invoke the previous policy for it to intercept the
error
.- Parameters:
error
- The error.- Returns:
- The completion state.
-
defer
public PolicyCompleter.CompletionState defer()
Defers the execution of a previous policy's response interception until one of the completed method i.e.completed(HttpResponse)
orcompletedError(Throwable)
is called.- Returns:
- The completion state.
-
-