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 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.
      • 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 of endProcessing() method).
        Type Parameters:
        T - the type of the result.
        Returns:
        the processing result.