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
-
Method Summary
Modifier and TypeMethodDescription@NotNull ScheduleEntry
copyScheduleEntry
(@NotNull ScheduleEntry scheduleEntry, @Nullable Project project) Copies the givenscheduleEntry
to another project or to server scoped, ifproject
isnull
.@NotNull ScheduleEntry
createScheduleEntry
(@NotNull String scheduleEntryName) Creates a new schedule entry for server scoped actions.@NotNull ScheduleEntry
createScheduleEntry
(@NotNull String scheduleEntryName, @Nullable Project project) Creates a new schedule entry for the provided project.@NotNull ScheduleTaskTemplate
Creates a new schedule task template which can be used for project or server scoped actions.@NotNull InputStream
Returns 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 ScheduleEntry
getScheduleEntry
(long id) Returns the schedule entry specified by the given id.@Nullable ScheduleEntry
getScheduleEntry
(@NotNull Project project, String name) Returns the specified schedule entry ornull
if it couldn't be found.@Nullable ScheduleEntryControl
getScheduleEntryControl
(long executionId) Get theScheduleEntryControl
for a given id.@Nullable ScheduleTaskTemplate
getScheduleTaskTemplate
(long id) Returns the schedule task template with the given id ornull
for 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 newScheduleTaskTemplate
is 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 ornull
for an unknown id.- Parameters:
id
- Schedule task template id.- Returns:
- The
ScheduleTaskTemplate
ornull
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 givenproject
. Ifproject
isnull
the returned value is a list of all server scoped schedule task templates.- Parameters:
project
- TheProject
ornull
for 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 newScheduleEntry
is locked. UseLockable.save()
andLockable.unlock()
to persist your settings.- Parameters:
scheduleEntryName
- Thename
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 isnull
the returned schedule entry has server scope (and creation is only allowed for server admins, else you have to be project admin).
The newScheduleEntry
is locked. UseLockable.save()
andLockable.unlock()
to persist your settings.- Parameters:
scheduleEntryName
- Thename
of the new schedule entry.project
- The project this schedule entry is assigned to ornull
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 givenscheduleEntry
to another project or to server scoped, ifproject
isnull
. 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 destinationProject
ornull
to 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, iffalse
the 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
- TheProject
which entries should be returned.- Returns:
- A list of schedule entries depending to given project.
- Since:
- 4.0
-
getScheduleEntry
Returns the specified schedule entry ornull
if it couldn't be found.- Parameters:
project
- TheProject
which entries should be scanned.name
- The schedule entryname
.- Returns:
- The specified schedule entry or
null
if 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 mode
is set toDISALLOWED_WAIT
.- Returns:
- A list of queued or waiting schedule entries.
- Since:
- 4.1.13
-
getScheduleEntryControl
Get theScheduleEntryControl
for a given id.- Parameters:
executionId
- The execution id of requestedScheduleEntryControl
.- Returns:
- The
ScheduleEntryControl
for the given id, ornull
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
- 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
-