public class EvrythngServiceBase extends Object
| Constructor and Description |
|---|
EvrythngServiceBase(ApiManager api)
Creates a new instance of
EvrythngServiceBase using the provided
ApiManager. |
| Modifier and Type | Method and Description |
|---|---|
protected URI |
absoluteUri(String relativePath)
Builds an absolute
URI using the provided relativePath
and the predefined ApiConfiguration.getUrl(). |
EvrythngApiBuilder.Builder<Boolean> |
delete(String relativePath)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing DELETE requests. |
EvrythngApiBuilder.Builder<Long> |
deleteMultiple(String relativePath)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing bulk DELETE
requests. |
protected String |
encodeBase64(InputStream image,
String mime) |
<T> EvrythngApiBuilder.Builder<T> |
get(String relativePath,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing GET requests. |
ApiConfiguration |
getConfig() |
protected <T> EvrythngApiBuilder.Builder<Iterator<org.pcollections.PVector<T>>> |
iterator(String relativePath,
com.fasterxml.jackson.core.type.TypeReference<List<T>> pageType) |
protected String |
mqttUrl() |
protected void |
onBuilderCreated(EvrythngApiBuilder.Builder<?> builder) |
<T> EvrythngApiBuilder.Builder<T> |
post(String relativePath,
Object data,
Status expected,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing POST requests. |
<T> EvrythngApiBuilder.Builder<T> |
post(String relativePath,
Object data,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing POST requests. |
EvrythngApiBuilder.Builder<AcceptedResourceResponse> |
postAsynchronously(String relativePath,
Object data,
Pattern pattern) |
<T> EvrythngApiBuilder.Builder<T> |
postMultipart(String relativePath,
File file,
Status expected,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for uploading file via POST
requests |
<T> EvrythngApiBuilder.Builder<T> |
postMultipart(String relativePath,
File file,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for uploading file via POST requests |
<T> EvrythngApiBuilder.Builder<T> |
put(String relativePath,
Object data,
Status expected,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing PUT requests. |
<T> EvrythngApiBuilder.Builder<T> |
put(String relativePath,
Object data,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing PUT requests. |
<T> EvrythngApiBuilder.Builder<T> |
putMultipart(String relativePath,
File file,
Status expected,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for uploading file via PUT
requests |
<T> EvrythngApiBuilder.Builder<T> |
putMultipart(String relativePath,
File file,
com.fasterxml.jackson.core.type.TypeReference<T> type)
Returns a preconfigured
EvrythngApiBuilder.Builder for uploading file via PUT requests |
EvrythngApiBuilder.Builder<Long> |
putMultiple(String relativePath,
Object data)
Returns a preconfigured
EvrythngApiBuilder.Builder for executing PUT requests. |
protected static String |
urlEncodePathPart(String s) |
public EvrythngServiceBase(ApiManager api)
EvrythngServiceBase using the provided
ApiManager.api - the ApiManager for accessing the API service.protected final <T> EvrythngApiBuilder.Builder<Iterator<org.pcollections.PVector<T>>> iterator(String relativePath, com.fasterxml.jackson.core.type.TypeReference<List<T>> pageType) throws EvrythngClientException
EvrythngClientExceptionpublic <T> EvrythngApiBuilder.Builder<T> post(String relativePath, Object data, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing POST requests.
Expects
201 (created) return coderelativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.data - the content data that will be associated with the POST requesttype - the TypeReference for mapping the HttpResponse
entity.EvrythngApiBuilder.Builder for executing POST requestsEvrythngClientExceptionEvrythngApiBuilder.post(String, URI, Object, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> post(String relativePath, Object data, Status expected, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing POST requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.data - the content data that will be associated with the POST requestexpected - The expected return statustype - the TypeReference for mapping the HttpResponse
entity.EvrythngApiBuilder.Builder for executing POST requestsEvrythngClientExceptionEvrythngApiBuilder.post(String, URI, Object, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> postMultipart(String relativePath, File file, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for uploading file via POST requestsrelativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.file - filetype - the TypeReference for mapping the HttpResponse entityEvrythngApiBuilder.Builder for executing POST requestsEvrythngClientExceptionpostMultipart(String, File, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> postMultipart(String relativePath, File file, Status expected, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for uploading file via POST
requestsrelativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.file - fileexpected - expected return Statustype - the TypeReference for mapping the HttpResponse entityEvrythngApiBuilder.Builder for executing POST requestsEvrythngClientExceptionpublic <T> EvrythngApiBuilder.Builder<T> putMultipart(String relativePath, File file, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for uploading file via PUT requestsrelativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.file - filetype - the TypeReference for mapping the HttpResponse entityEvrythngApiBuilder.Builder for executing PUT requestsEvrythngClientExceptionpostMultipart(String, File, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> putMultipart(String relativePath, File file, Status expected, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for uploading file via PUT
requestsrelativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.file - fileexpected - expected return Statustype - the TypeReference for mapping the HttpResponse entityEvrythngApiBuilder.Builder for executing PUT requestsEvrythngClientExceptionpublic EvrythngApiBuilder.Builder<AcceptedResourceResponse> postAsynchronously(String relativePath, Object data, Pattern pattern) throws EvrythngClientException
EvrythngClientExceptionpublic <T> EvrythngApiBuilder.Builder<T> get(String relativePath, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing GET requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.type - the TypeReference for mapping the HttpResponse
entity.EvrythngApiBuilder.Builder for executing GET requestsEvrythngClientExceptionEvrythngApiBuilder.get(String, URI, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> put(String relativePath, Object data, Status expected, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing PUT requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.data - the content data that will be associated with the PUT requestexpected - the expected Status code of the future request. Will be
checked.type - the TypeReference for mapping the HttpResponse
entity.EvrythngApiBuilder.Builder for executing PUT requestsEvrythngClientExceptionEvrythngApiBuilder.post(String, URI, Object, Status, TypeReference)public <T> EvrythngApiBuilder.Builder<T> put(String relativePath, Object data, com.fasterxml.jackson.core.type.TypeReference<T> type) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing PUT requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.data - the content data that will be associated with the PUT requesttype - the TypeReference for mapping the HttpResponse
entity.EvrythngApiBuilder.Builder for executing PUT requestsEvrythngClientExceptionEvrythngApiBuilder.put(String, URI, Object, Status, TypeReference)public EvrythngApiBuilder.Builder<Long> putMultiple(String relativePath, Object data) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing PUT requests.
The reference return type is Long, and will contain the amount of updated
documents.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.data - the content data that will be associated with the PUT requestEvrythngApiBuilder.Builder for executing PUT requestsEvrythngClientExceptionEvrythngApiBuilder.putMultiple(String, URI, Object, Status)public EvrythngApiBuilder.Builder<Boolean> delete(String relativePath) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing DELETE requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.EvrythngApiBuilder.Builder for executing DELETE requestsEvrythngClientExceptionEvrythngApiBuilder.post(String, URI, Object, Status, TypeReference)public EvrythngApiBuilder.Builder<Long> deleteMultiple(String relativePath) throws EvrythngClientException
EvrythngApiBuilder.Builder for executing bulk DELETE
requests.relativePath - the relative path of the API endpoint. It will be appended to
ApiConfiguration.getUrl() in
order to build the absolute endpoint URL.EvrythngApiBuilder.Builder for executing DELETE requestsEvrythngClientExceptionEvrythngApiBuilder.deleteMultiple(String, URI, Status)protected URI absoluteUri(String relativePath) throws EvrythngClientException
URI using the provided relativePath
and the predefined ApiConfiguration.getUrl().relativePath - the relative path that will be appended to
ApiConfiguration.getUrl() in order to build the
absolute endpoint URL.URIEvrythngClientExceptionprotected String mqttUrl() throws EvrythngClientException
EvrythngClientExceptionpublic ApiConfiguration getConfig()
protected void onBuilderCreated(EvrythngApiBuilder.Builder<?> builder)
protected String encodeBase64(InputStream image, String mime) throws IOException
IOExceptionCopyright © 2016 EVRYTHNG Ltd London / Zurich. All rights reserved.