Package com.azure.android.core.http
Class PolicyCompleter
- java.lang.Object
-
- com.azure.android.core.http.PolicyCompleter
-
public final class PolicyCompleter extends java.lang.ObjectA completer provided toNextPolicyCallback.onSuccessandNextPolicyCallback.onErrormethods along with the result (response or error) produced from the next policy. TheNextPolicyCallback.onSuccessandNextPolicyCallback.onErrorimplementations 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 classPolicyCompleter.CompletionStateThe type representsNextPolicyCallback.onSuccessandNextPolicyCallback.onErrorreturn value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PolicyCompleter.CompletionStatecompleted(HttpResponse response)The method to notify the successful completion of result interception.PolicyCompleter.CompletionStatecompletedError(java.lang.Throwable error)The method to notify that interception is completed with error.PolicyCompleter.CompletionStatedefer()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.
-
-