T1 - the raw response class returned by the serviceT2 - the class of the collection pagepublic abstract class BaseCollectionRequest<T1,T2> extends java.lang.Object implements IHttpRequest
| Constructor and Description |
|---|
BaseCollectionRequest(java.lang.String requestUrl,
IBaseClient client,
java.util.List<? extends Option> options,
java.lang.Class<T1> responseClass,
java.lang.Class<T2> collectionPageClass)
Create the collection request
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFunctionOption(FunctionOption option)
Adds a query 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
|
protected BaseRequest |
getBaseRequest()
Gets the base request for this collection request
|
java.lang.Class<T2> |
getCollectionPageClass()
Gets the class for the collection page
|
long |
getDelay()
Gets delay between retries
|
java.util.List<HeaderOption> |
getHeaders()
Gets the headers
|
HttpMethod |
getHttpMethod()
Gets the HTTP method
|
okhttp3.Request |
getHttpRequest()
Returns the Request object to be executed
|
<requestBodyType> |
getHttpRequest(requestBodyType serializedObject)
Returns the Request object to be executed
|
<requestBodyType,responseType> |
getHttpRequest(requestBodyType serializedObject,
IProgressCallback<responseType> progress)
Returns the Request object to be executed
|
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.net.URL |
getRequestUrl()
Gets the request URL
|
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 <BodyType> T1 |
post(BodyType serializedObject)
Posts this request
|
protected T1 |
send()
Send this request
|
void |
setDelay(long delay)
Sets the delay in seconds between retires
|
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
|
IHttpRequest |
withHttpMethod(HttpMethod httpMethod)
Sets the HTTP method and returns the current request
|
public BaseCollectionRequest(java.lang.String requestUrl,
IBaseClient client,
java.util.List<? extends Option> options,
java.lang.Class<T1> responseClass,
java.lang.Class<T2> collectionPageClass)
requestUrl - the URL to make the request againstclient - the client which can issue the requestoptions - the options for this requestresponseClass - the class for the responsecollectionPageClass - the class for the collection pageprotected T1 send() throws ClientException
ClientException - an exception occurs if there was an error while the request was sentprotected <BodyType> T1 post(BodyType serializedObject) throws ClientException
BodyType - the type of the serialized body, some times Action use different body than collection itemserializedObject - the object to serialize as the bodyClientException - an exception occurs if there was an error while the request was sentpublic 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 IHttpRequestpublic 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 query option to addprotected BaseRequest getBaseRequest()
public java.lang.Class<T2> getCollectionPageClass()
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 IHttpRequestpublic IHttpRequest withHttpMethod(HttpMethod httpMethod)
withHttpMethod in interface IHttpRequesthttpMethod - the HTTP methodpublic okhttp3.Request getHttpRequest()
throws ClientException
getHttpRequest in interface IHttpRequestClientExceptionpublic <requestBodyType> okhttp3.Request getHttpRequest(requestBodyType serializedObject)
throws ClientException
getHttpRequest in interface IHttpRequestrequestBodyType - the type of the serialized objectserializedObject - the object to serialize at the body of the requestClientExceptionpublic <requestBodyType,responseType> okhttp3.Request getHttpRequest(requestBodyType serializedObject,
IProgressCallback<responseType> progress)
throws ClientException
getHttpRequest in interface IHttpRequestrequestBodyType - the type of the serialized objectresponseType - the type of the response objectserializedObject - the object to serialize at the body of the requestprogress - the progress callbackClientException