Class JobStatus

  • All Implemented Interfaces:
    java.lang.Comparable<IJobStatus>, IJobStatus

    public class JobStatus
    extends java.lang.Object
    implements IJobStatus
    Basic job status implementation
    • Constructor Summary

      Constructors 
      Constructor Description
      JobStatus​(int id, Priority priority)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void calculateProgressIncrement​(int nextStepTotalIncrements)  
      int compareTo​(@NotNull IJobStatus o)
      void finishJob()  
      java.time.Duration getDuration()
      fetches the current duration of the job, if job finished gives the total runtime
      java.lang.String getFormattedDuration()
      Fetches the current duration of the job as a formatted string, if job finished gives the total runtime
      int getId()
      get the id of the jobstatus
      java.lang.String getMessage()
      Returns the current status message for the job
      Priority getPriority()
      Internal priority for the job in the run queue, probably don't show to the user.
      float getProgress()
      Progress float, percentage complete between 0 and 1
      int getProgressInt()
      Progress int, percentage complete between 0 and 100
      java.time.Instant getStartTime()
      returns the start time of the job
      int getStep()
      Fetches the current "step" for the job, the stage it is at
      void incrementProgress()  
      boolean isFinished()
      returns whether the job has finished
      void nextStep()  
      void setMessage​(java.lang.String msg)  
      void setStep​(int step)  
      void startJob()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JobStatus

        public JobStatus​(int id,
                         Priority priority)
    • Method Detail

      • calculateProgressIncrement

        public void calculateProgressIncrement​(int nextStepTotalIncrements)
      • finishJob

        public void finishJob()
      • getDuration

        public java.time.Duration getDuration()
        Description copied from interface: IJobStatus
        fetches the current duration of the job, if job finished gives the total runtime
        Specified by:
        getDuration in interface IJobStatus
        Returns:
        duration
      • getFormattedDuration

        public java.lang.String getFormattedDuration()
        Description copied from interface: IJobStatus
        Fetches the current duration of the job as a formatted string, if job finished gives the total runtime
        Specified by:
        getFormattedDuration in interface IJobStatus
        Returns:
        duration as string
      • getId

        public int getId()
        Description copied from interface: IJobStatus
        get the id of the jobstatus
        Specified by:
        getId in interface IJobStatus
        Returns:
        id
      • getMessage

        public java.lang.String getMessage()
        Description copied from interface: IJobStatus
        Returns the current status message for the job
        Specified by:
        getMessage in interface IJobStatus
        Returns:
        message
      • setMessage

        public void setMessage​(java.lang.String msg)
      • getPriority

        public Priority getPriority()
        Internal priority for the job in the run queue, probably don't show to the user.
        Returns:
        the job priority
      • getProgress

        public float getProgress()
        Progress float, percentage complete between 0 and 1
        Specified by:
        getProgress in interface IJobStatus
        Returns:
        percentage job complete between 0 and 1
      • getProgressInt

        public int getProgressInt()
        Progress int, percentage complete between 0 and 100
        Specified by:
        getProgressInt in interface IJobStatus
        Returns:
        percentage job complete between 0 and 100
      • getStartTime

        public java.time.Instant getStartTime()
        Description copied from interface: IJobStatus
        returns the start time of the job
        Specified by:
        getStartTime in interface IJobStatus
        Returns:
        start time
      • getStep

        public int getStep()
        Description copied from interface: IJobStatus
        Fetches the current "step" for the job, the stage it is at
        Specified by:
        getStep in interface IJobStatus
        Returns:
        stage of job
      • setStep

        public void setStep​(int step)
      • incrementProgress

        public void incrementProgress()
      • isFinished

        public boolean isFinished()
        Description copied from interface: IJobStatus
        returns whether the job has finished
        Specified by:
        isFinished in interface IJobStatus
        Returns:
        finished
      • nextStep

        public void nextStep()
      • startJob

        public void startJob()