public abstract class AsyncDatabaseConnector<T extends BusinessEntity> extends android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.String> implements DatabaseConnector
| Modifier and Type | Class and Description |
|---|---|
static class |
AsyncDatabaseConnector.Builder<B extends BusinessEntity>
A utility class useful to create an AsyncDatabaseConnector.
|
static interface |
AsyncDatabaseConnector.OnEndConnectionListener<T>
An interfaced to be used to create callback functions to be used to define the connector
behaviour on the connection's end.
|
static interface |
AsyncDatabaseConnector.OnStartConnectionListener
An interfaced to be used to create callback functions to be used to define the connector
behaviour on the connection's start.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) java.lang.String |
fileUrl |
| Modifier | Constructor and Description |
|---|---|
protected |
AsyncDatabaseConnector(AsyncDatabaseConnector.Builder<T> builder)
AsyncDatabaseConnector's constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
doInBackground(java.lang.Void... voids)
The function that sends and fetches the results.
|
protected void |
executeAfterConnection(java.lang.String s)
A function that will be executed after the connection ends.
|
void |
getData()
Get the data from the database.
|
protected void |
onPostExecute(java.lang.String s)
A function that will be called after the execution.
|
protected void |
onPreExecute()
A function that will be called before the execution.
|
protected void |
setError(java.lang.Exception error)
Se the AsyncDatabaseConnector's error.
|
protected AsyncDatabaseConnector(AsyncDatabaseConnector.Builder<T> builder)
builder - The Builder.AsyncDatabaseConnector.Builderprotected void onPreExecute()
onPreExecute in class android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.String>protected void onPostExecute(java.lang.String s)
onPostExecute in class android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.String>s - This string will contain the result of the connection.protected void executeAfterConnection(java.lang.String s)
s - A string containing the connection result.AsyncDatabaseConnector.OnEndConnectionListener.onEndConnection(List)protected java.lang.String doInBackground(java.lang.Void... voids)
doInBackground in class android.os.AsyncTask<java.lang.Void,java.lang.Void,java.lang.String>voids - Various parametersprotected void setError(java.lang.Exception error)
error - The error.public void getData()
DatabaseConnectorgetData in interface DatabaseConnectorDatabaseConnector.getData()