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.boolean
delete()
Delete this template.long
getId()
Returns the id of the schedule task template.@Nullable Project
Returns theProject
ornull
if the schedule task template is server scoped.@Nullable ScheduleTask
getTask()
Returns the current task instance ornull
.int
Returns the number of usages of this template.@NotNull List<ScheduleEntry>
Returns a list of schedule entries which contains task that use this template.boolean
Returnstrue
, if this template has been changed,false
otherwise.boolean
Is it allowed to copy this template or are only references allowed?boolean
Returnstrue
, if the schedule task template is project scoped,false
if it is server scoped.boolean
isPublic()
Returnstrue
, if this template is visible for other projects,false
if this template is only available for local usage.
Note: only server scoped schedule task templates can be public.void
setCopyAllowed
(boolean value) (Dis-)allow copying of this template.void
setProject
(@Nullable Project project) Setproject
to make the schedule task template project scoped ornull
for server scoped.void
setPublic
(boolean value) Setvalue
totrue
, if this template should be visible for other projects,false
if 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,false
if it is server scoped.- Returns:
true
, if the schedule task template is project scoped,false
if it is server scoped.- Since:
- 4.0
- See Also:
-
getProject
Returns theProject
ornull
if the schedule task template is server scoped.- Returns:
- The
Project
ornull
if the schedule task template is server scoped. - Since:
- 4.0
-
setProject
Setproject
to make the schedule task template project scoped ornull
for server scoped.- Parameters:
project
- Set the schedule task template project scoped by givenProject
ornull
for server scoped.- Since:
- 4.0
-
isChanged
boolean isChanged()Returnstrue
, if this template has been changed,false
otherwise. -
isPublic
boolean isPublic()Returnstrue
, if this template is visible for other projects,false
if 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,false
if this template is only available for local usage.- Since:
- 4.0
-
setPublic
void setPublic(boolean value) Setvalue
totrue
, if this template should be visible for other projects,false
if this template should be only available for local usage.- Parameters:
value
-true
, if this template should be visible for other projects,false
if this template should be only available for local usage.- Since:
- 4.0
-
getTask
Returns the current task instance ornull
. For new task templates this isnull
untilcreateTask(Class)
has been called.- Returns:
- The current task instance or
null
if 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,false
otherwise.- 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:
true
if copies a allowed,false
if only references are allowed.- Since:
- 5.2.180603
- See Also:
-
setCopyAllowed
void setCopyAllowed(boolean value) (Dis-)allow copying of this template.- Parameters:
value
-true
to allow copying of this task template,false
to only allow references to this task template.- Since:
- 5.2.180603
-