Interface ManagedJob
- All Superinterfaces:
net.solarnetwork.service.Identifiable
,ServiceProvider
,net.solarnetwork.settings.SettingSpecifierProvider
- All Known Implementing Classes:
SimpleManagedJob
A managed job is JobService
that needs to be performed on a schedule,
such as a repeating frequency or a cron schedule. The actual execution of the
task is handled externally; this API represents only the information needed
for some external service to execute the task. At runtime it is expected for
managed job instances to be detected and scheduled for execution.
Managed jobs must provide a unique ID for each job, via the inherited
Identifiable.getUid()
method. Additionally the job must provide a
settings UID via SettingSpecifierProvider.getSettingUid()
.
Additional services related to the job can be defined via the
ServiceProvider
API. Those services are expected to registered with
the system runtime by the external service the job is scheduled by.
- Since:
- 2.0
- Version:
- 1.1
- Author:
- matt
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.solarnetwork.node.job.ServiceProvider
ServiceProvider.ServiceConfiguration
-
Field Summary
Fields inherited from interface net.solarnetwork.service.Identifiable
GROUP_UID_PROPERTY, UID_PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionGet the JobDetail.Get the desired trigger schedule expression.default String
Get the schedule setting key.Get a collection of service configurations.default <T> T
Methods inherited from interface net.solarnetwork.service.Identifiable
getDisplayName, getGroupUid, getUid
Methods inherited from interface net.solarnetwork.settings.SettingSpecifierProvider
getDisplayName, getMessageSource, getSettingSpecifiers, getSettingUid, localizedInfo, templateSettingSpecifiers
-
Method Details
-
getJobService
JobService getJobService()Get the JobDetail.- Returns:
- the jobDetail
-
getSchedule
String getSchedule()Get the desired trigger schedule expression.This might be a cron expression or a plain number representing a millisecond period.
- Returns:
- the schedule expression, never null
-
getScheduleSettingKey
Get the schedule setting key.This defaults to schedule to match the
getSchedule()
property. However this can be changed to any setting, so that the schedule setting key can be different. This can be used to bundle multiple job schedules into the same setting UID, using different schedule setting keys for different jobs.- Returns:
- the schedule setting key, defaults to schedule
-
getServiceConfigurations
Get a collection of service configurations.- Specified by:
getServiceConfigurations
in interfaceServiceProvider
- Returns:
- A collection of configuration objects.
-
unwrap
- Specified by:
unwrap
in interfacenet.solarnetwork.settings.SettingSpecifierProvider
-