Package org.azd.http
Class ClientRequest
java.lang.Object
org.azd.http.ClientRequest
- Direct Known Subclasses:
ClientRequestAdapter
Request builder invalid input: '&' executor that builds and executes the request for given parameters.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract AccessTokenCredential
Returns the access token credential used to construct and execute the requests.static ClientRequest.Builder
builder()
Client request builder to build the request information such as url and headers.static ClientRequest.Builder
builder
(AccessTokenCredential accessTokenCredential) Client request builder to build the request information such as url and headers.abstract <T extends SerializableEntity>
TExecutes the request built by ClientRequest.Builder and deserializes the response for given entity/model.abstract <T extends SerializableEntity>
CompletableFuture<T>executeAsync
(Class<T> model) Executes the request built by ClientRequest.Builder and deserializes the response for given entity/model.abstract Void
Executes the request built by ClientRequest.Builder and doesn't return any response.abstract CompletableFuture<Void>
Executes the request built by ClientRequest.Builder and doesn't return any response.abstract InputStream
Executes the request built by ClientRequest.Builder and return the input stream of object.abstract CompletableFuture<InputStream>
Executes the request built by ClientRequest.Builder and return the input stream of object.abstract String
Executes the request built by ClientRequest.Builder and returns the response.abstract CompletableFuture<String>
Executes the request built by ClientRequest.Builder and returns the response.abstract RequestInformation
request()
Returns the request information constructed by ClientRequest.Builder.
-
Constructor Details
-
ClientRequest
protected ClientRequest()Default constructor.
-
-
Method Details
-
builder
Client request builder to build the request information such as url and headers.- Parameters:
accessTokenCredential
- Access token credential object.AccessTokenCredential
- Returns:
- Client request builder.
ClientRequest.Builder
-
builder
Client request builder to build the request information such as url and headers.- Returns:
- Client request builder.
ClientRequest.Builder
-
execute
Executes the request built by ClientRequest.Builder and deserializes the response for given entity/model.- Parameters:
model
- Represents the entity or model for which the response should be deserialized to.- Returns:
- Deserialized POJO model.
- Throws:
AzDException
- Default Api exception handler.
-
executeAsync
public abstract <T extends SerializableEntity> CompletableFuture<T> executeAsync(Class<T> model) throws AzDException Executes the request built by ClientRequest.Builder and deserializes the response for given entity/model.- Parameters:
model
- Represents the entity or model for which the response should be deserialized to.- Returns:
- Deserialized POJO model of future object.
- Throws:
AzDException
- Default Api exception handler.
-
executeStringAsync
Executes the request built by ClientRequest.Builder and returns the response.- Returns:
- Future string object.
- Throws:
AzDException
- Default Api exception handler.
-
executeStreamAsync
Executes the request built by ClientRequest.Builder and return the input stream of object. If this is meant to be a zip file or any kind of stream, useStreamHelper
to download or convert the contents.- Returns:
- Input stream object.
- Throws:
AzDException
- Default Api exception handler.
-
executePrimitiveAsync
Executes the request built by ClientRequest.Builder and doesn't return any response. This is mainly used for Api calls that returns 201 or any operation that doesn't return response.- Returns:
- Future void.
- Throws:
AzDException
- Default Api exception handler.
-
executeString
Executes the request built by ClientRequest.Builder and returns the response.- Returns:
- String object.
- Throws:
AzDException
- Default Api exception handler.
-
executeStream
Executes the request built by ClientRequest.Builder and return the input stream of object. If this is meant to be a zip file or any kind of stream, useStreamHelper
to download or convert the contents.- Returns:
- Input stream object.
- Throws:
AzDException
- Default Api exception handler.
-
executePrimitive
Executes the request built by ClientRequest.Builder and doesn't return any response. This is mainly used for Api calls that returns 201 or any operation that doesn't return response.- Returns:
- Void.
- Throws:
AzDException
- Default Api exception handler.
-
request
Returns the request information constructed by ClientRequest.Builder.ClientRequest.Builder
- Returns:
- Request information object.
RequestInformation
-
accessTokenCredential
Returns the access token credential used to construct and execute the requests.- Returns:
- Access token credential object.
AccessTokenCredential
-