Class TaskEvent
java.lang.Object
com.inet.taskplanner.server.api.event.TaskEvent
Event when a task was added, modified, deleted, activated, deactivated, started or execution finished.
- Since:
- taskplanner 3.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTaskEvent
(int progress, @Nonnull com.inet.id.GUID taskID, @Nonnull com.inet.id.GUID executionID) Creates a new TaskEvent instance with a fixed type ofTaskEvent.TaskEventType.PROGRESS
TaskEvent
(@Nonnull TaskEvent.TaskEventType type, @Nonnull com.inet.id.GUID taskID) Creates a new TaskEvent instance.TaskEvent
(@Nonnull TaskEvent.TaskEventType type, @Nonnull com.inet.id.GUID taskID, @Nonnull com.inet.id.GUID executionID) Creates a new TaskEvent instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable com.inet.id.GUID
Get the ID of the execution this event is about.int
Returns the progress of the current task execution in casegetType()
returnsTaskEvent.TaskEventType.PROGRESS
@Nonnull com.inet.id.GUID
Get the ID of the task this event is about.@Nonnull TaskEvent.TaskEventType
getType()
Get the type of this event.int
hashCode()
toString()
-
Constructor Details
-
TaskEvent
public TaskEvent(@Nonnull @Nonnull TaskEvent.TaskEventType type, @Nonnull @Nonnull com.inet.id.GUID taskID) Creates a new TaskEvent instance.- Parameters:
type
- the type for this eventtaskID
- the task the event is for- Throws:
IllegalArgumentException
- if type or taskID is null.- Since:
- taskplanner 3.0
-
TaskEvent
public TaskEvent(@Nonnull @Nonnull TaskEvent.TaskEventType type, @Nonnull @Nonnull com.inet.id.GUID taskID, @Nonnull @Nonnull com.inet.id.GUID executionID) Creates a new TaskEvent instance.- Parameters:
type
- the type for this eventtaskID
- the task the event is forexecutionID
- ID of the execution the event is about- Throws:
IllegalArgumentException
- if type or taskID is null.- Since:
- taskplanner 22.10
-
TaskEvent
public TaskEvent(int progress, @Nonnull @Nonnull com.inet.id.GUID taskID, @Nonnull @Nonnull com.inet.id.GUID executionID) Creates a new TaskEvent instance with a fixed type ofTaskEvent.TaskEventType.PROGRESS
- Parameters:
progress
- the progress of the current execution of the task, a value in range of [0..100]taskID
- the task the event is forexecutionID
- ID of the execution the event is about- Throws:
IllegalArgumentException
- if type or taskID is null.- Since:
- taskplanner 22.10
-
-
Method Details
-
getType
Get the type of this event.- Returns:
- the type of this event
- Since:
- taskplanner 3.0
-
getTaskID
@Nonnull public @Nonnull com.inet.id.GUID getTaskID()Get the ID of the task this event is about.- Returns:
- ID of the corresponding task.
- Since:
- taskplanner 3.0
-
getProgress
public int getProgress()Returns the progress of the current task execution in casegetType()
returnsTaskEvent.TaskEventType.PROGRESS
- Returns:
- the progress of the current task execution, a percentage value in range [0..100]
- Since:
- taskplanner 3.0
-
getExecutionID
@Nullable public @Nullable com.inet.id.GUID getExecutionID()Get the ID of the execution this event is about. This ID identifies one execution of a task.- Returns:
- the ID of the execution, this is only set for
TaskEvent.TaskEventType.EXECUTION_STARTED
,TaskEvent.TaskEventType.EXECUTION_ENDED
orTaskEvent.TaskEventType.PROGRESS
, otherwise this returns null. - Since:
- taskplanner 22.10
-
toString
-
hashCode
public int hashCode() -
equals
-