Class ReplacementRepository

    • Constructor Detail

      • ReplacementRepository

        public ReplacementRepository()
    • Method Detail

      • save

        public <T extends Replacement<T>> T save​(Replacement<T> replacement)
        Description copied from interface: Replacement.Repository
        Saves or updates the specified replacement into this repository.
        Specified by:
        save in interface Replacement.Repository
        Parameters:
        replacement - the replacement to persist.
        Returns:
        the persisted replacement.
      • delete

        public <T extends Replacement<T>> void delete​(Replacement<T> replacement)
        Description copied from interface: Replacement.Repository
        Deletes the specified replacement in this repository. If the replacement doesn't exist in the repository, nothing is done.
        Specified by:
        delete in interface Replacement.Repository
        Parameters:
        replacement - the replacement to delete.
      • findAllByIncumbentAndByWorkflow

        public List<ReplacementImpl> findAllByIncumbentAndByWorkflow​(User user,
                                                                     String workflowInstanceId)
        Description copied from interface: Replacement.Repository
        Finds all the replacements by the specified replaced user and by the workflow instance identifier.
        Specified by:
        findAllByIncumbentAndByWorkflow in interface Replacement.Repository
        Parameters:
        user - a user in the workflow instance.
        workflowInstanceId - the unique identifier of a workflow instance.
        Returns:
        a list of all persisted replacements of the specified user. If no replacements were set for the specified user in the given workflow instance, then an empty list is returned.
      • findAllBySubstituteAndByWorkflow

        public List<ReplacementImpl> findAllBySubstituteAndByWorkflow​(User user,
                                                                      String workflowInstanceId)
        Description copied from interface: Replacement.Repository
        Finds all the replacements by the specified substitute and by the workflow instance identifier.
        Specified by:
        findAllBySubstituteAndByWorkflow in interface Replacement.Repository
        Parameters:
        user - a user in the workflow instance.
        workflowInstanceId - the unique identifier of a workflow instance.
        Returns:
        a list of all persisted replacements that will be done by the specified user. If no replacements were set with the specified user in the given workflow instance, then an empty list is returned.
      • findAllByWorkflow

        public List<ReplacementImpl> findAllByWorkflow​(String workflowInstanceId)
        Description copied from interface: Replacement.Repository
        Finds all the replacements created in the specified workflow instance.
        Specified by:
        findAllByWorkflow in interface Replacement.Repository
        Parameters:
        workflowInstanceId - the unique identifier of a workflow instance.
        Returns:
        a list of all persisted replacements that were created in the specified workflow instance. If no replacements were set in the given workflow instance, then an empty list is returned.
      • findAllByUsersAndByWorkflow

        public List<ReplacementImpl> findAllByUsersAndByWorkflow​(User incumbent,
                                                                 User substitute,
                                                                 String workflowInstanceId)
        Description copied from interface: Replacement.Repository
        Finds all the replacements between the two specified users and created in the specified workflow instance.
        Specified by:
        findAllByUsersAndByWorkflow in interface Replacement.Repository
        Parameters:
        incumbent - the incumbent in the replacements to get.
        substitute - the substitute in the replacements to get.
        workflowInstanceId - the unique identifier of a workflow instance.
        Returns:
        a list of all persisted replacements that were created in the specified workflow instance. If no replacements were set in the given workflow instance, then an empty list is returned.
      • findById

        public ReplacementImpl findById​(String replacementId)
        Description copied from interface: Replacement.Repository
        Gets the replacement with the specified unique identifier. The identifier of a replacement is unique among all over the workflow instances.
        Specified by:
        findById in interface Replacement.Repository
        Parameters:
        replacementId - the unique identifier of a replacement among all of the available workflow instances.
        Returns:
        a Replacement object or null if no such replacement exists with the specified unique identifier.