public class DataService extends Object
Modifier | Constructor and Description |
---|---|
protected |
DataService()
Hiding the default constructor as Context is always required to function properly
|
|
DataService(Context context)
Constructor DataService
|
Modifier and Type | Method and Description |
---|---|
<T extends IEntity> |
add(T entity)
Method to add the given entity
|
<T extends IEntity> |
addAsync(T entity,
CallbackHandler callbackHandler)
Method to add the given entity in asynchronous fashion
|
<T extends IEntity> |
delete(T entity)
Method to delete record for the given entity
|
<T extends IEntity> |
deleteAsync(T entity,
CallbackHandler callbackHandler)
Method to delete record for the given entity in asynchronous fashion
|
<T extends IEntity> |
donotUpdateAccountOnTxns(T entity) |
<T extends IEntity> |
download(T entity)
Method to find the record for the given id for the corresponding entity
|
<T extends IEntity> |
downloadAsync(T entity,
CallbackHandler callbackHandler)
Method to download the file for the given entity id in asynchronous fashion
|
<T extends IEntity> |
downloadPDF(T entity) |
<T extends IEntity> |
downloadPDFAsync(T entity,
CallbackHandler callbackHandler)
Method to download the file for the given entity id in asynchronous fashion
|
protected void |
executeAsyncInterceptors(IntuitMessage intuitMessage)
Invokes async interceptors, which creates thread and perform networking
|
void |
executeBatch(BatchOperation batchOperation)
Method to execute the batch operation
|
void |
executeBatchAsync(BatchOperation batchOperation,
CallbackHandler callbackHandler)
Method to cancel the operation for the corresponding entity in asynchronous fashion
|
List<CDCQueryResult> |
executeCDCQuery(List<? extends IEntity> entities,
String changedSince)
Method to retrieve the list of records for the given entities whose last modified date is greater than the given changedSince date
|
void |
executeCDCQueryAsync(List<? extends IEntity> entities,
String changedSince,
CallbackHandler callbackHandler)
Method to retrieve records for the given list of query in asynchronous fashion
|
protected void |
executeInterceptors(IntuitMessage intuitMessage)
Invokes interceptors, which perform networking operations (serialization, compression, connection etc)
|
protected void |
executeInterceptors(List<IntuitMessage> intuitMessages)
Invokes interceptors, which perform networking operations (serialization, compression, connection etc)
|
QueryResult |
executeQuery(String query)
Method to retrieve records for the given list of query
|
void |
executeQueryAsync(String query,
CallbackHandler callbackHandler)
Method to retrieve records for the given list of query in asynchronous fashion
|
<T extends IEntity> |
findAll(T entity)
Method to retrieve all records for the given entity
Note, without pagination this will return only 100 records
Use query API to add pagintion and obtain additional records
|
<T extends IEntity> |
findAllAsync(T entity,
CallbackHandler callbackHandler)
Method to retrieve all records for the given entity in asynchronous fashion
Note, without pagination this will return only 100 records
Use query API to add pagintion and obtain additional records
|
<T extends IEntity> |
findById(T entity)
Method to find the record for the given id for the corresponding entity
|
<T extends IEntity> |
findByIdAsync(T entity,
CallbackHandler callbackHandler)
Method to find the record for the given id for the corresponding entity in asynchronous fashion
|
protected CDCQueryResult |
getCDCQueryResult(CDCResponse cdcResponse)
Method to construct and return the CDCQueryResult object from CDCResponse
|
protected List<CDCQueryResult> |
getCDCQueryResult(List<CDCResponse> cdcResponses)
Method to get the list of CDCQueryResult object from list of CDCResponse
|
protected QueryResult |
getQueryResult(QueryResponse queryResponse)
Method to read the query response from QueryResponse and set into QueryResult
|
protected <T extends IEntity> |
getSerializableObject(T object)
Method to get the serializable object for the given entity
|
protected <T> Object |
getSerializableRequestObject(T object)
Method to get the JAXBElement, using ObjectFactory, to serialize the request
|
<T extends IEntity> |
isAvailableAsPDF(T entity)
Returns true if the entity can be downloaded as PDF
|
<T extends IEntity> |
isAvailableToEmail(T entity)
Returns true if the entity can be send as email
|
<T extends IEntity> |
sendEmail(T entity)
Send entity via email using address associated with this entity in the system
|
<T extends IEntity> |
sendEmail(T entity,
String email)
Send entity via email using specified address
|
<T extends IEntity> |
sendEmailAsync(T entity,
CallbackHandler callbackHandler)
Method to send the entity to default email for the given id in asynchronous fashion
|
<T extends IEntity> |
sendEmailAsync(T entity,
String email,
CallbackHandler callbackHandler)
Method to send the entity to email for the given id in asynchronous fashion
|
<T extends IEntity> |
update(T entity)
Method to update the record of the corresponding entity
|
<T extends IEntity> |
updateAccountOnTxns(T entity) |
<T extends IEntity> |
updateAsync(T entity,
CallbackHandler callbackHandler)
Method to update the record of the corresponding entity in asynchronous fashion
|
<T extends IEntity> |
upload(List<UploadEntry> entries)
Method to upload entities with their correspond binary
|
<T extends IEntity> |
upload(T entity,
InputStream docContent)
Method to upload the given document content for the corresponding entity
|
<T extends IEntity> |
uploadAsync(T entity,
InputStream docContent,
CallbackHandler callbackHandler)
Method to upload the file for the given entity in asynchronous fashion
|
<T extends IEntity> |
voidRequest(T entity)
Method to cancel the operation for the corresponding entity
|
<T extends IEntity> |
voidRequestAsync(T entity,
CallbackHandler callbackHandler)
Method to cancel the operation for the corresponding entity in asynchronous fashion
|
protected DataService()
public DataService(Context context)
context
- the contextpublic <T extends IEntity> List<T> findAll(T entity) throws FMSException
entity
- the entityFMSException
- throws FMSExceptionpublic <T extends IEntity> T add(T entity) throws FMSException
entity
- the entityFMSException
- throws FMSExceptionprotected void executeInterceptors(IntuitMessage intuitMessage) throws FMSException
intuitMessage
- FMSException
protected void executeInterceptors(List<IntuitMessage> intuitMessages) throws FMSException
intuitMessages
- FMSException
protected void executeAsyncInterceptors(IntuitMessage intuitMessage)
intuitMessage
- public <T extends IEntity> T delete(T entity) throws FMSException
entity
- the entityFMSException
public <T extends IEntity> T update(T entity) throws FMSException
entity
- the entityFMSException
public <T extends IEntity> T updateAccountOnTxns(T entity) throws FMSException
FMSException
public <T extends IEntity> T donotUpdateAccountOnTxns(T entity) throws FMSException
FMSException
public <T extends IEntity> T findById(T entity) throws FMSException
entity
- FMSException
public <T extends IEntity> T voidRequest(T entity) throws FMSException
entity
- FMSException
public <T extends IEntity> T upload(T entity, InputStream docContent) throws FMSException
entity
- the entityFMSException
public <T extends IEntity> List<T> upload(List<UploadEntry> entries) throws FMSException
T
- entries
- FMSException
public <T extends IEntity> InputStream download(T entity) throws FMSException
entity
- FMSException
public <T extends IEntity> InputStream downloadPDF(T entity) throws FMSException
FMSException
public <T extends IEntity> T sendEmail(T entity) throws FMSException
T
- entity
- FMSException
public <T extends IEntity> T sendEmail(T entity, String email) throws FMSException
T
- entity
- email
- FMSException
public <T extends IEntity> boolean isAvailableAsPDF(T entity)
T
- entity
- public <T extends IEntity> boolean isAvailableToEmail(T entity)
T
- entity
- public QueryResult executeQuery(String query) throws FMSException
query
- the query stringFMSException
- throws FMSExceptionpublic List<CDCQueryResult> executeCDCQuery(List<? extends IEntity> entities, String changedSince) throws FMSException
entities
- the list of entities to be listed in the responsechangedSince
- the date where the entities should be listed from the last changed dateFMSException
- throws FMSExceptionpublic void executeBatch(BatchOperation batchOperation) throws FMSException
batchOperation
- the batch operationFMSException
- throws FMSExceptionpublic <T extends IEntity> void findAllAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends IEntity> void addAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends IEntity> void deleteAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends IEntity> void updateAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends IEntity> void findByIdAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends IEntity> void voidRequestAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends IEntity> void uploadAsync(T entity, InputStream docContent, CallbackHandler callbackHandler) throws FMSException
entity
- the entitydocContent
- the content of the file to uploadcallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends IEntity> void downloadAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends IEntity> void downloadPDFAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends IEntity> void sendEmailAsync(T entity, CallbackHandler callbackHandler) throws FMSException
T
- entity
- callbackHandler
- FMSException
public <T extends IEntity> void sendEmailAsync(T entity, String email, CallbackHandler callbackHandler) throws FMSException
entity
- the entityemail
- the mail stringcallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic void executeQueryAsync(String query, CallbackHandler callbackHandler) throws FMSException
query
- callbackHandler
- the callback handlerFMSException
public void executeCDCQueryAsync(List<? extends IEntity> entities, String changedSince, CallbackHandler callbackHandler) throws FMSException
entities
- the list of entities to be listed in the responsechangedSince
- the date where the entities should be listed from the last changed datecallbackHandler
- the callback handlerFMSException
public void executeBatchAsync(BatchOperation batchOperation, CallbackHandler callbackHandler) throws FMSException
batchOperation
- the batch operationcallbackHandler
- the callback handlerFMSException
protected <T extends IEntity> Object getSerializableObject(T object) throws FMSException
object
- the entity objectFMSException
protected <T> Object getSerializableRequestObject(T object) throws FMSException
object
- the object to be converted to JAXBElementFMSException
protected QueryResult getQueryResult(QueryResponse queryResponse)
queryResponse
- the query responseprotected List<CDCQueryResult> getCDCQueryResult(List<CDCResponse> cdcResponses)
cdcResponses
- the cdc responses listprotected CDCQueryResult getCDCQueryResult(CDCResponse cdcResponse)
cdcResponse
- the CDC Response objectCopyright © 2017. All rights reserved.