Package com.sodius.oslc.server.core.jobs
Class Job
- java.lang.Object
-
- com.sodius.oslc.server.core.jobs.Job
-
public abstract class Job extends Object
A job to schedule and execute as a periodic background task.Jobs can be scheduled either at a
fixed rateor with afixed delay.- Since:
- 3.11.0
- See Also:
JobScheduler.clusterJob(String),JobScheduler.localJob(String)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJob.BuilderA builder ofJob.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()Returns the identifier of the job.JobSchedulegetSchedule()Returns the schedule that determines when the job must execute.StringtoString()
-
-
-
Constructor Detail
-
Job
protected Job(String id)
Creates a job instance with the given identifier.- Parameters:
id- the job identifier- Throws:
NullPointerException- if id is null or empty
-
-
Method Detail
-
getId
public final String getId()
Returns the identifier of the job.- Returns:
- the job identifier
-
getSchedule
public final JobSchedule getSchedule()
Returns the schedule that determines when the job must execute.- Returns:
- the schedule
-
-