Interface SubmittedTask

  • Type Parameters:
    T - TaskResult (or subclass) representing type of result of submitted task.

    public interface SubmittedTask
    Obtained from the TaskRunningService, can be used to monitor status. Interface representing handler on a task submitted to TaskRunningService. It provides access to task status, task progress updates and task result. It allows to request task cancellation, add email notification of task completion.
    Author:
    anton
    • Method Detail

      • getTaskId

        String getTaskId()
      • getProgressUpdates

        Queue<String> getProgressUpdates()
        Returns queue of log statements from the running task.
        Returns:
        Queue of log statements from the running task.
      • getLastProgressUpdates

        String getLastProgressUpdates()
      • getSubmissionTime

        Date getSubmissionTime()
        Returns:
        timestamp of task submission to TaskRunningService.
      • getStartTime

        Date getStartTime()
        Returns:
        time when task started executing.
      • getFinishTime

        Date getFinishTime()
        Returns:
        time when tasks completed or failed.
      • isDone

        boolean isDone()
        Returns:
        true if task has completed or failed
      • requestCancellation

        void requestCancellation()
        Send cancellation request. It's not guaranteed that this will cancel the task but it will request task cancellation. Client can check task's status at some later point to verify that task got cancelled.
      • addEmailAlert

        void addEmailAlert()
        Add email notification of task completion. User who submitted the task will receive an email.
      • isEmailAlert

        boolean isEmailAlert()
        Returns:
        true if email notification of task completion will be sent to the user.
      • isRunningRemotely

        boolean isRunningRemotely()
        Returns:
        true if the task is running remotely (inside another JVM)