Class ServiceInterruption

  • All Implemented Interfaces:
    java.io.Serializable

    public class ServiceInterruption
    extends java.lang.Exception
    This is an exception that means that service was interrupted. The exception contains a description of when the service may be restored.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String _rcsid  
      protected boolean abortOnFail
      Should we abort the process if failure condition has been reached?
      protected int failRetryCount
      This is the number of retries to permit before FAIL.
      protected long failTime
      This is the time (in milliseconds since epoch) to FAIL if no successful read has yet occurred.
      protected boolean jobInactiveAbort
      True if job inactive abort.
      protected long retryTime
      This is the time (in milliseconds since epoch) when to retry the request.
    • Constructor Summary

      Constructors 
      Constructor Description
      ServiceInterruption​(java.lang.String message, long retryTime)
      Constructor.
      ServiceInterruption​(java.lang.String message, long retryTime, boolean jobInactiveAbort)
      Constructor.
      ServiceInterruption​(java.lang.String message, java.lang.Throwable failureCause, long retryTime, long failTime, int failRetryCount, boolean abortOnFail)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFailRetryCount()
      Get the number of error iterations needed before failure should be declared.
      long getFailTime()
      Get the fail time.
      long getRetryTime()
      Get the retry time.
      boolean isAbortOnFail()
      On failure, should we abort?
      boolean jobInactiveAbort()
      Check if this service interruption is due to a job aborting.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • retryTime

        protected long retryTime
        This is the time (in milliseconds since epoch) when to retry the request.
      • failTime

        protected long failTime
        This is the time (in milliseconds since epoch) to FAIL if no successful read has yet occurred.
      • failRetryCount

        protected int failRetryCount
        This is the number of retries to permit before FAIL. -1 means infinite.
      • abortOnFail

        protected boolean abortOnFail
        Should we abort the process if failure condition has been reached?
      • jobInactiveAbort

        protected boolean jobInactiveAbort
        True if job inactive abort.
    • Constructor Detail

      • ServiceInterruption

        public ServiceInterruption​(java.lang.String message,
                                   long retryTime)
        Constructor.
        Parameters:
        message - is the exact error condition.
        retryTime - is the time to retry.
      • ServiceInterruption

        public ServiceInterruption​(java.lang.String message,
                                   long retryTime,
                                   boolean jobInactiveAbort)
        Constructor.
        Parameters:
        message - is the exact error condition.
        retryTime - is the time to retry.
        jobInactiveAbort - is true if this exception being thrown because the job is aborting
      • ServiceInterruption

        public ServiceInterruption​(java.lang.String message,
                                   java.lang.Throwable failureCause,
                                   long retryTime,
                                   long failTime,
                                   int failRetryCount,
                                   boolean abortOnFail)
        Constructor.
        Parameters:
        message - is the exact error condition.
        failureCause - is an exception that should be reported if it is decided to abort the process.
        retryTime - is the time to retry.
        failTime - is the time to fail.
        failRetryCount - is the number of times to retry before declaring failure.
        abortOnFail - signals what to do if failure. Setting this to "true" will cause whatever process incurred the service interruption to stop immediately, if failure condition has been reached.
    • Method Detail

      • getRetryTime

        public long getRetryTime()
        Get the retry time.
        Returns:
        the retry time.
      • getFailTime

        public long getFailTime()
        Get the fail time.
        Returns:
        the fail time. Returns -1L if there is no fail time.
      • getFailRetryCount

        public int getFailRetryCount()
        Get the number of error iterations needed before failure should be declared.
        Returns:
        the count, -1 if infinite.
      • isAbortOnFail

        public boolean isAbortOnFail()
        On failure, should we abort?
        Returns:
        true if abort is requested when failure is declared.
      • jobInactiveAbort

        public boolean jobInactiveAbort()
        Check if this service interruption is due to a job aborting.
        Returns:
        true if yes