Package io.ably.lib.http
Class HttpScheduler
java.lang.Object
io.ably.lib.http.HttpScheduler
- All Implemented Interfaces:
 AutoCloseable
- Direct Known Subclasses:
 - 
AsyncHttpScheduler,SyncHttpScheduler 
HttpScheduler schedules HttpCore operations to an Executor, exposing a generic async API.
 Internal; use Http instead.
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpScheduler(HttpCore httpCore, CloseableExecutor executor)  - 
Method Summary
Modifier and TypeMethodDescription<T> Future<T>ablyHttpExecuteWithFallback(String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Make an asynchronous HTTP request to an Ably endpoint, using the Ably auth credentials and fallback hosts if necessary<T> Future<T>ablyHttpExecuteWithRetry(String host, String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Make an asynchronous HTTP request to an Ably endpoint, using the Ably auth credentials and reauthentication if necessaryvoidclose()<T> Future<T>del(String path, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP DEL for Ably host, with fallbacks<T> Future<T>exec(String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP request for Ably host, with fallbacksvoid<T> Future<T>get(String path, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP GET for Ably host, with fallbacks<T> Future<T>httpExecute(URL url, String method, Param[] headers, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, Callback<T> callback) Make an asynchronous HTTP request to a given URL<T> Future<T>patch(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP PATCH for Ably host, with fallbacks<T> Future<T>post(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP POST for Ably host, with fallbacks<T> Future<T>put(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP PUT for Ably host, with fallbacks 
- 
Field Details
- 
executor
 - 
TAG
 
 - 
 - 
Constructor Details
- 
HttpScheduler
 
 - 
 - 
Method Details
- 
get
public <T> Future<T> get(String path, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP GET for Ably host, with fallbacks- Parameters:
 - 
path- - 
headers- - 
params- - 
responseHandler- - 
callback- 
 - 
put
public <T> Future<T> put(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP PUT for Ably host, with fallbacks- Parameters:
 - 
path- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- 
 - 
post
public <T> Future<T> post(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP POST for Ably host, with fallbacks- Parameters:
 - 
path- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- 
 - 
patch
public <T> Future<T> patch(String path, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP PATCH for Ably host, with fallbacks- Parameters:
 - 
path- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- 
 - 
del
public <T> Future<T> del(String path, Param[] headers, Param[] params, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP DEL for Ably host, with fallbacks- Parameters:
 - 
path- - 
headers- - 
params- - 
responseHandler- - 
callback- 
 - 
exec
public <T> Future<T> exec(String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Async HTTP request for Ably host, with fallbacks- Parameters:
 - 
path- - 
method- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- 
 - 
close
- Specified by:
 - 
closein interfaceAutoCloseable - Throws:
 Exception
 - 
httpExecute
public <T> Future<T> httpExecute(URL url, String method, Param[] headers, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, Callback<T> callback) Make an asynchronous HTTP request to a given URL- Parameters:
 - 
url- - 
method- - 
headers- - 
requestBody- - 
responseHandler- - 
callback- - Returns:
 
 - 
ablyHttpExecuteWithFallback
public <T> Future<T> ablyHttpExecuteWithFallback(String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Make an asynchronous HTTP request to an Ably endpoint, using the Ably auth credentials and fallback hosts if necessary- Parameters:
 - 
path- - 
method- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- - Returns:
 
 - 
ablyHttpExecuteWithRetry
public <T> Future<T> ablyHttpExecuteWithRetry(String host, String path, String method, Param[] headers, Param[] params, HttpCore.RequestBody requestBody, HttpCore.ResponseHandler<T> responseHandler, boolean requireAblyAuth, Callback<T> callback) Make an asynchronous HTTP request to an Ably endpoint, using the Ably auth credentials and reauthentication if necessary- Parameters:
 - 
host- - 
path- - 
method- - 
headers- - 
params- - 
requestBody- - 
responseHandler- - 
callback- - Returns:
 
 - 
execute
- Parameters:
 - 
runnable- The code to be executed. 
 
 -