org.jclouds.dynect.v3.filters
Class SessionManager

java.lang.Object
  extended by org.jclouds.http.handlers.BackoffLimitedRetryHandler
      extended by org.jclouds.dynect.v3.filters.SessionManager
All Implemented Interfaces:
org.jclouds.http.HttpRequestFilter, org.jclouds.http.HttpRetryHandler, org.jclouds.http.IOExceptionRetryHandler

public final class SessionManager
extends org.jclouds.http.handlers.BackoffLimitedRetryHandler
implements org.jclouds.http.HttpRequestFilter

This class manages session interactions, including grabbing latest from the cache, and invalidating upon 401 If the credentials supplied in the authentication header are invalid, or if the token has expired, the server returns HTTP response code 401. After the token expires, you must log in again to obtain a new token.


Field Summary
 
Fields inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler
INSTANCE
 
Fields inherited from interface org.jclouds.http.HttpRetryHandler
ALWAYS_RETRY, NEVER_RETRY
 
Fields inherited from interface org.jclouds.http.IOExceptionRetryHandler
ALWAYS_RETRY, NEVER_RETRY
 
Method Summary
 org.jclouds.http.HttpRequest filter(org.jclouds.http.HttpRequest request)
           
 void logoutOnClose()
          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
 

Method Detail

filter

public org.jclouds.http.HttpRequest filter(org.jclouds.http.HttpRequest request)
                                    throws org.jclouds.http.HttpException
Specified by:
filter in interface org.jclouds.http.HttpRequestFilter
Throws:
org.jclouds.http.HttpException

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.



Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.