Class SearchClientImpl<ItemType>
- java.lang.Object
-
- com.lexmark.saperion.client.implementation.SearchClientImpl<ItemType>
-
- All Implemented Interfaces:
SearchClient<ItemType>,com.lexmark.saperion.search.SearchExecutionService<ItemType>
- Direct Known Subclasses:
FolderDocumentSearchServiceClientImpl,GroupMembershipClientForGroupsImpl,GroupMembershipClientForUsersImpl,TenantManagementClientImpl
public class SearchClientImpl<ItemType> extends java.lang.Object implements SearchClient<ItemType>
This is the default implementation ofSearchClient.- Author:
- jschwarz
-
-
Constructor Summary
Constructors Constructor Description SearchClientImpl(com.lexmark.saperion.search.SearchExecutionService<ItemType> searchService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(com.lexmark.saperion.search.expression.Expression filter)This convenience method checks whether an element matching the filter actually exists.java.lang.Iterable<ItemType>list()This method returns an iterable over the complete result of the search using the default paging.java.lang.Iterable<ItemType>list(com.lexmark.saperion.search.expression.Expression filter)This method returns an iterable over the filtered result of the search using the default paging.java.lang.Iterable<ItemType>list(com.lexmark.saperion.search.expression.Expression filter, com.lexmark.saperion.search.PageDefinition paging)This method returns an iterable over the filtered result of the search paging as defined.java.lang.Iterable<ItemType>list(com.lexmark.saperion.search.expression.Expression filter, java.util.List<com.lexmark.saperion.search.query.FieldOrderDescriptor> order, com.lexmark.saperion.search.PageDefinition paging)This method returns an iterable over the filtered result of the search paging as defined.java.lang.Iterable<ItemType>list(com.lexmark.saperion.search.query.Statement statement, com.lexmark.saperion.search.PageDefinition paging)This method returns an iterable over the filtered result of the search paging as defined.java.lang.Iterable<ItemType>list(java.util.List<java.lang.String> fields, com.lexmark.saperion.search.expression.Expression filter, com.lexmark.saperion.search.PageDefinition paging)This method returns an iterable over the filtered result of the search paging as defined.java.lang.Iterable<ItemType>list(java.util.List<java.lang.String> fields, com.lexmark.saperion.search.expression.Expression filter, java.util.List<com.lexmark.saperion.search.query.FieldOrderDescriptor> order, com.lexmark.saperion.search.PageDefinition paging)This method returns an iterable over the filtered result of the search paging as defined.com.lexmark.saperion.search.SearchResultPage<ItemType>page(int offset, int pageSize)This method retrieves the given page of the result of the search.com.lexmark.saperion.search.SearchResultPage<ItemType>page(com.lexmark.saperion.search.PageDefinition paging)This method retrieves the given page of the result of the search.com.lexmark.saperion.search.SearchResultPage<ItemType>search(com.lexmark.saperion.search.query.Statement statement, com.lexmark.saperion.search.PageDefinition pageDefinition)ItemTypeuniqueResult(com.lexmark.saperion.search.expression.Expression filter)This convenience method expects the filter to return at most one result.
-
-
-
Constructor Detail
-
SearchClientImpl
public SearchClientImpl(com.lexmark.saperion.search.SearchExecutionService<ItemType> searchService)
-
-
Method Detail
-
search
public com.lexmark.saperion.search.SearchResultPage<ItemType> search(com.lexmark.saperion.search.query.Statement statement, com.lexmark.saperion.search.PageDefinition pageDefinition) throws com.lexmark.saperion.exceptions.EcmException
- Specified by:
searchin interfacecom.lexmark.saperion.search.SearchExecutionService<ItemType>- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(com.lexmark.saperion.search.query.Statement statement, com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search paging as defined.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
statement- a statement filtering the resultpaging- the paging the returned iterator should use- Returns:
- an iterator over the filtered result paging as defined.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(java.util.List<java.lang.String> fields, com.lexmark.saperion.search.expression.Expression filter, java.util.List<com.lexmark.saperion.search.query.FieldOrderDescriptor> order, com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search paging as defined.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
fields- the fields of the result to deliverfilter- a filter for the resultorder- the order of the result listpaging- the paging the returned iterator should use- Returns:
- an iterator over the filtered result paging as defined.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(java.util.List<java.lang.String> fields, com.lexmark.saperion.search.expression.Expression filter, com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search paging as defined.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
fields- the fields of the result to deliverfilter- a filter for the resultpaging- the paging the returned iterator should use- Returns:
- an iterator over the filtered result paging as defined.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(com.lexmark.saperion.search.expression.Expression filter, java.util.List<com.lexmark.saperion.search.query.FieldOrderDescriptor> order, com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search paging as defined.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
filter- a filter for the resultorder- the order of the result listpaging- the paging the returned iterator should use- Returns:
- an iterator over the filtered result paging as defined.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(com.lexmark.saperion.search.expression.Expression filter, com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search paging as defined.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
filter- a filter for the resultpaging- the paging the returned iterator should use- Returns:
- an iterator over the filtered result paging as defined.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list(com.lexmark.saperion.search.expression.Expression filter) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the filtered result of the search using the default paging.- Specified by:
listin interfaceSearchClient<ItemType>- Parameters:
filter- a filter for the result- Returns:
- an iterator over the filtered result using the default paging.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
list
public java.lang.Iterable<ItemType> list() throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method returns an iterable over the complete result of the search using the default paging.- Specified by:
listin interfaceSearchClient<ItemType>- Returns:
- an iterator over the complete result using the default paging.
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
uniqueResult
public ItemType uniqueResult(com.lexmark.saperion.search.expression.Expression filter) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis convenience method expects the filter to return at most one result. If no such element existsnullis returned. If one such element exists it is returned. Otherwise anIllegalRequestExceptionis thrown.- Specified by:
uniqueResultin interfaceSearchClient<ItemType>- Parameters:
filter- a filter yielding true for at most one element- Returns:
- the element the filter yields true for
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
exists
public boolean exists(com.lexmark.saperion.search.expression.Expression filter) throws com.lexmark.saperion.exceptions.EcmExceptionDescription copied from interface:SearchClientThis convenience method checks whether an element matching the filter actually exists.- Specified by:
existsin interfaceSearchClient<ItemType>- Parameters:
filter- the filter to check- Returns:
- whether an element matching the filter actually exists
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
page
public com.lexmark.saperion.search.SearchResultPage<ItemType> page(com.lexmark.saperion.search.PageDefinition paging) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method retrieves the given page of the result of the search.- Specified by:
pagein interfaceSearchClient<ItemType>- Parameters:
paging- the page to retrieve- Returns:
- the given page of the result of the search
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
page
public com.lexmark.saperion.search.SearchResultPage<ItemType> page(int offset, int pageSize) throws com.lexmark.saperion.exceptions.EcmException
Description copied from interface:SearchClientThis method retrieves the given page of the result of the search.- Specified by:
pagein interfaceSearchClient<ItemType>- Parameters:
offset- the offset of the pagepageSize- the size of the page- Returns:
- the given page of the result of the search
- Throws:
com.lexmark.saperion.exceptions.EcmException
-
-