Package org.bonitasoft.engine.search
Class AbstractSearchEntity<C extends java.io.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,ExternalIdentityMappingCommand.ExternalIdentityMappingSearchEntity,SearchApplicationMenus,SearchApplicationPages,SearchApplications,SearchApplicationsOfUser,SearchArchivedActivityInstanceSupervisedBy,SearchArchivedFlowNodeInstances,SearchArchivedFlowNodeInstanceSupervisedBy,SearchCustomUserInfoValues,SearchFlowNodeInstances,SearchFlowNodeInstanceSupervisedBy,SearchFormMappings,SearchPages,SearchProfileMembersForProfile,SearchProfiles,SearchTimerEventTriggerInstances,SearchWaitingEvents
public abstract class AbstractSearchEntity<C extends java.io.Serializable,S extends PersistentObject> extends java.lang.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
Constructors Constructor Description AbstractSearchEntity(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<C>convertToClientObjects(java.util.List<S> serverObjects)Must convert server objects in client objects herevoidexecute()abstract longexecuteCount(QueryOptions queryOptions)Execute the count hereabstract java.util.List<S>executeSearch(QueryOptions queryOptions)Execute the search hereorg.bonitasoft.engine.search.SearchResult<C>getResult()protected org.bonitasoft.engine.search.impl.SearchFiltergetSearchFilter(org.bonitasoft.engine.search.SearchOptions searchOptions, java.lang.String searchedKey)org.bonitasoft.engine.search.SearchResult<C>search()execute this search and return the resultstatic <C extends java.io.Serializable,S extends PersistentObject>
org.bonitasoft.engine.search.SearchResult<C>search(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options, BonitaReadFunction<java.util.List<S>,java.util.List<C>> converter, BonitaReadFunction<QueryOptions,java.lang.Long> count, BonitaReadFunction<QueryOptions,java.util.List<S>> search)protected voidvalidateQuery(org.bonitasoft.engine.search.SearchOptions options)
-
-
-
Constructor Detail
-
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 Detail
-
validateQuery
protected void validateQuery(org.bonitasoft.engine.search.SearchOptions options) throws SBonitaException- Throws:
SBonitaException
-
execute
public void execute() throws SBonitaException- Specified by:
executein interfaceTransactionContent- Throws:
SBonitaException
-
search
public org.bonitasoft.engine.search.SearchResult<C> search() throws org.bonitasoft.engine.exception.SearchException
execute this search and return the result- Returns:
- the result of the search
- Throws:
org.bonitasoft.engine.exception.SearchException
-
executeCount
public abstract long executeCount(QueryOptions queryOptions) throws SBonitaReadException
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
public abstract java.util.List<S> executeSearch(QueryOptions queryOptions) throws SBonitaReadException
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
public abstract java.util.List<C> convertToClientObjects(java.util.List<S> serverObjects) throws SBonitaException
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
public org.bonitasoft.engine.search.SearchResult<C> getResult()
- Specified by:
getResultin interfaceTransactionContentWithResult<C extends java.io.Serializable>
-
getSearchFilter
protected org.bonitasoft.engine.search.impl.SearchFilter getSearchFilter(org.bonitasoft.engine.search.SearchOptions searchOptions, java.lang.String searchedKey)
-
search
public static <C extends java.io.Serializable,S extends PersistentObject> org.bonitasoft.engine.search.SearchResult<C> search(SearchEntityDescriptor searchDescriptor, org.bonitasoft.engine.search.SearchOptions options, BonitaReadFunction<java.util.List<S>,java.util.List<C>> converter, BonitaReadFunction<QueryOptions,java.lang.Long> count, BonitaReadFunction<QueryOptions,java.util.List<S>> search) throws org.bonitasoft.engine.exception.SearchException
- Throws:
org.bonitasoft.engine.exception.SearchException
-
-