public abstract class BaseRequest extends java.lang.Object implements IHttpRequest
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<FunctionOption> |
functionOptions
The function options for this request
|
protected java.util.List<QueryOption> |
queryOptions
The query options for this request
|
static java.lang.String |
REQUEST_STATS_HEADER_VALUE_FORMAT_STRING
The request stats header value format string
|
| Constructor and Description |
|---|
BaseRequest(java.lang.String requestUrl,
IBaseClient client,
java.util.List<? extends Option> options,
java.lang.Class<?> responseClass)
Creates the request
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFunctionOption(FunctionOption option)
Adds a function option
|
void |
addHeader(java.lang.String header,
java.lang.String value)
Adds a header to this request
|
void |
addQueryOption(QueryOption option)
Adds a query option
|
IBaseClient |
getClient()
Gets the client
|
long |
getDelay()
Gets delay between retries
|
java.util.List<FunctionOption> |
getFunctionOptions()
Gets the function options for this request
|
java.util.List<HeaderOption> |
getHeaders()
Gets the headers
|
HttpMethod |
getHttpMethod()
Gets the HTTP method
|
int |
getMaxRedirects()
Gets the max redirects
|
int |
getMaxRetries()
Gets max retries
|
java.util.List<Option> |
getOptions()
Gets the full list of options for this request
|
java.util.List<QueryOption> |
getQueryOptions()
Gets the query options for this request
|
java.net.URL |
getRequestUrl()
Gets the request URL
|
java.lang.Class<?> |
getResponseType()
Gets the response type
|
com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect |
getShouldRedirect()
Gets the should redirect callback
|
com.microsoft.graph.httpcore.middlewareoption.IShouldRetry |
getShouldRetry()
Gets the should retry callback
|
boolean |
getUseCaches()
Gets useCaches parameter
|
protected <T1,T2> void |
send(HttpMethod method,
ICallback<T1> callback,
T2 serializedObject)
Sends this request
|
protected <T1,T2> T1 |
send(HttpMethod method,
T2 serializedObject)
Sends this request
|
void |
setDelay(long delay)
Sets the delay in seconds between retires
|
void |
setHttpMethod(HttpMethod httpMethod)
Sets the HTTP method
|
void |
setMaxRedirects(int maxRedirects)
Sets the max redirects
|
void |
setMaxRetries(int maxRetries)
Sets the max retries
|
void |
setShouldRedirect(com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect shouldRedirect)
Sets the should redirect callback
|
void |
setShouldRetry(com.microsoft.graph.httpcore.middlewareoption.IShouldRetry shouldretry)
Sets the should retry callback
|
void |
setUseCaches(boolean useCaches)
Sets useCaches parameter to cache the response
|
public static final java.lang.String REQUEST_STATS_HEADER_VALUE_FORMAT_STRING
protected final java.util.List<QueryOption> queryOptions
protected final java.util.List<FunctionOption> functionOptions
public BaseRequest(java.lang.String requestUrl,
IBaseClient client,
java.util.List<? extends Option> options,
java.lang.Class<?> responseClass)
requestUrl - the URL to make the request againstclient - the client which can issue the requestoptions - the options for this requestresponseClass - the class for the responsepublic java.net.URL getRequestUrl()
getRequestUrl in interface IHttpRequestpublic HttpMethod getHttpMethod()
getHttpMethod in interface IHttpRequestpublic java.util.List<HeaderOption> getHeaders()
getHeaders in interface IHttpRequestpublic void addHeader(java.lang.String header,
java.lang.String value)
addHeader in interface IHttpRequestheader - the name of the headervalue - the value of the headerpublic void setUseCaches(boolean useCaches)
setUseCaches in interface IHttpRequestuseCaches - the value of useCachespublic boolean getUseCaches()
getUseCaches in interface IHttpRequestprotected <T1,T2> void send(HttpMethod method, ICallback<T1> callback, T2 serializedObject)
T1 - the type of the callback resultT2 - the type of the serialized bodymethod - the HTTP methodcallback - the callback when this request complementsserializedObject - the object to serialize as the bodyprotected <T1,T2> T1 send(HttpMethod method, T2 serializedObject) throws ClientException
T1 - the type of the callback resultT2 - the type of the serialized bodymethod - the HTTP methodserializedObject - the object to serialize as the bodyClientException - an exception occurs if there was an error while the request was sentpublic java.util.List<QueryOption> getQueryOptions()
public java.util.List<FunctionOption> getFunctionOptions()
public java.util.List<Option> getOptions()
getOptions in interface IHttpRequestpublic void addQueryOption(QueryOption option)
option - the query option to addpublic void addFunctionOption(FunctionOption option)
option - the function option to addpublic void setHttpMethod(HttpMethod httpMethod)
httpMethod - the HTTP methodpublic IBaseClient getClient()
public java.lang.Class<?> getResponseType()
public void setMaxRedirects(int maxRedirects)
setMaxRedirects in interface IHttpRequestmaxRedirects - Max redirects that a request can takepublic int getMaxRedirects()
getMaxRedirects in interface IHttpRequestpublic void setShouldRedirect(com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect shouldRedirect)
setShouldRedirect in interface IHttpRequestshouldRedirect - Callback called before doing a redirectpublic com.microsoft.graph.httpcore.middlewareoption.IShouldRedirect getShouldRedirect()
getShouldRedirect in interface IHttpRequestpublic void setShouldRetry(com.microsoft.graph.httpcore.middlewareoption.IShouldRetry shouldretry)
setShouldRetry in interface IHttpRequestshouldretry - The callback called before retrypublic com.microsoft.graph.httpcore.middlewareoption.IShouldRetry getShouldRetry()
getShouldRetry in interface IHttpRequestpublic void setMaxRetries(int maxRetries)
setMaxRetries in interface IHttpRequestmaxRetries - Max retries for a requestpublic int getMaxRetries()
getMaxRetries in interface IHttpRequestpublic void setDelay(long delay)
setDelay in interface IHttpRequestdelay - Delay in seconds between retriespublic long getDelay()
getDelay in interface IHttpRequest