Class SimpleProgressMonitor

    • Constructor Detail

      • SimpleProgressMonitor

        public SimpleProgressMonitor()
      • SimpleProgressMonitor

        public SimpleProgressMonitor​(String id)
      • SimpleProgressMonitor

        public SimpleProgressMonitor​(org.apache.jena.atlas.json.JsonObject stored)
    • Method Detail

      • getTimestamp

        public long getTimestamp()
      • getId

        public String getId()
        Description copied from interface: ProgressReporter
        Return an ID string for this monitor/reporter. Useful when managing a pool of persistent status reports.
        Specified by:
        getId in interface ProgressReporter
      • setSuccess

        public void setSuccess​(boolean wasSuccessful)
        Description copied from interface: ProgressReporter
        Record whether the task was successful or not.
        Specified by:
        setSuccess in interface ProgressReporter
      • report

        public void report​(String message)
        Description copied from interface: ProgressReporter
        Log a progress message, this may be timestamped by the reporter implementation.
        Specified by:
        report in interface ProgressReporter
      • report

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

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

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

        public void reportError​(String message)
        Description copied from interface: ProgressReporter
        Report an error as a progress message of type "error" and set the status to failed
        Specified by:
        reportError in interface ProgressReporter
      • reportError

        public void reportError​(String message,
                                int lineNumber)
        Description copied from interface: ProgressReporter
        Report an error as a progress message of type "error" and set the status to failed
        Specified by:
        reportError in interface ProgressReporter
      • reportStateChange

        protected void reportStateChange()
      • reportNewMessage

        protected void reportNewMessage​(ProgressMessage message)
      • getProgress

        public int getProgress()
        Description copied from interface: ProgressMonitor
        Get the progress of the task as a percentage. Not all monitors will offer fine grained progress but the progress will always be 0 for Waiting tasks, >= 1 for running tasks and 100 for Terminated tasks (even for unsuccessful termination).
        Specified by:
        getProgress in interface ProgressMonitor
      • succeeded

        public boolean succeeded()
        Description copied from interface: ProgressMonitor
        Return true if the task has Terminated and was successful.
        Specified by:
        succeeded in interface ProgressMonitor
      • moreMessagesSince

        public boolean moreMessagesSince​(int offset)
        Description copied from interface: ProgressMonitor
        Return true if there are more progress messages available since the given message number.
        Specified by:
        moreMessagesSince in interface ProgressMonitor
      • truncate

        public SimpleProgressMonitor truncate​(int offset)
        Return a truncated version of the monitor only containing message since a given offset point
      • writeIncrement

        protected void writeIncrement​(JSFullWriter out,
                                      int offset)
      • viewUpdatesSince

        public JSONWritable viewUpdatesSince​(int offset)
        Return a JSON view onto the status of the monitor including any messages since the given offset.
        Specified by:
        viewUpdatesSince in interface ProgressMonitor