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 com.intuit.ipp.core.IEntity> |
add(T entity)
Method to add the given entity
|
<T extends com.intuit.ipp.core.IEntity> |
addAsync(T entity,
CallbackHandler callbackHandler)
Method to add the given entity in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
delete(T entity)
Method to delete record for the given entity
|
<T extends com.intuit.ipp.core.IEntity> |
deleteAsync(T entity,
CallbackHandler callbackHandler)
Method to delete record for the given entity in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
donotUpdateAccountOnTxns(T entity) |
<T extends com.intuit.ipp.core.IEntity> |
download(T entity)
Method to find the record for the given id for the corresponding entity
|
<T extends com.intuit.ipp.core.IEntity> |
downloadAsync(T entity,
CallbackHandler callbackHandler)
Method to download the file for the given entity id in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
downloadPDF(T entity) |
<T extends com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> |
findById(T entity)
Method to find the record for the given id for the corresponding entity
|
<T extends com.intuit.ipp.core.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(com.intuit.ipp.data.CDCResponse cdcResponse)
Method to construct and return the CDCQueryResult object from CDCResponse
|
protected List<CDCQueryResult> |
getCDCQueryResult(List<com.intuit.ipp.data.CDCResponse> cdcResponses)
Method to get the list of CDCQueryResult object from list of CDCResponse
|
protected QueryResult |
getQueryResult(com.intuit.ipp.data.QueryResponse queryResponse)
Method to read the query response from QueryResponse and set into QueryResult
|
protected <T extends com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> |
isAvailableAsPDF(T entity)
Returns true if the entity can be downloaded as PDF
|
<T extends com.intuit.ipp.core.IEntity> |
isAvailableToEmail(T entity)
Returns true if the entity can be send as email
|
<T extends com.intuit.ipp.core.IEntity> |
sendEmail(T entity)
Send entity via email using address associated with this entity in the system
|
<T extends com.intuit.ipp.core.IEntity> |
sendEmail(T entity,
String email)
Send entity via email using specified address
|
<T extends com.intuit.ipp.core.IEntity> |
sendEmailAsync(T entity,
CallbackHandler callbackHandler)
Method to send the entity to default email for the given id in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
sendEmailAsync(T entity,
String email,
CallbackHandler callbackHandler)
Method to send the entity to email for the given id in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
update(T entity)
Method to update the record of the corresponding entity
|
<T extends com.intuit.ipp.core.IEntity> |
updateAccountOnTxns(T entity) |
<T extends com.intuit.ipp.core.IEntity> |
updateAsync(T entity,
CallbackHandler callbackHandler)
Method to update the record of the corresponding entity in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
upload(List<UploadEntry> entries)
Method to upload entities with their correspond binary
|
<T extends com.intuit.ipp.core.IEntity> |
upload(T entity,
InputStream docContent)
Method to upload the given document content for the corresponding entity
|
<T extends com.intuit.ipp.core.IEntity> |
uploadAsync(T entity,
InputStream docContent,
CallbackHandler callbackHandler)
Method to upload the file for the given entity in asynchronous fashion
|
<T extends com.intuit.ipp.core.IEntity> |
voidRequest(T entity)
Method to cancel the operation for the corresponding entity
|
<T extends com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> List<T> findAll(T entity) throws FMSException
entity
- the entityFMSException
- throws FMSExceptionpublic <T extends com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> T delete(T entity) throws FMSException
entity
- the entityFMSException
public <T extends com.intuit.ipp.core.IEntity> T update(T entity) throws FMSException
entity
- the entityFMSException
public <T extends com.intuit.ipp.core.IEntity> T updateAccountOnTxns(T entity) throws FMSException
FMSException
public <T extends com.intuit.ipp.core.IEntity> T donotUpdateAccountOnTxns(T entity) throws FMSException
FMSException
public <T extends com.intuit.ipp.core.IEntity> T findById(T entity) throws FMSException
entity
- FMSException
public <T extends com.intuit.ipp.core.IEntity> T voidRequest(T entity) throws FMSException
entity
- FMSException
public <T extends com.intuit.ipp.core.IEntity> T upload(T entity, InputStream docContent) throws FMSException
entity
- the entityFMSException
public <T extends com.intuit.ipp.core.IEntity> List<T> upload(List<UploadEntry> entries) throws FMSException
T
- entries
- FMSException
public <T extends com.intuit.ipp.core.IEntity> InputStream download(T entity) throws FMSException
entity
- FMSException
public <T extends com.intuit.ipp.core.IEntity> InputStream downloadPDF(T entity) throws FMSException
FMSException
public <T extends com.intuit.ipp.core.IEntity> T sendEmail(T entity) throws FMSException
T
- entity
- FMSException
public <T extends com.intuit.ipp.core.IEntity> T sendEmail(T entity, String email) throws FMSException
T
- entity
- email
- FMSException
public <T extends com.intuit.ipp.core.IEntity> boolean isAvailableAsPDF(T entity)
T
- entity
- public <T extends com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> void findAllAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends com.intuit.ipp.core.IEntity> void addAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends com.intuit.ipp.core.IEntity> void deleteAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends com.intuit.ipp.core.IEntity> void updateAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends com.intuit.ipp.core.IEntity> void findByIdAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends com.intuit.ipp.core.IEntity> void voidRequestAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
public <T extends com.intuit.ipp.core.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 com.intuit.ipp.core.IEntity> void downloadAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends com.intuit.ipp.core.IEntity> void downloadPDFAsync(T entity, CallbackHandler callbackHandler) throws FMSException
entity
- the entitycallbackHandler
- the callback handlerFMSException
- throws FMSExceptionpublic <T extends com.intuit.ipp.core.IEntity> void sendEmailAsync(T entity, CallbackHandler callbackHandler) throws FMSException
T
- entity
- callbackHandler
- FMSException
public <T extends com.intuit.ipp.core.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 com.intuit.ipp.core.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 com.intuit.ipp.core.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(com.intuit.ipp.data.QueryResponse queryResponse)
queryResponse
- the query responseprotected List<CDCQueryResult> getCDCQueryResult(List<com.intuit.ipp.data.CDCResponse> cdcResponses)
cdcResponses
- the cdc responses listprotected CDCQueryResult getCDCQueryResult(com.intuit.ipp.data.CDCResponse cdcResponse)
cdcResponse
- the CDC Response objectCopyright © 2018. All Rights Reserved.