Interface ScheduleStorage


public interface ScheduleStorage
FirstSpirit storage for schedule management. Use SpecialistsBroker#requireSpecialist(ServicesBroker.TYPE).getService(AdminService.class).getScheduleStorage().
Since:
4.0
See Also:
  • Field Details

    • GENERATE_FULL

      static final String GENERATE_FULL
      Name for default full generation task.
      Since:
      4.0
      See Also:
    • GENERATE_PARTLY

      static final String GENERATE_PARTLY
      Name for default partial generation task.
      Since:
      4.0
      See Also:
  • Method Details

    • createScheduleTaskTemplate

      @NotNull @NotNull ScheduleTaskTemplate createScheduleTaskTemplate()
      Creates a new schedule task template which can be used for project or server scoped actions. Use ScheduleTaskTemplate.setProject(Project) to change the created server scoped schedule task template to a project scoped. The new ScheduleTaskTemplate is locked. Use Lockable.save() and Lockable.unlock() to persist your settings.
      Returns:
      A new ScheduleTaskTemplate.
      Since:
      4.0
      See Also:
    • getScheduleTaskTemplate

      @Nullable @Nullable ScheduleTaskTemplate getScheduleTaskTemplate(long id)
      Returns the schedule task template with the given id or null for an unknown id.
      Parameters:
      id - Schedule task template id.
      Returns:
      The ScheduleTaskTemplate or null for an unknown id.
      Since:
      4.0
    • getScheduleTaskTemplates

      @NotNull @NotNull List<ScheduleTaskTemplate> getScheduleTaskTemplates(@Nullable @Nullable Project project)
      Returns a list of all schedule task templates for given project. If project is null the returned value is a list of all server scoped schedule task templates.
      Parameters:
      project - The Project or null for server scoped schedule task templates.
      Returns:
      A list of schedule task templates.
      Since:
      4.0
    • createScheduleEntry

      @NotNull @NotNull ScheduleEntry createScheduleEntry(@NotNull @NotNull String scheduleEntryName)
      Creates a new schedule entry for server scoped actions. This is only allowed for server admins. For project related schedule entries please use createScheduleEntry(String, Project).
      The new ScheduleEntry is locked. Use Lockable.save() and Lockable.unlock() to persist your settings.
      Parameters:
      scheduleEntryName - The name of the new schedule entry.
      Returns:
      A new ScheduleEntry.
      Since:
      4.0
      See Also:
    • createScheduleEntry

      @NotNull @NotNull ScheduleEntry createScheduleEntry(@NotNull @NotNull String scheduleEntryName, @Nullable @Nullable Project project)
      Creates a new schedule entry for the provided project. If the provided project is null the returned schedule entry has server scope (and creation is only allowed for server admins, else you have to be project admin).
      The new ScheduleEntry is locked. Use Lockable.save() and Lockable.unlock() to persist your settings.
      Parameters:
      scheduleEntryName - The name of the new schedule entry.
      project - The project this schedule entry is assigned to or null for a server schedule entry.
      Returns:
      A new ScheduleEntry.
      Since:
      5.2.1805
      See Also:
    • copyScheduleEntry

      @NotNull @NotNull ScheduleEntry copyScheduleEntry(@NotNull @NotNull ScheduleEntry scheduleEntry, @Nullable @Nullable Project project)
      Copies the given scheduleEntry to another project or to server scoped, if project is null. The copy is persistent and not locked.
      Important: The current user must be project admin of source and destination project.
      Parameters:
      scheduleEntry - The schedule entry to copy.
      project - The destination Project or null to make a server scoped schedule entry.
      Returns:
      The copied ScheduleEntry.
      Since:
      4.0
    • getScheduleEntries

      @NotNull @NotNull List<ScheduleEntry> getScheduleEntries(boolean includeProjectEntries)
      Returns a list of all (includeProjectEntries == true) or only server scoped ((includeProjectEntries == false)) schedule entries.
      Parameters:
      includeProjectEntries - If true, the list contains all schedule entries, if false the list covers the server scoped schedule entries.
      Returns:
      A list of all or server scoped schedule entries.
      Since:
      4.0
    • getScheduleEntries

      @NotNull @NotNull List<ScheduleEntry> getScheduleEntries(@NotNull @NotNull Project project)
      Returns a list of schedule entries depending to given project.
      Parameters:
      project - The Project which entries should be returned.
      Returns:
      A list of schedule entries depending to given project.
      Since:
      4.0
    • getScheduleEntry

      @Nullable @Nullable ScheduleEntry getScheduleEntry(@NotNull @NotNull Project project, String name)
      Returns the specified schedule entry or null if it couldn't be found.
      Parameters:
      project - The Project which entries should be scanned.
      name - The schedule entry name.
      Returns:
      The specified schedule entry or null if it couldn't be found.
      Since:
      4.2.400
    • getRunningEntries

      @NotNull @NotNull List<ScheduleEntryControl> getRunningEntries()
      Returns a list of currently running controllable schedule entries.
      Returns:
      A list of currently running controllable schedule entries.
      Since:
      4.0
    • getQueuedEntries

      @NotNull @NotNull List<ScheduleEntry> getQueuedEntries()
      Returns the list schedule entries that would be executed in the future. This list contains also the schedule entries which are waiting because the paralle execution mode is set to DISALLOWED_WAIT.
      Returns:
      A list of queued or waiting schedule entries.
      Since:
      4.1.13
    • getScheduleEntryControl

      @Nullable @Nullable ScheduleEntryControl getScheduleEntryControl(long executionId)
      Get the ScheduleEntryControl for a given id.
      Parameters:
      executionId - The execution id of requested ScheduleEntryControl.
      Returns:
      The ScheduleEntryControl for the given id, or null if there is none.
      Since:
      5.2.221003
    • getHistory

      @NotNull @NotNull List<ScheduleEntryControl> getHistory(Date from, Date until, int maxCount, boolean includeProjectEntries)
      Get the execution history of server schedule entries. The result list is sorted from the last executed scheduleEntryControl (newest) to the oldest execution of an schedule entry.
      Parameters:
      from - Start date, only entries which were started at or after this date will be contained in the result.
      until - End date, only entries which were started at or before this date will be contained in the result.
      maxCount - The maximum count of entries which should be contained in the result.
      includeProjectEntries - If true, include project schedule entries, otherwise only server scoped entries are covered.
      Returns:
      A list of historic controllable schedule entries.
      Since:
      4.0
    • getHistory

      @NotNull @NotNull List<ScheduleEntryControl> getHistory(Date from, Date until, int maxCount, @NotNull @NotNull Project project)
      Get the execution history of schedule entries of the given project. The result list is sorted from the last executed scheduleEntryControl (newest) to the oldest execution of an schedule entry of the related project.
      Parameters:
      from - Start date, only entries which were started at or after this date will be contained in the result.
      until - End date, only entries which were started at or before this date will be contained in the result.
      maxCount - The maximum count of entries which should be contained in the result.
      project - The project whose schedule entries are to be displayed.
      Returns:
      A list of historic controllable schedule entries.
      Since:
      4.0
    • getScheduleEntry

      @NotNull @NotNull ScheduleEntry getScheduleEntry(long id)
      Returns the schedule entry specified by the given id.
      Parameters:
      id - The id of requested schedule entry.
      Returns:
      The schedule entry with the given id.
      Throws:
      IllegalArgumentException - if no schedule entry was found with the given id.
      Since:
      4.0
    • getDefaultMailText

      @NotNull @NotNull InputStream getDefaultMailText() throws IOException
      Returns the default mail text used for MailTask.
      Returns:
      The default mail text.
      Throws:
      IOException
      Since:
      4.0