org.apache.manifoldcf.agents.interfaces
Class ServiceInterruption

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.apache.manifoldcf.agents.interfaces.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
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  long retryTime
          This is the time (in milliseconds since epoch) when to retry the request.
 
Constructor Summary
ServiceInterruption(java.lang.String message, long retryTime)
          Constructor.
ServiceInterruption(java.lang.String message, java.lang.Throwable failureCause, long retryTime, long failTime, int failRetryCount, boolean abortOnFail)
          Constructor.
 
Method Summary
 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?
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, 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

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

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?

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,
                           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.