public class APIRequest<T extends APINode> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
APIRequest.DefaultRequestExecutor |
static interface |
APIRequest.IRequestExecutor |
static interface |
APIRequest.ResponseParser<T extends APINode> |
| 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 APIRequest.IRequestExecutor getExecutor()
public APIResponse getLastResponse()
public APIResponse parseResponse(String response) throws APIException
APIExceptionpublic APIResponse execute() throws APIException
APIExceptionpublic APIResponse execute(Map<String,Object> extraParams) throws APIException
APIExceptionpublic 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 String executeInternal() throws APIException
APIExceptionprotected String executeInternal(Map<String,Object> extraParams) throws APIException
APIExceptionpublic APIContext getContext()
public void setContext(APIContext context)
protected void requestFieldInternal(String field, boolean value)
public APIRequest addToBatch(BatchRequest batch)
public APIRequest addToBatch(BatchRequest batch, String name)
Copyright © 2017. All rights reserved.