com.alarmpoint.integrationagent.exceptions.retriable

## Class RetriableException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.alarmpoint.integrationagent.exceptions.retriable.RetriableException

- All Implemented Interfaces:
    java.io.Serializable

      public class RetriableException
      extends java.lang.Exception

  An exception wrapper with an associated retry policy. The retry policy is applied against the input that caused the exception.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RetriableException(java.lang.Throwable cause, int maxAttempts, long delayMillis)` A convenience constructor that wraps an exception with a retry policy that has a maximum attempt limit and a fixed delay between retries.
    `RetriableException(java.lang.Throwable cause, RetryPolicy retryPolicy)` Wraps an exception with a retry policy.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RetryPolicy` | `getRetryPolicy()` Gets the retry policy that applies to the wrapped exception.

    - ### 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`

- - ### Constructor Detail

    - #### RetriableException

          public RetriableException(java.lang.Throwable cause,
                                    RetryPolicy retryPolicy)

      Wraps an exception with a retry policy.
      Parameters:
        `cause` - - the wrapped exception; may be null if unknown
        `retryPolicy` - - the retryPolicy policy that should apply to the wrapped exception; must be non-null

    - #### RetriableException

          public RetriableException(java.lang.Throwable cause,
                                    int maxAttempts,
                                    long delayMillis)

      A convenience constructor that wraps an exception with a retry policy that has a maximum attempt limit and a fixed delay between retries.
      Parameters:
        `cause` - - the wrapped exception; may be null if unknown
        `maxAttempts` - - the maximum number of attempts (first attempt and retries) that will be allowed; must be >= 1
        `delayMillis` - - the miminum delay (in milliseconds) between each retry attempt; must be >= 0 with 0 indicating no delay

  - ### Method Detail

    - #### getRetryPolicy

          public RetryPolicy getRetryPolicy()

      Gets the retry policy that applies to the wrapped exception.
      Returns:
        a non-null `RetryPolicy`