Interface ScheduleTaskFactory<DTO extends ScheduleTaskFactory.TaskDto,T extends 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 ClassesModifier and TypeInterfaceDescriptionstatic interface
Marker interface for task data transfer and persistence object. -
Method Summary
Modifier and TypeMethodDescriptionCreate a new Task DTO to use with a task factory to create a new task.<E> E
createEditorFactory
(Class<E> type, T task) Create a gui factory of a specified type.createTask
(ScheduleEntry scheduleEntry, DTO dto) Create a new task.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.Provides a description of the created task's job.Provides the display name for creating tasks from this factory.Provides the DTO type for tasks.boolean
isLicensed
(SpecialistsBroker broker) Is this task type enabled by license?boolean
Deprecated.boolean
Deprecated.since 5.2.16 - use#mayExecuteInContext(ScheduleTaskDefinitionContext)
-
Method Details
-
getApiType
Provides the API type for tasks being created by this factory.- Returns:
- the api interface
<T>
- Since:
- 4.2.2
-
getDtoType
Provides the DTO type for tasks.- Returns:
- the task Data transfer object type
- Since:
- 4.2.2
-
getDisplayName
Provides the display name for creating tasks from this factory.- Returns:
- the visible task selection display name
- Since:
- 4.2.2
-
getDescription
Provides a description of the created task's job.- Returns:
- the task desciption
- Since:
- 4.2.2
-
mayExecuteWithoutProject
Deprecated.since 5.2.16 - use#mayExecuteInContext(ScheduleTaskDefinitionContext)
Implementations returntrue
ifcreateTask(ScheduleEntry,ScheduleTaskFactory.TaskDto)
generated tasks} may be executed without project binding.- Returns:
- true if task may be excuted without a project binding
- Since:
- 4.2.2
- See Also:
-
mayExecuteWithProject
Deprecated.since 5.2.16 - use#mayExecuteInContext(ScheduleTaskDefinitionContext)
Implementations returntrue
ifgenerated tasks
may be executed with project binding.- Returns:
- true if task may be executed with a project binding
- Since:
- 4.2.2
- See Also:
-
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
Create a new task.Note:
createDto
needs to be called first to obtain a valid DTO.- Parameters:
scheduleEntry
- theScheduleEntry
dto
- a specialized dto object (seecreateDto()
)- Returns:
- The task instance.
- Since:
- 4.2.2
- See Also:
-
createTaskExecutor
Factory providing an executor object for performing a task.- Returns:
- the specific
TaskExecutor
- Since:
- 4.2.2
-
createEditorFactory
Create a gui factory of a specified type. If the specified type is not supported implementations should returnnull
.- Parameters:
type
- desired factory type, current known types areScheduleTaskDialogFactory
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
Is this task type enabled by license?- Returns:
- true if this task type is licensed
- Since:
- 5.2.201
-
#mayExecuteInContext(ScheduleTaskDefinitionContext)