Class ResilienceConfiguration.TimeLimiterConfiguration

java.lang.Object
com.sap.cloud.sdk.cloudplatform.resilience.ResilienceConfiguration.TimeLimiterConfiguration
Enclosing class:
ResilienceConfiguration

public static final class ResilienceConfiguration.TimeLimiterConfiguration extends Object
Provides options specific to timeouts.
  • Field Details

    • DEFAULT_TIMEOUT_DURATION

      public static final Duration DEFAULT_TIMEOUT_DURATION
      The default timeout duration.
    • DEFAULT_SHOULD_CANCEL_RUNNING_FUTURE

      public static final boolean DEFAULT_SHOULD_CANCEL_RUNNING_FUTURE
      The default behaviour for canceling running tasks.
      See Also:
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Get the status indicator for TimeLimiter.
      Returns:
      True if the configuration is enabled.
    • disabled

      @Nonnull public static ResilienceConfiguration.TimeLimiterConfiguration disabled()
      Creates a new TimeLimiterConfiguration that allows for requests to run indefinitely, effectively disabling timeouts.
      Returns:
      A disabled time limiter.
    • of

      @Nonnull public static ResilienceConfiguration.TimeLimiterConfiguration of(@Nonnull Duration timeoutDuration)
      Create a timeout by specifying a timeout duration.
      Alternatively use TimeLimiterConfiguration.of().timeoutDuration( int ) instead.
      Parameters:
      timeoutDuration - The maximum duration to wait for a request to return.
      Returns:
      An immutable TimeLimiterConfiguration.
    • of

    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • timeoutDuration

      @Nonnull public Duration timeoutDuration()
      The timeout duration.
    • shouldCancelRunningFuture

      public boolean shouldCancelRunningFuture()
      Whether to cancel the running future.
    • timeoutDuration

      @Nonnull public ResilienceConfiguration.TimeLimiterConfiguration timeoutDuration(@Nonnull Duration timeoutDuration)
      The timeout duration.
      Returns:
      this.
    • shouldCancelRunningFuture

      @Nonnull public ResilienceConfiguration.TimeLimiterConfiguration shouldCancelRunningFuture(boolean shouldCancelRunningFuture)
      Whether to cancel the running future.
      Returns:
      this.