类 GaePendingResult<T,​R extends ApiResponse<T>>

java.lang.Object
ai.nextbillion.maps.internal.GaePendingResult<T,​R>
所有已实现的接口:
PendingResult<T>

public class GaePendingResult<T,​R extends ApiResponse<T>>
extends java.lang.Object
implements PendingResult<T>
A PendingResult backed by a HTTP call executed by Google App Engine URL Fetch capability, a deserialization step using Gson, and a retry policy.

T is the type of the result of this pending result, and R is the type of the request.

  • 嵌套类概要

    从接口继承的嵌套类/接口 ai.nextbillion.maps.PendingResult

    PendingResult.Callback<T>
  • 构造器概要

    构造器 
    构造器 说明
    GaePendingResult​(com.google.appengine.api.urlfetch.HTTPRequest request, com.google.appengine.api.urlfetch.URLFetchService client, java.lang.Class<R> responseClass, com.google.gson.FieldNamingPolicy fieldNamingPolicy, long errorTimeOut, java.lang.Integer maxRetries, ExceptionsAllowedToRetry exceptionsAllowedToRetry, RequestMetrics metrics)  
  • 方法概要

    修饰符和类型 方法 说明
    T await()
    Performs the request synchronously.
    T awaitIgnoreError()
    Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.
    void cancel()
    Attempts to cancel the request.
    void setCallback​(PendingResult.Callback<T> callback)
    Performs the request asynchronously, calling onResult or onFailure after the request has been completed.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • GaePendingResult

      public GaePendingResult​(com.google.appengine.api.urlfetch.HTTPRequest request, com.google.appengine.api.urlfetch.URLFetchService client, java.lang.Class<R> responseClass, com.google.gson.FieldNamingPolicy fieldNamingPolicy, long errorTimeOut, java.lang.Integer maxRetries, ExceptionsAllowedToRetry exceptionsAllowedToRetry, RequestMetrics metrics)
      参数:
      request - HTTP request to execute.
      client - The client used to execute the request.
      responseClass - Model class to unmarshal JSON body content.
      fieldNamingPolicy - FieldNamingPolicy for unmarshaling JSON.
      errorTimeOut - Number of milliseconds to re-send erroring requests.
      maxRetries - Number of times allowed to re-send erroring requests.
      exceptionsAllowedToRetry - exceptionsAllowedToRetry
      metrics - metrics
  • 方法详细资料

    • setCallback

      public void setCallback​(PendingResult.Callback<T> callback)
      从接口复制的说明: PendingResult
      Performs the request asynchronously, calling onResult or onFailure after the request has been completed.
      指定者:
      setCallback 在接口中 PendingResult<T>
      参数:
      callback - The callback to call on completion.
    • await

      public T await() throws ApiException, java.io.IOException, java.lang.InterruptedException
      从接口复制的说明: PendingResult
      Performs the request synchronously.
      指定者:
      await 在接口中 PendingResult<T>
      返回:
      The result.
      抛出:
      ApiException - Thrown if the API Returned result is an error.
      java.io.IOException - Thrown when an I/O exception of some sort has occurred.
      java.lang.InterruptedException - Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted.
    • awaitIgnoreError

      public T awaitIgnoreError()
      从接口复制的说明: PendingResult
      Performs the request synchronously, ignoring exceptions while performing the request and errors returned by the server.
      指定者:
      awaitIgnoreError 在接口中 PendingResult<T>
      返回:
      The result, or null if there was any error or exception ignored.
    • cancel

      public void cancel()
      从接口复制的说明: PendingResult
      Attempts to cancel the request.
      指定者:
      cancel 在接口中 PendingResult<T>