Package org.netxms.client
Class ScheduledTask
- java.lang.Object
-
- org.netxms.client.ScheduledTask
-
public class ScheduledTask extends Object
-
-
Constructor Summary
Constructors Constructor Description ScheduledTask()Create empty task objectScheduledTask(String taskHandlerId, String schedule, String parameters, String comments, Date executionTime, int flags, long objectId)Create new scheduled task objectScheduledTask(org.netxms.base.NXCPMessage msg, long base)Create task object from NXCP message
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfillMessage(org.netxms.base.NXCPMessage msg)Fill NXCP message with task dataStringgetComments()Get task commentsDategetExecutionTime()intgetFlags()longgetId()StringgetKey()Get task keyDategetLastExecutionTime()longgetObjectId()longgetOwner()StringgetParameters()StringgetSchedule()Get recurring task scheduleStringgetStatus()Get task statusStringgetTaskHandlerId()Get ID of scheduled task handler.booleanisCompleted()Check if this task has completed executionbooleanisDisabled()Check if this task is disabledbooleanisRecurring()Check if this task is configured for recurring executionbooleanisSystem()Check if this task is a system taskvoidsetComments(String comments)Set scheduled task commentsvoidsetEnabed(boolean enabled)Enable/disable taskvoidsetExecutionTime(Date executionTime)voidsetFlags(int flags)voidsetId(long id)voidsetKey(String key)Set task keyvoidsetLastExecutionTime(Date lastExecutionTime)voidsetObjectId(long objectId)voidsetOwner(long owner)voidsetParameters(String parameters)voidsetSchedule(String schedule)Set recurring task schedulevoidsetTaskHandlerId(String taskHandlerId)Set ID of scheduled task handler.
-
-
-
Field Detail
-
DISABLED
public static final int DISABLED
- See Also:
- Constant Field Values
-
EXECUTED
public static final int EXECUTED
- See Also:
- Constant Field Values
-
RUNNING
public static final int RUNNING
- See Also:
- Constant Field Values
-
SYSTEM
public static final int SYSTEM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ScheduledTask
public ScheduledTask()
Create empty task object
-
ScheduledTask
public ScheduledTask(org.netxms.base.NXCPMessage msg, long base)Create task object from NXCP message- Parameters:
msg- NXCP messagebase- base field ID
-
ScheduledTask
public ScheduledTask(String taskHandlerId, String schedule, String parameters, String comments, Date executionTime, int flags, long objectId)
Create new scheduled task object- Parameters:
taskHandlerId- scheduled task handler IDschedule- schedule for recurrent taskparameters- handler-specific parameterscomments- task commentsexecutionTime- execution time for "run once" tasksflags- task flagsobjectId- ID of NetXMS object associated with this task
-
-
Method Detail
-
fillMessage
public void fillMessage(org.netxms.base.NXCPMessage msg)
Fill NXCP message with task data- Parameters:
msg- NXCP message
-
getId
public long getId()
- Returns:
- the id
-
setId
public void setId(long id)
- Parameters:
id- the id to set
-
getTaskHandlerId
public String getTaskHandlerId()
Get ID of scheduled task handler.- Returns:
- scheduled task handler ID
-
setTaskHandlerId
public void setTaskHandlerId(String taskHandlerId)
Set ID of scheduled task handler.- Parameters:
taskHandlerId- new scheduled task handler ID
-
getSchedule
public String getSchedule()
Get recurring task schedule- Returns:
- recurring task schedule
-
setSchedule
public void setSchedule(String schedule)
Set recurring task schedule- Parameters:
schedule- new recurring task schedule
-
getParameters
public String getParameters()
- Returns:
- the parameters
-
setParameters
public void setParameters(String parameters)
- Parameters:
parameters- the parameters to set
-
getExecutionTime
public Date getExecutionTime()
- Returns:
- the executionTime
-
setExecutionTime
public void setExecutionTime(Date executionTime)
- Parameters:
executionTime- the executionTime to set
-
getLastExecutionTime
public Date getLastExecutionTime()
- Returns:
- the lastExecutionTime
-
setLastExecutionTime
public void setLastExecutionTime(Date lastExecutionTime)
- Parameters:
lastExecutionTime- the lastExecutionTime to set
-
getFlags
public int getFlags()
- Returns:
- the flags
-
setFlags
public void setFlags(int flags)
- Parameters:
flags- the flags to set
-
getOwner
public long getOwner()
- Returns:
- the owner
-
setOwner
public void setOwner(long owner)
- Parameters:
owner- the owner to set
-
getObjectId
public long getObjectId()
- Returns:
- the objectId
-
setObjectId
public void setObjectId(long objectId)
- Parameters:
objectId- the objectId to set
-
getKey
public String getKey()
Get task key- Returns:
- task key
-
setKey
public void setKey(String key)
Set task key- Parameters:
key- new task key
-
getStatus
public String getStatus()
Get task status- Returns:
- task status
-
getComments
public String getComments()
Get task comments- Returns:
- comments
-
setComments
public void setComments(String comments)
Set scheduled task comments- Parameters:
comments- The comments to set
-
isSystem
public boolean isSystem()
Check if this task is a system task- Returns:
- true if this task is a system task
-
isCompleted
public boolean isCompleted()
Check if this task has completed execution- Returns:
- true if this task has completed execution
-
isDisabled
public boolean isDisabled()
Check if this task is disabled- Returns:
- true if this task is disabled
-
isRecurring
public boolean isRecurring()
Check if this task is configured for recurring execution- Returns:
- true if this task is configured for recurring execution
-
setEnabed
public void setEnabed(boolean enabled)
Enable/disable task- Parameters:
enabled- true if task should be enabled
-
-