Interface ScheduleTaskTemplate

All Superinterfaces:
Lockable

public interface ScheduleTaskTemplate extends Lockable
Schedule task templates can be used for project or server scoped actions.
Since:
4.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends ScheduleTask>
    T
    createTask(Class<T> type)
    Create and set a task of the provided type.
    Note: Calling this will overwrites the current task.
    boolean
    Delete this template.
    long
    Returns the id of the schedule task template.
    @Nullable Project
    Returns the Project or null if the schedule task template is server scoped.
    @Nullable ScheduleTask
    Returns the current task instance or null.
    int
    Returns the number of usages of this template.
    Returns a list of schedule entries which contains task that use this template.
    boolean
    Returns true, if this template has been changed, false otherwise.
    boolean
    Is it allowed to copy this template or are only references allowed?
    boolean
    Returns true, if the schedule task template is project scoped, false if it is server scoped.
    boolean
    Returns true, 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)
    Set project to make the schedule task template project scoped or null for server scoped.
    void
    setPublic(boolean value)
    Set value to true, if this template should be visible for other projects, false if this template should be only available for local usage.

    Methods inherited from interface de.espirit.firstspirit.access.Lockable

    isLocked, lock, refresh, save, unlock
  • 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()
      Returns true, 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

      @Nullable @Nullable Project getProject()
      Returns the Project or null if the schedule task template is server scoped.
      Returns:
      The Project or null if the schedule task template is server scoped.
      Since:
      4.0
    • setProject

      void setProject(@Nullable @Nullable Project project)
      Set project to make the schedule task template project scoped or null for server scoped.
      Parameters:
      project - Set the schedule task template project scoped by given Project or null for server scoped.
      Since:
      4.0
    • isChanged

      boolean isChanged()
      Returns true, if this template has been changed, false otherwise.
      Specified by:
      isChanged in interface Lockable
      Returns:
      true, if this template has been changed, false otherwise
      Since:
      4.0
    • isPublic

      boolean isPublic()
      Returns true, 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)
      Set value to true, 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

      @Nullable @Nullable ScheduleTask getTask()
      Returns the current task instance or null. For new task templates this is null until createTask(Class) has been called.
      Returns:
      The current task instance or null if no task instance has been created.
      Since:
      4.0
      See Also:
    • createTask

      <T extends ScheduleTask> T createTask(Class<T> type)
      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

      @NotNull @NotNull List<ScheduleEntry> 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