public class OAuthDataController extends Object implements IAuthDataController
| Modifier and Type | Class and Description |
|---|---|
static class |
OAuthDataController.OAuthTokenState |
| Constructor and Description |
|---|
OAuthDataController(BoxClient boxClient,
String clientId,
String clientSecret,
boolean autoRefresh)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOAuthRefreshListener(OAuthRefreshListener listener) |
boolean |
getAndSetLock(boolean doLock)
Get the lock, optionally lock the lock after getting the lock.
|
BoxOAuthToken |
getAuthData()
Get OAuthData, counting number of retries, in case of too many retries, throw.
|
String |
getAuthority() |
String |
getClientId() |
String |
getClientSecret() |
Exception |
getRefreshFailException() |
String |
getScheme() |
OAuthDataController.OAuthTokenState |
getTokenState() |
String |
getUrlPath() |
void |
initialize()
Initialize the controller.
|
void |
refresh()
Refresh the OAuth.
|
void |
setAutoRefreshOAuth(boolean autoRefresh)
Makes OAuth auto refresh itself when token expires.
|
void |
setDeviceId(String deviceId)
Set device id.
|
void |
setDeviceName(String deviceName)
Set device name.
|
void |
setOAuthData(BoxOAuthToken token) |
void |
setRefreshFail(Exception refreshFailException) |
void |
setTokenState(OAuthDataController.OAuthTokenState tokenState) |
void |
setWaitTimeOut(int timeout)
Set the timeout for threads waiting for OAuth token refresh.
|
public void setAutoRefreshOAuth(boolean autoRefresh)
autoRefresh - public void setWaitTimeOut(int timeout)
timeout - public String getScheme()
public String getAuthority()
public String getUrlPath()
public String getClientId()
public String getClientSecret()
public void setOAuthData(BoxOAuthToken token)
public void setDeviceId(String deviceId)
deviceId - device idpublic void setDeviceName(String deviceName)
deviceName - device namepublic OAuthDataController.OAuthTokenState getTokenState()
public void setTokenState(OAuthDataController.OAuthTokenState tokenState)
tokenState - the mTokenState to setpublic Exception getRefreshFailException()
public void setRefreshFail(Exception refreshFailException)
refreshFailException - the refreshFailException to setpublic void initialize()
public BoxOAuthToken getAuthData() throws AuthFatalFailureException
getAuthData in interface IAuthDataControllerAuthFatalFailureExceptionpublic void refresh()
throws AuthFatalFailureException
refresh in interface IAuthDataControllerAuthFatalFailureException - exceptionpublic boolean getAndSetLock(boolean doLock)
doLock - whether want to lock after getting the lock.public void addOAuthRefreshListener(OAuthRefreshListener listener)
Copyright © 2014. All Rights Reserved.