net.netheos.pcsapi.oauth
Class OAuth2SessionManager
java.lang.Object
net.netheos.pcsapi.oauth.SessionManager<OAuth2Credentials>
net.netheos.pcsapi.oauth.OAuth2SessionManager
- All Implemented Interfaces:
- HttpExecutor
public class OAuth2SessionManager
- extends SessionManager<OAuth2Credentials>
OAuth2 session manager (used by most providers).
|
Method Summary |
CResponse |
execute(org.apache.http.client.methods.HttpUriRequest request)
Execute the request |
void |
refreshToken()
Refreshes access token after expiration (before sending request) thanks to the refresh token. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuth2SessionManager
public OAuth2SessionManager(String authorizeUrl,
String accessTokenUrl,
String refreshTokenUrl,
boolean scopeInAuthorization,
Character scopePermsSeparator,
StorageBuilder builder)
execute
public CResponse execute(org.apache.http.client.methods.HttpUriRequest request)
- Description copied from interface:
HttpExecutor
- Execute the request
- Parameters:
request - The http request
- Returns:
- The http response
refreshToken
public void refreshToken()
throws CStorageException
- Refreshes access token after expiration (before sending request) thanks to the refresh token. The bew access
token is then stored in this manager.
Method is synchronized so that no two threads will attempt to refresh at the same time. If a locked thread sees
that token has already been refreshed, no refresh is attempted either.
Not all providers support tokens refresh (ex : CloudMe).
- Throws:
CStorageException
Copyright © 2014. All Rights Reserved.