Interface TaskService

  • All Superinterfaces:
    ComponentService<com.flower.docs.domain.task.Task>, CRUDService<com.flower.docs.domain.task.Task>, EditService<com.flower.docs.domain.task.Task>

    public interface TaskService
    extends ComponentService<com.flower.docs.domain.task.Task>
    Service dedicated to Task management
    Author:
    shanthan SIVARAJAH
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<com.flower.docs.domain.file.DocumentFile> addFiles​(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.file.DocumentFile> files, boolean replace)
      Add multiple files to a task
      void answer​(java.util.List<com.flower.docs.domain.common.Id> ids, com.flower.docs.domain.taskclass.Answer answer)
      Answers to multiple tasks
      void assign​(java.util.List<com.flower.docs.domain.common.Id> ids, java.lang.String username)
      Assignes multiple tasks to a user
      void deleteFiles​(com.flower.docs.domain.common.Id id, java.util.List<com.flower.docs.domain.common.Id> files)
      Deletes files of a task.
      java.util.List<com.flower.docs.domain.file.DocumentFile> getFiles​(com.flower.docs.domain.common.Id id, boolean includeContent)
      Get files of a task.
    • Method Detail

      • answer

        void answer​(java.util.List<com.flower.docs.domain.common.Id> ids,
                    com.flower.docs.domain.taskclass.Answer answer)
             throws com.flower.docs.domain.exception.FunctionalException,
                    com.flower.docs.domain.exception.TechnicalException
        Answers to multiple tasks
        Parameters:
        ids - The unique identifiers of the tasks
        answer - The task answer. The answer should match with one of the task class
        Throws:
        com.flower.docs.domain.exception.FunctionalException
        com.flower.docs.domain.exception.TechnicalException
      • assign

        void assign​(java.util.List<com.flower.docs.domain.common.Id> ids,
                    java.lang.String username)
             throws com.flower.docs.domain.exception.FunctionalException,
                    com.flower.docs.domain.exception.TechnicalException
        Assignes multiple tasks to a user
        Parameters:
        ids - The unique identifiers of the tasks
        username - The username of new assignee
        Throws:
        com.flower.docs.domain.exception.FunctionalException
        com.flower.docs.domain.exception.TechnicalException
      • getFiles

        java.util.List<com.flower.docs.domain.file.DocumentFile> getFiles​(com.flower.docs.domain.common.Id id,
                                                                          boolean includeContent)
                                                                   throws com.flower.docs.domain.exception.TechnicalException,
                                                                          com.flower.docs.domain.exception.FunctionalException
        Get files of a task.
        Parameters:
        id - The identifier of the task whose files are requested IdentifiableElement.getId()
        includeContent - Determines if the file contents should be included or not
        Returns:
        The requested files
        Throws:
        com.flower.docs.domain.exception.TechnicalException - If a technical error occurred during process
        com.flower.docs.domain.exception.FunctionalException - If a functional error occurred during process
        See Also:
        DocumentFile.getContent()
      • addFiles

        java.util.List<com.flower.docs.domain.file.DocumentFile> addFiles​(com.flower.docs.domain.common.Id id,
                                                                          java.util.List<com.flower.docs.domain.file.DocumentFile> files,
                                                                          boolean replace)
                                                                   throws com.flower.docs.domain.exception.TechnicalException,
                                                                          com.flower.docs.domain.exception.FunctionalException
        Add multiple files to a task
        Parameters:
        id - The task id
        files - The files to attach
        replace - Determines if actual task files should be replaced by provided ones
        Returns:
        The created files without their content
        Throws:
        com.flower.docs.domain.exception.TechnicalException - If a technical error occurred during process
        com.flower.docs.domain.exception.FunctionalException - If a functional error occurred during process
      • deleteFiles

        void deleteFiles​(com.flower.docs.domain.common.Id id,
                         java.util.List<com.flower.docs.domain.common.Id> files)
                  throws com.flower.docs.domain.exception.TechnicalException,
                         com.flower.docs.domain.exception.FunctionalException
        Deletes files of a task.
        Parameters:
        id - The task id IdentifiableElement.getId()
        files - The identifiers of files to delete IdentifiableElement.getId() or Task#getfiles()
        Throws:
        com.flower.docs.domain.exception.TechnicalException - If a technical error occurred during process
        com.flower.docs.domain.exception.FunctionalException - If a functional error occurred during process