Interface ProgressReporter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getId()
      Return an ID string for this monitor/reporter.
      TaskState getState()
      Return the state of the task.
      void report​(String message)
      Log a progress message, this may be timestamped by the reporter implementation.
      void report​(String message, int lineNumber)
      Log a progress message with an associated line number, this may be timestamped by the reporter implementation.
      void report​(String message, int lineNumber, String type)
      Log a progress message with an associated line number, this may be timestamped by the reporter implementation.
      void report​(String message, String type)
      Log a progress message, this may be timestamped by the reporter implementation.
      void reportError​(String message)
      Report an error as a progress message of type "error" and set the status to failed
      void reportError​(String message, int lineNumber)
      Report an error as a progress message of type "error" and set the status to failed
      void setFailed()
      Record that a task has completed but with an error.
      void setProgress​(int progress)
      Set the progress percentage.
      void setState​(TaskState state)
      Change the state of the progress report.
      void setSucceeded()
      Record that a task has completed but successfully
      void setSuccess​(boolean wasSuccessful)
      Record whether the task was successful or not.
    • Method Detail

      • getId

        String getId()
        Return an ID string for this monitor/reporter. Useful when managing a pool of persistent status reports.
      • setState

        void setState​(TaskState state)
        Change the state of the progress report.
      • setProgress

        void setProgress​(int progress)
        Set the progress percentage.
      • setSuccess

        void setSuccess​(boolean wasSuccessful)
        Record whether the task was successful or not.
      • setSucceeded

        void setSucceeded()
        Record that a task has completed but successfully
      • setFailed

        void setFailed()
        Record that a task has completed but with an error.
      • report

        void report​(String message,
                    String type)
        Log a progress message, this may be timestamped by the reporter implementation.
        Parameters:
        message - the message text
        type - the nature of the message e.g. "error", application dependent what types are supported
      • report

        void report​(String message,
                    int lineNumber,
                    String type)
        Log a progress message with an associated line number, this may be timestamped by the reporter implementation.
        Parameters:
        message - the message text
        type - the nature of the message e.g. "error", application dependent what types are supported
        lineNumber - the number in some input file corresponding the the message
      • report

        void report​(String message)
        Log a progress message, this may be timestamped by the reporter implementation.
      • reportError

        void reportError​(String message)
        Report an error as a progress message of type "error" and set the status to failed
      • reportError

        void reportError​(String message,
                         int lineNumber)
        Report an error as a progress message of type "error" and set the status to failed
      • report

        void report​(String message,
                    int lineNumber)
        Log a progress message with an associated line number, this may be timestamped by the reporter implementation.
        Parameters:
        message - the message text
        lineNumber - the number in some input file corresponding the the message
      • getState

        TaskState getState()
        Return the state of the task. It may be Waiting to start, Running or Terminated.