Interface SilvermailCriteriaProcessor
-
- All Known Implementing Classes:
JPQLQueryBuilder
public interface SilvermailCriteriaProcessor
A processor of a user notification criteria. The aim of a such processor is to process each criterion of the criteria in the order expected by the caller in order to perform some specific works.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
endProcessing()
Informs the processor the process is ended.SilvermailCriteriaProcessor
processByIds(List<Long> ids)
Processes the criterion on the message identifiers.SilvermailCriteriaProcessor
processFolderId(long folderId)
Processes the criterion on the folder identifier.SilvermailCriteriaProcessor
processOrdering(List<SilvermailCriteria.QUERY_ORDER_BY> orderings)
Processes the criterion on orderings of the user notification matching the criteria.SilvermailCriteriaProcessor
processPagination(PaginationPage pagination)
Processes the criterion on the pagination to apply on the user notification to return.SilvermailCriteriaProcessor
processReadState(int readState)
Processes the criterion on the read state.SilvermailCriteriaProcessor
processUserId(long userId)
Processes the criterion on the user identifier.<T> T
result()
Gets the result of the processing.void
startProcessing()
Informs the processor the start of the process.SilvermailCriteriaProcessor
then()
Informs the processor that there is a new criterion to process.
-
-
-
Method Detail
-
startProcessing
void startProcessing()
Informs the processor the start of the process. The processor use this method to allocate all the resources required by the processing here. It uses it to initialize the processor state machine.
-
endProcessing
void endProcessing()
Informs the processor the process is ended. The processor use this method to deallocate all the resources that were used during the processing. It uses it to tear down the processor state machine or to finalize some treatments.The processing has to stop once this method is called. Hence, the call of process methods should result to nothing or to an exception.
-
then
SilvermailCriteriaProcessor then()
Informs the processor that there is a new criterion to process. This method must be used by the caller to chain the different criterion processings.- Returns:
- the processor itself.
-
processByIds
SilvermailCriteriaProcessor processByIds(List<Long> ids)
Processes the criterion on the message identifiers.- Parameters:
ids
- the identifier of messages.- Returns:
- the processor itself.
-
processUserId
SilvermailCriteriaProcessor processUserId(long userId)
Processes the criterion on the user identifier.- Parameters:
userId
- the identifier of a user.- Returns:
- the processor itself.
-
processFolderId
SilvermailCriteriaProcessor processFolderId(long folderId)
Processes the criterion on the folder identifier.- Parameters:
folderId
- the identifier of a folder.- Returns:
- the processor itself.
-
processReadState
SilvermailCriteriaProcessor processReadState(int readState)
Processes the criterion on the read state.- Parameters:
readState
- the read state.- Returns:
- the processor itself.
-
processOrdering
SilvermailCriteriaProcessor processOrdering(List<SilvermailCriteria.QUERY_ORDER_BY> orderings)
Processes the criterion on orderings of the user notification matching the criteria.- Parameters:
orderings
- the result orderings concerned by the criterion.- Returns:
- the processor itself.
-
processPagination
SilvermailCriteriaProcessor processPagination(PaginationPage pagination)
Processes the criterion on the pagination to apply on the user notification to return.- Parameters:
pagination
- a pagination definition.- Returns:
- the processor itself.
-
result
<T> T result()
Gets the result of the processing. Warning, the result can be incomplete if called before the processing ending (triggered with the call ofendProcessing()
method).- Type Parameters:
T
- the type of the result.- Returns:
- the processing result.
-
-