Interface ScheduleTaskFactory<DTO extends ScheduleTaskFactory.TaskDto,T extends ScheduleTask>

Type Parameters:
DTO - persistence and transfer type, seeScheduleTaskFactory.TaskDto
T - api type, see ScheduleTask

public interface ScheduleTaskFactory<DTO extends ScheduleTaskFactory.TaskDto,T extends ScheduleTask>
Module class to hook new schedule task types into FirstSpirit. Implementations provide a datatransfer object (which is also the persistent format), a createTask(ScheduleEntry,ScheduleTaskFactory.TaskDto) schedule task}, and an executor.
Since:
4.2.2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Marker interface for task data transfer and persistence object.
  • Method Summary

    Modifier and Type
    Method
    Description
    Create a new Task DTO to use with a task factory to create a new task.
    <E> E
    createEditorFactory(@NotNull Class<E> type, T task)
    Create a gui factory of a specified type.
    createTask(@NotNull ScheduleEntry scheduleEntry, DTO dto)
    Create a new task.
    @NotNull de.espirit.firstspirit.server.scheduler.TaskExecutor
    Factory providing an executor object for performing a task.
    Provides the API type for tasks being created by this factory.
    @NotNull String
    Provides a description of the created task's job.
    @NotNull String
    Provides the display name for creating tasks from this factory.
    Provides the DTO type for tasks.
    boolean
    isLicensed(@NotNull SpecialistsBroker broker)
    Is this task type enabled by license?
    boolean
    Deprecated.
    since 5.2.16 - no replacement
    boolean
    Deprecated.
    since 5.2.16 - no replacement
  • Method Details

    • getApiType

      Class<T> getApiType()
      Provides the API type for tasks being created by this factory.
      Returns:
      the api interface <T>
      Since:
      4.2.2
    • getDtoType

      Class<DTO> getDtoType()
      Provides the DTO type for tasks.
      Returns:
      the task Data transfer object type
      Since:
      4.2.2
    • getDisplayName

      @NotNull @NotNull String getDisplayName()
      Provides the display name for creating tasks from this factory.
      Returns:
      the visible task selection display name
      Since:
      4.2.2
    • getDescription

      @NotNull @NotNull String getDescription()
      Provides a description of the created task's job.
      Returns:
      the task desciption
      Since:
      4.2.2
    • mayExecuteWithoutProject

      @Deprecated boolean mayExecuteWithoutProject()
      Deprecated.
      since 5.2.16 - no replacement
      Implementations return true if createTask(ScheduleEntry,ScheduleTaskFactory.TaskDto)generated tasks} may be executed without project binding.
      Returns:
      true if task may be executed without a project binding
      Since:
      4.2.2
      See Also:
    • mayExecuteWithProject

      @Deprecated boolean mayExecuteWithProject()
      Deprecated.
      since 5.2.16 - no replacement
      Implementations return true if generated tasksmay be executed with project binding.
      Returns:
      true if task may be executed with a project binding
      Since:
      4.2.2
      See Also:
    • createDto

      @NotNull DTO createDto()
      Create a new Task DTO to use with a task factory to create a new task.

      Note: this method needs to be called before creating a new task.

      Returns:
      the newly created data transfer object
      Since:
      4.2.2
      See Also:
    • createTask

      @NotNull T createTask(@NotNull @NotNull ScheduleEntry scheduleEntry, @NotNull DTO dto)
      Create a new task.

      Note: createDto needs to be called first to obtain a valid DTO.

      Parameters:
      scheduleEntry - the ScheduleEntry
      dto - a specialized dto object (see createDto())
      Returns:
      The task instance.
      Since:
      4.2.2
      See Also:
    • createTaskExecutor

      @NotNull @NotNull de.espirit.firstspirit.server.scheduler.TaskExecutor createTaskExecutor()
      Factory providing an executor object for performing a task.
      Returns:
      the specific TaskExecutor
      Since:
      4.2.2
    • createEditorFactory

      @Nullable <E> E createEditorFactory(@NotNull @NotNull Class<E> type, @NotNull T task)
      Create a gui factory of a specified type. If the specified type is not supported implementations should return null.

      Type Parameters:
      E - dialog factory type
      Parameters:
      type - desired factory type, current known types are ScheduleTaskDialogFactory for the java clientand TODO (name class for web client)
      task - a specialized task object
      Returns:
      a gui factory which provides a gui of the specified type
      Since:
      4.2.2
    • isLicensed

      boolean isLicensed(@NotNull @NotNull SpecialistsBroker broker)
      Is this task type enabled by license?
      Returns:
      true if this task type is licensed
      Since:
      5.2.201