Class InvalidateSessionAndRetryOn401AndLogoutOnClose

java.lang.Object
org.jclouds.http.handlers.BackoffLimitedRetryHandler
org.jclouds.cloudstack.handlers.InvalidateSessionAndRetryOn401AndLogoutOnClose
All Implemented Interfaces:
org.jclouds.http.HttpRetryHandler, org.jclouds.http.IOExceptionRetryHandler

public class InvalidateSessionAndRetryOn401AndLogoutOnClose extends org.jclouds.http.handlers.BackoffLimitedRetryHandler
This will parse and set an appropriate exception on the command object.
  • Field Summary

    Fields inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler

    INSTANCE, logger

    Fields inherited from interface org.jclouds.http.HttpRetryHandler

    ALWAYS_RETRY, NEVER_RETRY

    Fields inherited from interface org.jclouds.http.IOExceptionRetryHandler

    ALWAYS_RETRY, NEVER_RETRY
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    InvalidateSessionAndRetryOn401AndLogoutOnClose(com.google.common.cache.LoadingCache<org.jclouds.domain.Credentials,LoginResponse> authenticationResponseCache, SessionApi sessionClient)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    it is important that we close any sessions on close to help the server not become overloaded.
    boolean
    shouldRetryRequest(org.jclouds.http.HttpCommand command, org.jclouds.http.HttpResponse response)
     

    Methods inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler

    imposeBackoffExponentialDelay, imposeBackoffExponentialDelay, imposeBackoffExponentialDelay, shouldRetryRequest

    Methods inherited from class java.lang.Object

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

    • InvalidateSessionAndRetryOn401AndLogoutOnClose

      @Inject protected InvalidateSessionAndRetryOn401AndLogoutOnClose(com.google.common.cache.LoadingCache<org.jclouds.domain.Credentials,LoginResponse> authenticationResponseCache, SessionApi sessionClient)
  • Method Details

    • shouldRetryRequest

      public boolean shouldRetryRequest(org.jclouds.http.HttpCommand command, org.jclouds.http.HttpResponse response)
      Specified by:
      shouldRetryRequest in interface org.jclouds.http.HttpRetryHandler
      Overrides:
      shouldRetryRequest in class org.jclouds.http.handlers.BackoffLimitedRetryHandler
    • logoutOnClose

      @PreDestroy public void logoutOnClose()
      it is important that we close any sessions on close to help the server not become overloaded.