Package org.bonitasoft.engine.search
Class AbstractSearchEntity<C extends Serializable,S extends PersistentObject>
java.lang.Object
org.bonitasoft.engine.search.AbstractSearchEntity<C,S>
- Type Parameters:
C- The client objectS- The server object
- All Implemented Interfaces:
TransactionContent,TransactionContentWithResult<org.bonitasoft.engine.search.SearchResult<C>>
- Direct Known Subclasses:
AbstractActivityInstanceSearchEntity,AbstractArchiveActivityInstanceSearchEntity,AbstractArchivedCommentsSearchEntity,AbstractArchivedConnectorInstanceSearchEntity,AbstractArchivedDocumentSearchEntity,AbstractArchivedHumanTaskInstanceSearchEntity,AbstractArchivedProcessInstanceSearchEntity,AbstractCommandSearchEntity,AbstractCommentSearchEntity,AbstractDocumentSearchEntity,AbstractGroupSearchEntity,AbstractHumanTaskInstanceSearchEntity,AbstractProcessDeploymentInfoSearchEntity,AbstractProcessInstanceSearchEntity,AbstractProfileSearchEntity,AbstractRoleSearchEntity,AbstractSupervisorSearchEntity,AbstractUserSearchEntity,SearchApplicationMenus,SearchApplicationPages,SearchApplications,SearchApplicationsOfUser,SearchArchivedActivityInstanceSupervisedBy,SearchArchivedFlowNodeInstances,SearchArchivedFlowNodeInstanceSupervisedBy,SearchCustomUserInfoValues,SearchFlowNodeInstances,SearchFlowNodeInstanceSupervisedBy,SearchFormMappings,SearchPages,SearchProfileMembersForProfile,SearchProfiles,SearchTimerEventTriggerInstances,SearchWaitingEvents
public abstract class AbstractSearchEntity<C extends Serializable,S extends PersistentObject>
extends Object
implements TransactionContentWithResult<org.bonitasoft.engine.search.SearchResult<C>>
Abstract class to allow to search server object and convert them to client object
- Author:
- Matthieu Chaffotte, Baptiste Mesta, Celine Souchet
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSearchEntity(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options) -
Method Summary
Modifier and TypeMethodDescriptionconvertToClientObjects(List<S> serverObjects) Must convert server objects in client objects herevoidexecute()abstract longexecuteCount(QueryOptions queryOptions) Execute the count hereexecuteSearch(QueryOptions queryOptions) Execute the search hereorg.bonitasoft.engine.search.SearchResult<C>protected org.bonitasoft.engine.search.impl.SearchFiltergetSearchFilter(org.bonitasoft.engine.search.SearchOptions searchOptions, String searchedKey) org.bonitasoft.engine.search.SearchResult<C>search()execute this search and return the resultstatic <C extends Serializable,S extends PersistentObject>
org.bonitasoft.engine.search.SearchResult<C>search(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options, BonitaReadFunction<List<S>, List<C>> converter, BonitaReadFunction<QueryOptions, Long> count, BonitaReadFunction<QueryOptions, List<S>> search) protected voidvalidateQuery(org.bonitasoft.engine.search.SearchOptions options)
-
Constructor Details
-
AbstractSearchEntity
public AbstractSearchEntity(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options) - Parameters:
searchDescriptor- The search descriptor of the searched entityoptions- The options of the search
-
-
Method Details
-
validateQuery
protected void validateQuery(org.bonitasoft.engine.search.SearchOptions options) throws SBonitaException - Throws:
SBonitaException
-
execute
- Specified by:
executein interfaceTransactionContent- Throws:
SBonitaException
-
search
public org.bonitasoft.engine.search.SearchResult<C> search() throws org.bonitasoft.engine.exception.SearchExceptionexecute this search and return the result- Returns:
- the result of the search
- Throws:
org.bonitasoft.engine.exception.SearchException
-
executeCount
Execute the count here- Parameters:
queryOptions- The query options to execute the count with- Returns:
- The number of result on the server
- Throws:
SBonitaReadException- when the search failed to retrieve the count number
-
executeSearch
Execute the search here- Parameters:
queryOptions- The query options to execute the search with- Returns:
- The list of searched server objects
- Throws:
SBonitaReadException- when the search failed to retrieve the results
-
convertToClientObjects
Must convert server objects in client objects here- Parameters:
serverObjects- The server object to convert- Returns:
- The list of the client objects corresponding to the server objects
- Throws:
SBonitaException
-
getResult
- Specified by:
getResultin interfaceTransactionContentWithResult<C extends Serializable>
-
getSearchFilter
protected org.bonitasoft.engine.search.impl.SearchFilter getSearchFilter(org.bonitasoft.engine.search.SearchOptions searchOptions, String searchedKey) -
search
public static <C extends Serializable,S extends PersistentObject> org.bonitasoft.engine.search.SearchResult<C> search(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options, BonitaReadFunction<List<S>, List<C>> converter, BonitaReadFunction<QueryOptions, throws org.bonitasoft.engine.exception.SearchExceptionLong> count, BonitaReadFunction<QueryOptions, List<S>> search) - Throws:
org.bonitasoft.engine.exception.SearchException
-