Package io.ably.lib.http
Class BasePaginatedQuery<T>
java.lang.Object
io.ably.lib.http.BasePaginatedQuery<T>
- Type Parameters:
-
T
-
- All Implemented Interfaces:
HttpCore.ResponseHandler<BasePaginatedResult<T>>
public class BasePaginatedQuery<T>
extends Object
implements HttpCore.ResponseHandler<BasePaginatedResult<T>>
A paginated query base implementation that can be used sync or asynchronously.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wraps a Http.Request<BasePaginatedResult> to fixate on either a sync or an async interface. -
Field Summary
-
Constructor Summary
ConstructorDescriptionBasePaginatedQuery
(Http http, String path, Param[] headers, Param[] params, HttpCore.BodyHandler<T> bodyHandler) Construct a PaginatedQueryBasePaginatedQuery
(Http http, String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.BodyHandler<T> bodyHandler) Construct a PaginatedQuery -
Method Summary
Modifier and TypeMethodDescriptionGet the result of the first queryget()
Get the result of the first queryhandleResponse
(HttpCore.Response response, ErrorInfo error) parseLinks
(Collection<String> linkHeaders)
-
Field Details
-
linkPattern
internal -
urlPattern
-
-
Constructor Details
-
BasePaginatedQuery
public BasePaginatedQuery(Http http, String path, Param[] headers, Param[] params, HttpCore.BodyHandler<T> bodyHandler) Construct a PaginatedQuery- Parameters:
-
http
- the http instance -
path
- the path of the resource being queried -
headers
- headers to pass into the first and all relative queries -
params
- params to pass into the initial query -
bodyHandler
- handler to parse response bodies for first and all relative queries
-
BasePaginatedQuery
public BasePaginatedQuery(Http http, String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.BodyHandler<T> bodyHandler) Construct a PaginatedQuery- Parameters:
-
http
- the http instance -
path
- the path of the resource being queried -
headers
- headers to pass into the first and all relative queries -
params
- params to pass into the initial query -
bodyHandler
- handler to parse response bodies for first and all relative queries
-
-
Method Details
-
get
Get the result of the first query- Returns:
- A ResultRequest
giving the first page of results together with any available links to related results pages.
-
exec
Get the result of the first query- Returns:
- A Http.Request<BasePaginatedResult
> giving the first page of results together with any available links to related results pages.
-
handleResponse
public BasePaginatedResult<T> handleResponse(HttpCore.Response response, ErrorInfo error) throws AblyException - Specified by:
-
handleResponse
in interfaceHttpCore.ResponseHandler<T>
- Throws:
AblyException
-
parseLinks
-