public class SearchService
extends java.lang.Object
Constructor and Description |
---|
SearchService(MambuAPIService mambuAPIService)
Create a new search service
|
Modifier and Type | Method and Description |
---|---|
java.util.List<com.mambu.notifications.shared.model.NotificationMessage> |
getNotificationMessages(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Get a history of notification messages by specifying filter constraints
|
static ApiDefinition |
makeApiDefinitionForSearchByFilter(MambuEntityType searchEntityType)
Helper to create ApiDefintion for searching entities matching filter criteria
|
java.util.Map<com.mambu.core.shared.model.SearchType,java.util.List<com.mambu.core.shared.model.SearchResult>> |
search(java.lang.String query,
java.util.List<com.mambu.core.shared.model.SearchType> searchTypes,
java.lang.String limit)
Get a Map of search results
|
<T> java.util.List<T> |
searchEntities(MambuEntityType searchEntityType,
com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Deprecated.
|
<T> java.util.List<T> |
searchEntitiesWithBasicDetails(MambuEntityType searchEntityType,
com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Convenience method to GET Mambu entities by specifying filter constraints.
|
<T> java.util.List<T> |
searchEntitiesWithFullDetails(MambuEntityType searchEntityType,
com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints,
java.lang.String offset,
java.lang.String limit)
Convenience method to GET Mambu entities by specifying filter constraints.
|
@Inject public SearchService(MambuAPIService mambuAPIService)
mambuAPIService
- the service responsible with the connection to the serverpublic java.util.Map<com.mambu.core.shared.model.SearchType,java.util.List<com.mambu.core.shared.model.SearchResult>> search(java.lang.String query, java.util.List<com.mambu.core.shared.model.SearchType> searchTypes, java.lang.String limit) throws MambuApiException
query
- the string to querysearchTypes
- list, in brackets,separated by comma of search types to query. E.g. [CLIENT, GROUP]. Null if searching
for all types (defined by SearchType). The results of the query shall be limited to the specified
typeslimit
- maximum number of results to return. If null, Mambu defaults this to 100.MambuApiException
@Deprecated public <T> java.util.List<T> searchEntities(MambuEntityType searchEntityType, com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
ClientsService.getClients(JSONFilterConstraints, String, String)
Note: This method is deprecated, you may use the searchEntitiesWithFullDetails(MambuEntityType, JSONFilterConstraints, String, String)
in order to obtain entities
with full details (custom fields included) or searchEntitiesWithBasicDetails to obtain the entities in basic details level.
searchEntityType
- Mambu entity type. Must not be null. Currently searching with filter constrains API supports the
following entities: Clients, Groups, Loans, Savings, Loan Transactions, SavingsTransactions and
NotificationMessagesfilterConstraints
- JSONFilterConstraints object defining an array of applicable filter constraints and an optional sort
order. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case exception occurs while fetching entitiespublic <T> java.util.List<T> searchEntitiesWithBasicDetails(MambuEntityType searchEntityType, com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
ClientsService.getClients(JSONFilterConstraints, String, String)
Note: the retrieved entities will not contain custom fields. In case custom fields are needed
searchEntitiesWithFullDetails(MambuEntityType, JSONFilterConstraints, String, String)
must be usedsearchEntityType
- Mambu entity type. Must not be null. Currently searching with filter constrains API supports the
following entities: Clients, Groups, Loans, Savings, Loan Transactions, SavingsTransactions and
NotificationMessagesfilterConstraints
- JSONFilterConstraints object defining an array of applicable filter constraints and an optional sort
order. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case exception occurs while fetching entitiespublic <T> java.util.List<T> searchEntitiesWithFullDetails(MambuEntityType searchEntityType, com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
ClientsService.getClients(JSONFilterConstraints, String, String)
searchEntityType
- Mambu entity type. Must not be null. Currently searching with filter constrains API supports the
following entities: Clients, Groups, Loans, Savings, Loan Transactions, SavingsTransactions and
NotificationMessagesfilterConstraints
- JSONFilterConstraints object defining an array of applicable filter constraints and an optional sort
order. Must not be nulloffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case exception occurs while fetching entitiespublic static ApiDefinition makeApiDefinitionForSearchByFilter(MambuEntityType searchEntityType)
searchEntityType
- entity type for searching with filter constraints. Must not be null. Currently API supports the
following entities: Clients, Groups, Loans, Savings, Loan Transactions, SavingsTransactions, and
NotificationMessages
See MBU-8986, MBU-10646, MBU-11120 for more detailspublic java.util.List<com.mambu.notifications.shared.model.NotificationMessage> getNotificationMessages(com.mambu.api.server.handler.core.dynamicsearch.model.JSONFilterConstraints filterConstraints, java.lang.String offset, java.lang.String limit) throws MambuApiException
filterConstraints
- filter constraints. Must not be null. See MBU-10646 for a list of supported constraintsoffset
- pagination offset. If not null it must be an integer greater or equal to zerolimit
- pagination limit. If not null it must be an integer greater than zeroMambuApiException
- in case something wrong happens while getting notification messages