Interface ScheduleEntry

All Superinterfaces:
Lockable

public interface ScheduleEntry extends Lockable
Defines a single entry for a job list of tasks to be scheduled.
Since:
4.0
  • Method Details

    • getId

      long getId()
      -1 for unsaved new entries
      Since:
      4.0
    • getRunningEntries

      List<ScheduleEntryControl> getRunningEntries()
      Returns a list of schedule entry controls related to this schedule entry and currently running on the FirstSpirit server.
      Returns:
      List<ScheduleEntryControl>
      Since:
      4.0
    • execute

      Start execution on the server - locked entries will be started with the settings which are actually set on client side, all other entries will be started with the settings wich are stored on the server.
      Returns:
      ScheduleEntryControl
      Throws:
      ScheduleEntryRunningException - If the ScheduleEntry is already running.
      Since:
      4.0
    • getName

      @NotNull @NotNull String getName()
      Returns the name of this ScheduleEntry.
      Returns:
      String
      Since:
      4.0
    • setName

      void setName(@NotNull @NotNull String value)
      Provide the name of this ScheduleEntry.
      Parameters:
      value - the name
      Since:
      4.0
    • getDescription

      @Nullable @Nullable String getDescription()
      Get the description for the schedule entry.
      Since:
      4.0
    • setDescription

      void setDescription(@Nullable @Nullable String value)
      Sets the given String as description.
      Parameters:
      value - The given String that should be the schedule entry's description.
      Since:
      4.0
    • isActive

      boolean isActive()
      Returns true if this ScheduleEntry is active, false otherwise.
      Returns:
      true if this ScheduleEntry is active, false otherwise.
      Since:
      4.0
    • isSystem

      boolean isSystem()
      Returns true if this ScheduleEntry is a system schedule entry or not.
      System entries could not be deleted and some properties could not be changed (e.g. the name).
      Returns:
      true if this is a system entry, false otherwise
      Since:
      4.0
    • setActive

      void setActive(boolean value)
      Provide true if this ScheduleEntry should be activated, false otherwise.
      Parameters:
      value - true if this ScheduleEntry should be activated, false otherwise.
      Since:
      4.0
    • getTasks

      List<ScheduleTask> getTasks()

      Returns a List of ScheduleTask which belongs to this schedule entry.

      Please note that if a task of this list is modified, it is imperative that the task is written back to the list with List.set(int, Object) before calling Lockable.save().

      Returns:
      a List of ScheduleTask which belongs to this schedule entry.
      Since:
      4.0
    • createTask

      <T extends ScheduleTask> T createTask(Class<T> type)
      Creates a ScheduleTask with type type. To add the created ScheduleTask to this ScheduleEntry use getTasks().add().
      Parameters:
      type - The class ScheduleTask should have.
      Returns:
      The created ScheduleTask
      Since:
      4.0
    • addUnifiedTask

      void addUnifiedTask(ScheduleTask task)
      Unifies the given task's name and adds it to this entry.
      Parameters:
      task - The task to be added.
      Since:
      5.2.14
    • createTask

      @NotNull @NotNull ScheduleTask createTask(@NotNull @NotNull ScheduleTaskTemplate template)
      Creates a ScheduleTask which uses all properties of the given ScheduleTaskTemplate. Only parallel execution and activity state of the created instance are modifyable. To add the created ScheduleTask to this ScheduleEntry use getTasks().add().
      Parameters:
      template - The ScheduleTaskTemplate to use.
      Returns:
      The created ScheduleTask
      Since:
      4.0
    • copyTask

      @NotNull <T extends ScheduleTask> T copyTask(@NotNull T value)
      Copy's the given task.
      Parameters:
      value - The ScheduleTask to copy
      Returns:
      The copy of the ScheduleTask
      Since:
      4.0
    • getEmail

      @Nullable @Nullable String getEmail()
      The e-mail adress(es) which will be used for status mails for finished tasks.
      Returns:
      null or e-mail adresses seperated with ";"
      Since:
      4.0
      See Also:
    • setEmail

      void setEmail(@Nullable @Nullable String value)
      Sets the e-mail address(es) that should be used for status mails.
      Parameters:
      value - null or e-mail addresses separated with ";", an empty string will be mapped to null
      Since:
      4.0
      See Also:
    • isProjectSchedule

      boolean isProjectSchedule()
      Determines if the schedule entry is related to a project.
      Returns:
      true for project specific tasks
      Since:
      4.0
      See Also:
    • getProject

      @Nullable @Nullable Project getProject()
      Returns the project for project specific tasks or null if it is a non project related entry
      Returns:
      the project for project specific tasks or null for server entries
      Since:
      4.0
      See Also:
    • setProject

      void setProject(@Nullable @Nullable Project project)
      Sets the project, if the schedule entry should be related to it.
      Parameters:
      project - null for a project independent ScheduleEntry
      Since:
      4.0
      See Also:
    • getExecutionSchedule

      @NotNull @NotNull ExecutionSchedule getExecutionSchedule()
      Returns the ExecutionSchedule of this ScheduleEntry.
      Returns:
      the ExecutionSchedule of this ScheduleEntry.
      Since:
      4.0
      See Also:
    • createExecutionSchedule

      <T extends ExecutionSchedule> T createExecutionSchedule(Class<T> type)
      Changes the ExecutionSchedule of this schedule entry to the given type.
      Parameters:
      type - The class ExecutionSchedule should have.
      Returns:
      The created ExecutionSchedule
      Since:
      4.0
      See Also:
    • isChanged

      boolean isChanged()
      true if this ScheduleEntry has been changed, false otherwise
      Specified by:
      isChanged in interface Lockable
      Returns:
      true if this object is changed locally, false otherwise
      Since:
      4.0
    • getStatistic

      ScheduleEntryStatistic getStatistic()
      Statistic of this ScheduleEntry.
      Since:
      4.0
      See Also:
    • resetStatistic

      void resetStatistic()
      Resets the statistic of this ScheduleEntry.
      Since:
      4.0
    • delete

      boolean delete()
      Deletes this ScheduleEntry. The ScheduleEntry has to be locked before calling this method.
      Returns:
      true if ScheduleEntry has been deleted, false otherwise.
      Since:
      4.0
    • getAllowInteractiveExecution

      boolean getAllowInteractiveExecution()
      true if interactive execution is allowed, false otherwise (default).
      Since:
      4.0
    • setAllowInteractiveExecution

      void setAllowInteractiveExecution(boolean value)
      Provide true if interactive execution should be allowed, false otherwise (default).
      Parameters:
      value - true or false
      Since:
      4.0
    • getUsers

      @NotNull @NotNull List<User> getUsers()
      a List of type User containing all users allowed to execute this ScheduleEntry interactive.
      Since:
      4.0
    • addUser

      void addUser(@NotNull @NotNull User user)
      Adds the given user which should be allowed to execute this schedule entry.
      Parameters:
      user - the user which should be allowed to execute this schedule entry interactively
      Since:
      4.0
    • removeUser

      void removeUser(@NotNull @NotNull User user)
      Removes the given user who shouldn't be allowed to execute the schedule entry anymore.
      Parameters:
      user - the user which should not be allowed to execute this schedule entry interactively anymore
      Since:
      4.0
    • getGroups

      @NotNull @NotNull List<Group> getGroups()
      a List of type Group containing all groups allowed to execute this ScheduleEntry interactive.
      Since:
      4.0
    • addGroup

      void addGroup(@NotNull @NotNull Group group)
      Adds a group to execute this schedule entry.
      Parameters:
      group - the group which users should be allowed to execute this schedule entry interactively
      Since:
      4.0
    • removeGroup

      void removeGroup(@NotNull @NotNull Group group)
      Removes the given group which users shouldn't be allowed to execute the schedule entry anymore.
      Parameters:
      group - the group which users should not be allowed to execute this schedule entry interactively anymore
      Since:
      4.0
    • getParallelExecutionMode

      @NotNull @NotNull ScheduleEntry.ParallelExecutionMode getParallelExecutionMode()
      the ParallelExecutionMode of this entry.
      Since:
      4.0
      See Also:
    • setParallelExecutionMode

      void setParallelExecutionMode(@NotNull @NotNull ScheduleEntry.ParallelExecutionMode mode)
      Changes the ParallelExecutionMode to the given mode.
      Parameters:
      mode - the ParallelExecutionMode
      Since:
      4.0
      See Also:
    • getFolderName

      @NotNull @NotNull String getFolderName()
      the folder name where pages should be generated in
      if folder name is null or length zero, the schedule entry id will be used on task execution
      Since:
      4.0
    • setFolderName

      void setFolderName(@NotNull @NotNull String value)
      Sets the folder (given by its name) where pages should be generated in.
      Parameters:
      value - the folder name where pages should be generated in.
      if value is null or length equals 0 the default folder name will be used on task execution (the schedule entry id)
      Since:
      4.0