public class TaskDefinition extends BaseChangeableOpenmrsMetadata
| Constructor and Description |
|---|
TaskDefinition()
Default no-arg public constructor
|
TaskDefinition(Integer id,
String name,
String description,
String taskClass)
Public constructor
|
| Modifier and Type | Method and Description |
|---|---|
Integer |
getId()
Get the task identifier.
|
Date |
getLastExecutionTime()
Get the time the task was last executed.
|
Date |
getNextExecutionTime()
Convenience method that asks SchedulerUtil for it's next execution time.
|
Map<String,String> |
getProperties()
Get the data map used to provide the task with runtime data.
|
String |
getProperty(String key)
Get task configuration property.
|
Long |
getRepeatInterval()
Gets the number of seconds until task is executed again.
|
long |
getSecondsUntilNextExecutionTime()
Convenience method to calculate the seconds until the next execution time.
|
Boolean |
getStarted()
Gets the flag that indicates whether the task has been started.
|
Boolean |
getStartOnStartup()
Gets the flag that indicates whether the task should startup as soon as the scheduler starts.
|
Date |
getStartTime()
Get the start time for when the task should be executed.
|
String |
getStartTimePattern()
Get the date format used to set the start time.
|
String |
getTaskClass()
Get the schedulable object to be executed.
|
Task |
getTaskInstance()
Gets the runnable task instance associated with this definition.
|
void |
setId(Integer id)
Set the task identifier.
|
void |
setLastExecutionTime(Date lastExecutionTime)
Set the time the task was last executed
|
void |
setProperties(Map<String,String> properties)
Set the properties of the task.
|
void |
setProperty(String key,
String value)
Set task configuration property.
|
void |
setRepeatInterval(Long repeatInterval)
Sets the number of seconds until task is executed again.
|
void |
setStarted(Boolean started)
Sets the flag that indicates whether the task has been started.
|
void |
setStartOnStartup(Boolean startOnStartup)
Sets the flag that indicates whether the task should startup as soon as the scheduler starts.
|
void |
setStartTime(Date startTime)
Set the start time for when the task should be executed.
|
void |
setStartTimePattern(String pattern)
Sets the date format used to set the start time.
|
void |
setTaskClass(String taskClass)
Set the schedulable object to be executed.
|
void |
setTaskInstance(Task taskInstance)
Sets the runnable task instance associated with this definition.
|
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReasonequals, getUuid, hashCode, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic Integer getId()
Integer identifier of the taskpublic void setId(Integer id)
id - public Map<String,String> getProperties()
public void setProperties(Map<String,String> properties)
properties - Map<String, String> of the properties to setpublic String getTaskClass()
public void setTaskClass(String taskClass)
taskClass - String taskClass of a schedulable objectpublic Date getStartTime()
public void setStartTime(Date startTime)
startTime - start time for the taskpublic Date getLastExecutionTime()
public void setLastExecutionTime(Date lastExecutionTime)
lastExecutionTime - last execution timepublic Long getRepeatInterval()
public void setRepeatInterval(Long repeatInterval)
repeatInterval - number of seconds, or 0 to indicate to repetitionpublic String getStartTimePattern()
public void setStartTimePattern(String pattern)
public Boolean getStartOnStartup()
public void setStartOnStartup(Boolean startOnStartup)
public Boolean getStarted()
public void setStarted(Boolean started)
public String getProperty(String key)
key - the String key of the property to getString value for the given keypublic void setProperty(String key, String value)
key - the String key of the property to setvalue - the String value of the property to setpublic Date getNextExecutionTime()
Date of the next executionpublic long getSecondsUntilNextExecutionTime()
public String toString()
BaseOpenmrsObjectClassName{hashCode=..., uuid=...}
If the uuid field is null, it returns:
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString in class BaseOpenmrsObjectObject.toString()public Task getTaskInstance()
public void setTaskInstance(Task taskInstance)
taskInstance - Copyright © 2024 OpenMRS Inc.. All rights reserved.