public class UniRestEngine extends java.lang.Object implements IRestEngine
UNIREST (see: http://unirest.io/java.html)
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MSG_REQUEST_HAS_BEEN_CANCELLED |
static java.lang.String |
MSG_REQUEST_HAS_FAILED |
static java.lang.String |
MSG_REQUEST_WAS_SUCCESSFUL |
static java.lang.String |
MSG_URL_IS_NULL
some constants
|
HEADER_ACCESS, HEADER_APP_JSON| Constructor and Description |
|---|
UniRestEngine() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(BreinConfig breinConfig)
configures the rest engine
|
BreinResult |
doLookup(BreinLookup breinLookup)
performs a lookup and provides details
|
BreinResult |
doRecommendation(BreinRecommendation breinRecommendation)
invokes a recommendation request
|
void |
doRequest(BreinActivity breinActivity,
java.util.function.Function<java.lang.String,java.lang.Void> errorCallback)
Invokes the asynchronous post call
|
BreinResult |
doTemporalDataRequest(BreinTemporalData breinTemporalData)
performs a temporalData request
|
BreinResult |
invokeRequest(BreinBase breinRequestObject)
invokes the request
|
void |
terminate()
used to stop the UNIREST threads
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFullyQualifiedUrl, getRequestBody, getRestEngine, isUrlValid, validate, validateBreinBase, validateConfig, validateUrlpublic static final java.lang.String MSG_URL_IS_NULL
public static final java.lang.String MSG_REQUEST_HAS_FAILED
public static final java.lang.String MSG_REQUEST_HAS_BEEN_CANCELLED
public static final java.lang.String MSG_REQUEST_WAS_SUCCESSFUL
public void configure(BreinConfig breinConfig)
configure in interface IRestEnginebreinConfig - configuration objectpublic void doRequest(BreinActivity breinActivity, java.util.function.Function<java.lang.String,java.lang.Void> errorCallback) throws BreinException
doRequest in interface IRestEnginebreinActivity - data to senderrorCallback - will be invoked in case of an errorBreinExceptionpublic BreinResult doLookup(BreinLookup breinLookup) throws BreinException
doLookup in interface IRestEnginebreinLookup - contains request dataBreinException - in case of an errorpublic void terminate()
terminate in interface IRestEnginepublic BreinResult doTemporalDataRequest(BreinTemporalData breinTemporalData) throws BreinException
doTemporalDataRequest in interface IRestEnginebreinTemporalData - contains the request dataBreinException - exception will be thrownpublic BreinResult doRecommendation(BreinRecommendation breinRecommendation) throws BreinException
doRecommendation in interface IRestEnginebreinRecommendation - contains the request dataBreinException - exceptionpublic BreinResult invokeRequest(BreinBase breinRequestObject)
breinRequestObject - contains the request dataCopyright © Breinify - All Rights Reserved.