public class TaskDefinition extends BaseOpenmrsMetadata
Constructor and Description |
---|
TaskDefinition()
Default no-arg public constructor
|
TaskDefinition(java.lang.Integer id,
java.lang.String name,
java.lang.String description,
java.lang.String taskClass)
Public constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getCreatedBy()
Deprecated.
|
java.lang.Integer |
getId()
Get the task identifier.
|
java.util.Date |
getLastExecutionTime()
Get the time the task was last executed.
|
java.util.Date |
getNextExecutionTime()
Convenience method that asks SchedulerUtil for it's next execution time.
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Get the data map used to provide the task with runtime data.
|
java.lang.String |
getProperty(java.lang.String key)
Get task configuration property.
|
java.lang.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.
|
java.lang.Boolean |
getStarted()
Gets the flag that indicates whether the task has been started.
|
java.lang.Boolean |
getStartOnStartup()
Gets the flag that indicates whether the task should startup as soon as the scheduler starts.
|
java.util.Date |
getStartTime()
Get the start time for when the task should be executed.
|
java.lang.String |
getStartTimePattern()
Get the date format used to set the start time.
|
java.lang.String |
getTaskClass()
Get the schedulable object to be executed.
|
Task |
getTaskInstance()
Gets the runnable task instance associated with this definition.
|
void |
setCreatedBy(User authenticatedUser)
Deprecated.
|
void |
setId(java.lang.Integer id)
Set the task identifier.
|
void |
setLastExecutionTime(java.util.Date lastExecutionTime)
Set the time the task was last executed
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
Set the properties of the task.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Set task configuration property.
|
void |
setRepeatInterval(java.lang.Long repeatInterval)
Sets the number of seconds until task is executed again.
|
void |
setStarted(java.lang.Boolean started)
Sets the flag that indicates whether the task has been started.
|
void |
setStartOnStartup(java.lang.Boolean startOnStartup)
Sets the flag that indicates whether the task should startup as soon as the scheduler starts.
|
void |
setStartTime(java.util.Date startTime)
Set the start time for when the task should be executed.
|
void |
setStartTimePattern(java.lang.String pattern)
Sets the date format used to set the start time.
|
void |
setTaskClass(java.lang.String taskClass)
Set the schedulable object to be executed.
|
void |
setTaskInstance(Task taskInstance)
Sets the runnable task instance associated with this definition.
|
java.lang.String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and
the
uuid field surrounded by [ and ] . |
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public TaskDefinition()
public TaskDefinition(java.lang.Integer id, java.lang.String name, java.lang.String description, java.lang.String taskClass)
public java.lang.Integer getId()
Integer
identifier of the taskpublic void setId(java.lang.Integer id)
id
- public java.util.Map<java.lang.String,java.lang.String> getProperties()
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- Map
of the properties to setpublic java.lang.String getTaskClass()
public void setTaskClass(java.lang.String taskClass)
taskClass
- String
taskClass of a schedulable objectpublic java.util.Date getStartTime()
public void setStartTime(java.util.Date startTime)
startTime
- start time for the taskpublic java.util.Date getLastExecutionTime()
public void setLastExecutionTime(java.util.Date lastExecutionTime)
lastExecutionTime
- last execution timepublic java.lang.Long getRepeatInterval()
public void setRepeatInterval(java.lang.Long repeatInterval)
repeatInterval
- number of seconds, or 0 to indicate to repetitionpublic java.lang.String getStartTimePattern()
public void setStartTimePattern(java.lang.String pattern)
public java.lang.Boolean getStartOnStartup()
public void setStartOnStartup(java.lang.Boolean startOnStartup)
public java.lang.Boolean getStarted()
public void setStarted(java.lang.Boolean started)
public java.lang.String getProperty(java.lang.String key)
key
- the String
key of the property to getString
value for the given keypublic void setProperty(java.lang.String key, java.lang.String value)
key
- the String
key of the property to setvalue
- the String
value of the property to setpublic java.util.Date getNextExecutionTime()
Date
of the next executionpublic long getSecondsUntilNextExecutionTime()
public java.lang.String toString()
BaseOpenmrsObject
uuid
field surrounded by [
and ]
. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid
field is null
, it delegates to
Object.toString()
toString
in class BaseOpenmrsObject
Object.toString()
public Task getTaskInstance()
public void setTaskInstance(Task taskInstance)
taskInstance
- public java.lang.Object getCreatedBy()
BaseOpenmrsMetadata.getCreator()
public void setCreatedBy(User authenticatedUser)
BaseOpenmrsMetadata.setCreator(User)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.