public class APIRequest<T extends APINode> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
APIRequest.DefaultAsyncRequestExecutor |
static class |
APIRequest.DefaultRequestExecutor |
static interface |
APIRequest.IAsyncRequestExecutor |
static interface |
APIRequest.IRequestExecutor |
static class |
APIRequest.RequestHelper |
static interface |
APIRequest.ResponseParser<T extends APINode> |
static class |
APIRequest.ResponseWrapper |
Modifier and Type | Field and Description |
---|---|
protected APIContext |
context |
protected String |
endpoint |
protected String |
method |
protected String |
nodeId |
protected List<String> |
paramNames |
protected Map<String,Object> |
params |
protected APIRequest.ResponseParser<T> |
parser |
protected List<String> |
returnFields |
static String |
USER_AGENT |
protected boolean |
useVideoEndpoint |
Constructor and Description |
---|
APIRequest(APIContext context,
String nodeId,
String endpoint,
String method) |
APIRequest(APIContext context,
String nodeId,
String endpoint,
String method,
APIRequest.ResponseParser<T> parser) |
APIRequest(APIContext context,
String nodeId,
String endpoint,
String method,
List<String> paramNames) |
APIRequest(APIContext context,
String nodeId,
String endpoint,
String method,
List<String> paramNames,
APIRequest.ResponseParser<T> parser) |
public static final String USER_AGENT
protected APIContext context
protected boolean useVideoEndpoint
protected String nodeId
protected String endpoint
protected String method
protected APIRequest.ResponseParser<T extends APINode> parser
public APIRequest(APIContext context, String nodeId, String endpoint, String method)
public APIRequest(APIContext context, String nodeId, String endpoint, String method, APIRequest.ResponseParser<T> parser)
public APIRequest(APIContext context, String nodeId, String endpoint, String method, List<String> paramNames)
public APIRequest(APIContext context, String nodeId, String endpoint, String method, List<String> paramNames, APIRequest.ResponseParser<T> parser)
public static void changeRequestExecutor(APIRequest.IRequestExecutor newExecutor)
public static void changeAsyncRequestExecutor(APIRequest.IAsyncRequestExecutor newExecutor)
public static APIRequest.IRequestExecutor getExecutor()
public static APIRequest.IAsyncRequestExecutor getAsyncExecutor()
public APIResponse getLastResponse()
public APIResponse parseResponse(String response, String header) throws APIException
APIException
public APIResponse execute() throws APIException
APIException
public APIResponse execute(Map<String,Object> extraParams) throws APIException
APIException
public com.google.common.util.concurrent.ListenableFuture<APIResponse> executeAsyncBase() throws APIException
APIException
public com.google.common.util.concurrent.ListenableFuture<APIResponse> executeAsyncBase(Map<String,Object> extraParams) throws APIException
APIException
public APIRequest<T> setParam(String param, Object value)
public APIRequest setParams(Map<String,Object> params)
public APIRequest requestFields(List<String> fields)
public APIRequest requestFields(List<String> fields, boolean value)
public APIRequest requestField(String field)
public APIRequest requestField(String field, boolean value)
public APIRequest setUseVideoEndpoint(boolean useVideoEndpoint)
protected APIRequest.ResponseWrapper executeInternal() throws APIException
APIException
protected APIRequest.ResponseWrapper executeInternal(Map<String,Object> extraParams) throws APIException
APIException
protected com.google.common.util.concurrent.ListenableFuture<APIRequest.ResponseWrapper> executeAsyncInternal() throws APIException
APIException
protected com.google.common.util.concurrent.ListenableFuture<APIRequest.ResponseWrapper> executeAsyncInternal(Map<String,Object> extraParams) throws APIException
APIException
public APIContext getContext()
public void setContext(APIContext context)
public void setOverrideUrl(String url)
protected void requestFieldInternal(String field, boolean value)
public APIRequest addToBatch(BatchRequest batch)
public APIRequest addToBatch(BatchRequest batch, String name)
public APIRequest addToBatch(BatchRequest batch, String name, boolean omitResponseOnSuccess)
Copyright © 2020. All rights reserved.