de.espirit.firstspirit.server.scheduler
Interface ScheduleTaskFactory<DTO extends ScheduleTaskFactory.TaskDto,T extends ScheduleTask>

Type Parameters:
DTO - persistence and transfer type, see ScheduleTaskFactory.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 data transfer object (which is also the persistent format), a ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.ScheduleTaskFactory.TaskDto) schedule task}, and an executor.

Since:
4.2.2

Nested Class Summary
static interface ScheduleTaskFactory.TaskDto
           
 
Method Summary
 DTO createDto()
          Create 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.
 T createTask(ScheduleEntry scheduleEntry, DTO dto)
          Create a new task.
 de.espirit.firstspirit.server.scheduler.TaskExecutor createTaskExecutor()
           
 Class<T> getApiType()
           
 String getDescription()
           
 String getDisplayName()
           
 Class<DTO> getDtoType()
           
 boolean mayExecuteWithoutProject()
          Implementations return true if ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.ScheduleTaskFactory.TaskDto) generated tasks} may be executed without project binding.
 boolean mayExecuteWithProject()
          Implementations return true if ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.ScheduleTaskFactory.TaskDto) generated tasks} may be executed with project binding.
 

Method Detail

getApiType

Class<T> getApiType()
Returns:
the api interface <T>
Since:
4.2.2

getDtoType

Class<DTO> getDtoType()
Returns:
the task Data tranfer object type
Since:
4.2.2

getDisplayName

@NotNull
String getDisplayName()
Returns:
the visible task selection display name
Since:
4.2.2

getDescription

@NotNull
String getDescription()
Returns:
the task desciption
Since:
4.2.2

mayExecuteWithoutProject

boolean mayExecuteWithoutProject()
Implementations return true if ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.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:
ScheduleTaskFactory.mayExecuteWithProject()

mayExecuteWithProject

boolean mayExecuteWithProject()
Implementations return true if ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.ScheduleTaskFactory.TaskDto) generated tasks} may be executed with project binding.

Returns:
true if task may be excuted with a project binding
Since:
4.2.2
See Also:
ScheduleTaskFactory.mayExecuteWithoutProject()

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:
ScheduleTaskFactory.createTask(de.espirit.firstspirit.access.schedule.ScheduleEntry, de.espirit.firstspirit.server.scheduler.ScheduleTaskFactory.TaskDto)

createTask

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

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

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

createTaskExecutor

@NotNull
de.espirit.firstspirit.server.scheduler.TaskExecutor createTaskExecutor()
Returns:
the specific TaskExecutor
Since:
4.2.2

createEditorFactory

@Nullable
<E> E createEditorFactory(@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 client and TODO (name class for web client)
task - a specialized task object
Returns:
a gui factory which provides a gui of the specified type


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480