Package org.jclouds.dynect.v3.filters
Class SessionManager
- java.lang.Object
-
- org.jclouds.http.handlers.BackoffLimitedRetryHandler
-
- org.jclouds.dynect.v3.filters.SessionManager
-
- All Implemented Interfaces:
HttpRequestFilter
,HttpRetryHandler
,IOExceptionRetryHandler
public final class SessionManager extends BackoffLimitedRetryHandler implements 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpRequest
filter(HttpRequest request)
void
logoutOnClose()
it is important that we close any sessions on close to help the server not become overloaded.boolean
shouldRetryRequest(HttpCommand command, HttpResponse response)
Return true if the command should be retried.-
Methods inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler
imposeBackoffExponentialDelay, imposeBackoffExponentialDelay, imposeBackoffExponentialDelay, shouldRetryRequest
-
-
-
-
Method Detail
-
filter
public HttpRequest filter(HttpRequest request) throws HttpException
- Specified by:
filter
in interfaceHttpRequestFilter
- Throws:
HttpException
-
shouldRetryRequest
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response)
Description copied from interface:HttpRetryHandler
Return true if the command should be retried. This method should only be invoked when the response has failed with a HTTP 5xx error indicating a server-side error.- Specified by:
shouldRetryRequest
in interfaceHttpRetryHandler
- Overrides:
shouldRetryRequest
in classBackoffLimitedRetryHandler
-
logoutOnClose
@PreDestroy public void logoutOnClose()
it is important that we close any sessions on close to help the server not become overloaded.
-
-