Interface ScheduleTaskTemplate
- All Superinterfaces:
Lockable
Schedule task templates can be used for project or server scoped actions.
- Since:
- 4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T extends ScheduleTask>
TcreateTask(Class<T> type) Create and set a task of the provided type.
Note: Calling this will overwrites the current task.booleandelete()Delete this template.longgetId()Returns the id of the schedule task template.@Nullable ProjectReturns theProjectornullif the schedule task template is server scoped.@Nullable ScheduleTaskgetTask()Returns the current task instance ornull.intReturns the number of usages of this template.@NotNull List<ScheduleEntry>Returns a list of schedule entries which contains task that use this template.booleanReturnstrue, if this template has been changed,falseotherwise.booleanIs it allowed to copy this template or are only references allowed?booleanReturnstrue, if the schedule task template is project scoped,falseif it is server scoped.booleanisPublic()Returnstrue, if this template is visible for other projects,falseif this template is only available for local usage.
Note: only server scoped schedule task templates can be public.voidsetCopyAllowed(boolean value) (Dis-)allow copying of this template.voidsetProject(@Nullable Project project) Setprojectto make the schedule task template project scoped ornullfor server scoped.voidsetPublic(boolean value) Setvaluetotrue, if this template should be visible for other projects,falseif this template should be only available for local usage.
-
Method Details
-
getId
long getId()Returns the id of the schedule task template.- Returns:
- The id of the schedule task template.
- Since:
- 4.0
-
isProjectTaskTemplate
boolean isProjectTaskTemplate()Returnstrue, if the schedule task template is project scoped,falseif it is server scoped.- Returns:
true, if the schedule task template is project scoped,falseif it is server scoped.- Since:
- 4.0
- See Also:
-
getProject
Returns theProjectornullif the schedule task template is server scoped.- Returns:
- The
Projectornullif the schedule task template is server scoped. - Since:
- 4.0
-
setProject
Setprojectto make the schedule task template project scoped ornullfor server scoped.- Parameters:
project- Set the schedule task template project scoped by givenProjectornullfor server scoped.- Since:
- 4.0
-
isChanged
boolean isChanged()Returnstrue, if this template has been changed,falseotherwise. -
isPublic
boolean isPublic()Returnstrue, if this template is visible for other projects,falseif this template is only available for local usage.
Note: only server scoped schedule task templates can be public.- Returns:
true, if this template is visible for other projects,falseif this template is only available for local usage.- Since:
- 4.0
-
setPublic
void setPublic(boolean value) Setvaluetotrue, if this template should be visible for other projects,falseif this template should be only available for local usage.- Parameters:
value-true, if this template should be visible for other projects,falseif this template should be only available for local usage.- Since:
- 4.0
-
getTask
Returns the current task instance ornull. For new task templates this isnulluntilcreateTask(Class)has been called.- Returns:
- The current task instance or
nullif no task instance has been created. - Since:
- 4.0
- See Also:
-
createTask
Create and set a task of the provided type.
Note: Calling this will overwrites the current task.- Parameters:
type- Task type.- Returns:
- The created task.
- Since:
- 4.0
- See Also:
-
delete
boolean delete()Delete this template. Note: schedule tast template has to be locked.- Returns:
true, if template could be deleted,falseotherwise.- Since:
- 4.0
-
getUsages
Returns a list of schedule entries which contains task that use this template.- Returns:
- A list of schedule entries which contains task that use this template.
- Since:
- 4.0
-
getUsageCount
int getUsageCount()Returns the number of usages of this template.- Returns:
- the number of usages
- Since:
- 5.0.31
- See Also:
-
isCopyAllowed
boolean isCopyAllowed()Is it allowed to copy this template or are only references allowed?- Returns:
trueif copies a allowed,falseif only references are allowed.- Since:
- 5.2.180603
- See Also:
-
setCopyAllowed
void setCopyAllowed(boolean value) (Dis-)allow copying of this template.- Parameters:
value-trueto allow copying of this task template,falseto only allow references to this task template.- Since:
- 5.2.180603
-