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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescription@NotNull ScheduleEntrycopyScheduleEntry(@NotNull ScheduleEntry scheduleEntry, @Nullable Project project) Copies the givenscheduleEntryto another project or to server scoped, ifprojectisnull.@NotNull ScheduleEntrycreateScheduleEntry(@NotNull String scheduleEntryName) Creates a new schedule entry for server scoped actions.@NotNull ScheduleEntrycreateScheduleEntry(@NotNull String scheduleEntryName, @Nullable Project project) Creates a new schedule entry for the provided project.@NotNull ScheduleTaskTemplateCreates a new schedule task template which can be used for project or server scoped actions.@NotNull InputStreamReturns the default mail text used forMailTask.@NotNull List<ScheduleEntryControl>getHistory(Date from, Date until, int maxCount, boolean includeProjectEntries) Get the execution history of server schedule entries.@NotNull List<ScheduleEntryControl>getHistory(Date from, Date until, int maxCount, @NotNull Project project) Get the execution history of schedule entries of the given project.@NotNull List<ScheduleEntry>Returns the list schedule entries that would be executed in the future.@NotNull List<ScheduleEntryControl>Returns a list of currently running controllable schedule entries.@NotNull List<ScheduleEntry>getScheduleEntries(boolean includeProjectEntries) Returns a list of all (includeProjectEntries == true) or only server scoped ((includeProjectEntries == false)) schedule entries.@NotNull List<ScheduleEntry>getScheduleEntries(@NotNull Project project) Returns a list of schedule entries depending to givenproject.@NotNull ScheduleEntrygetScheduleEntry(long id) Returns the schedule entry specified by the given id.@Nullable ScheduleEntrygetScheduleEntry(@NotNull Project project, String name) Returns the specified schedule entry ornullif it couldn't be found.@Nullable ScheduleEntryControlgetScheduleEntryControl(long executionId) Get theScheduleEntryControlfor a given id.@Nullable ScheduleTaskTemplategetScheduleTaskTemplate(long id) Returns the schedule task template with the given id ornullfor an unknown id.@NotNull List<ScheduleTaskTemplate>getScheduleTaskTemplates(@Nullable Project project) Returns a list of all schedule task templates for givenproject.
-
Field Details
-
GENERATE_FULL
Name for default full generation task.- Since:
- 4.0
- See Also:
-
GENERATE_PARTLY
Name for default partial generation task.- Since:
- 4.0
- See Also:
-
-
Method Details
-
createScheduleTaskTemplate
Creates a new schedule task template which can be used for project or server scoped actions. UseScheduleTaskTemplate.setProject(Project)to change the created server scoped schedule task template to a project scoped. The newScheduleTaskTemplateis locked. UseLockable.save()andLockable.unlock()to persist your settings.- Returns:
- A new
ScheduleTaskTemplate. - Since:
- 4.0
- See Also:
-
getScheduleTaskTemplate
Returns the schedule task template with the given id ornullfor an unknown id.- Parameters:
id- Schedule task template id.- Returns:
- The
ScheduleTaskTemplateornullfor 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 givenproject. Ifprojectisnullthe returned value is a list of all server scoped schedule task templates.- Parameters:
project- TheProjectornullfor server scoped schedule task templates.- Returns:
- A list of schedule task templates.
- Since:
- 4.0
-
createScheduleEntry
Creates a new schedule entry for server scoped actions. This is only allowed for server admins. For project related schedule entries please usecreateScheduleEntry(String, Project).
The newScheduleEntryis locked. UseLockable.save()andLockable.unlock()to persist your settings.- Parameters:
scheduleEntryName- Thenameof 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 isnullthe returned schedule entry has server scope (and creation is only allowed for server admins, else you have to be project admin).
The newScheduleEntryis locked. UseLockable.save()andLockable.unlock()to persist your settings.- Parameters:
scheduleEntryName- Thenameof the new schedule entry.project- The project this schedule entry is assigned to ornullfor 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 givenscheduleEntryto another project or to server scoped, ifprojectisnull. 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 destinationProjectornullto make a server scoped schedule entry.- Returns:
- The copied
ScheduleEntry. - Since:
- 4.0
-
getScheduleEntries
Returns a list of all (includeProjectEntries == true) or only server scoped ((includeProjectEntries == false)) schedule entries.- Parameters:
includeProjectEntries- Iftrue, the list contains all schedule entries, iffalsethe list covers the server scoped schedule entries.- Returns:
- A list of all or server scoped schedule entries.
- Since:
- 4.0
-
getScheduleEntries
Returns a list of schedule entries depending to givenproject.- Parameters:
project- TheProjectwhich entries should be returned.- Returns:
- A list of schedule entries depending to given project.
- Since:
- 4.0
-
getScheduleEntry
Returns the specified schedule entry ornullif it couldn't be found.- Parameters:
project- TheProjectwhich entries should be scanned.name- The schedule entryname.- Returns:
- The specified schedule entry or
nullif it couldn't be found. - Since:
- 4.2.400
-
getRunningEntries
Returns a list of currently running controllable schedule entries.- Returns:
- A list of currently running controllable schedule entries.
- Since:
- 4.0
-
getQueuedEntries
Returns the list schedule entries that would be executed in the future. This list contains also the schedule entries which are waiting because theparalle execution modeis set toDISALLOWED_WAIT.- Returns:
- A list of queued or waiting schedule entries.
- Since:
- 4.1.13
-
getScheduleEntryControl
Get theScheduleEntryControlfor a given id.- Parameters:
executionId- The execution id of requestedScheduleEntryControl.- Returns:
- The
ScheduleEntryControlfor the given id, ornullif 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- Iftrue, 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
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
Returns the default mail text used forMailTask.- Returns:
- The default mail text.
- Throws:
IOException- Since:
- 4.0
-