Package org.netxms.client
Class ScheduledTask
java.lang.Object
org.netxms.client.ScheduledTask
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate empty task objectScheduledTask
(String taskHandlerId, String schedule, String parameters, String comments, Date executionTime, int flags, long objectId) Create new scheduled task objectScheduledTask
(NXCPMessage msg, long base) Create task object from NXCP message -
Method Summary
Modifier and TypeMethodDescriptionvoid
fillMessage
(NXCPMessage msg) Fill NXCP message with task dataGet task commentsint
getFlags()
long
getId()
getKey()
Get task keylong
int
getOwner()
Get recurring task scheduleGet task statusGet ID of scheduled task handler.boolean
Check if this task has completed executionboolean
Check if this task is disabledboolean
Check if this task is configured for recurring executionboolean
isSystem()
Check if this task is a system taskvoid
setComments
(String comments) Set scheduled task commentsvoid
setEnabed
(boolean enabled) Enable/disable taskvoid
setExecutionTime
(Date executionTime) void
setFlags
(int flags) void
setId
(long id) void
Set task keyvoid
setLastExecutionTime
(Date lastExecutionTime) void
setObjectId
(long objectId) void
setOwner
(int owner) void
setParameters
(String parameters) void
setSchedule
(String schedule) Set recurring task schedulevoid
setTaskHandlerId
(String taskHandlerId) Set ID of scheduled task handler.
-
Field Details
-
DISABLED
public static final int DISABLED- See Also:
-
EXECUTED
public static final int EXECUTED- See Also:
-
RUNNING
public static final int RUNNING- See Also:
-
SYSTEM
public static final int SYSTEM- See Also:
-
-
Constructor Details
-
ScheduledTask
public ScheduledTask()Create empty task object -
ScheduledTask
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 Details
-
fillMessage
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
Get ID of scheduled task handler.- Returns:
- scheduled task handler ID
-
setTaskHandlerId
Set ID of scheduled task handler.- Parameters:
taskHandlerId
- new scheduled task handler ID
-
getSchedule
Get recurring task schedule- Returns:
- recurring task schedule
-
setSchedule
Set recurring task schedule- Parameters:
schedule
- new recurring task schedule
-
getParameters
- Returns:
- the parameters
-
setParameters
- Parameters:
parameters
- the parameters to set
-
getExecutionTime
- Returns:
- the executionTime
-
setExecutionTime
- Parameters:
executionTime
- the executionTime to set
-
getLastExecutionTime
- Returns:
- the lastExecutionTime
-
setLastExecutionTime
- 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 int getOwner()- Returns:
- the owner
-
setOwner
public void setOwner(int 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
Get task key- Returns:
- task key
-
setKey
Set task key- Parameters:
key
- new task key
-
getStatus
Get task status- Returns:
- task status
-
getComments
Get task comments- Returns:
- comments
-
setComments
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
-