public class OAuthDataController extends java.lang.Object implements IAuthDataController
Modifier and Type | Class and Description |
---|---|
static class |
OAuthDataController.OAuthTokenState |
Constructor and Description |
---|
OAuthDataController(BoxClient boxClient,
java.lang.String clientId,
java.lang.String clientSecret,
boolean autoRefresh) |
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.
|
java.lang.String |
getAuthority() |
java.lang.String |
getClientId() |
java.lang.String |
getClientSecret() |
java.lang.Exception |
getRefreshFailException() |
java.lang.String |
getScheme() |
OAuthDataController.OAuthTokenState |
getTokenState() |
java.lang.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(java.lang.String deviceId)
Set device id.
|
void |
setDeviceName(java.lang.String deviceName)
Set device name.
|
void |
setOAuthData(BoxOAuthToken token) |
void |
setRefreshFail(java.lang.Exception refreshFailException) |
void |
setTokenState(OAuthDataController.OAuthTokenState tokenState) |
void |
setWaitTimeOut(int timeout)
Set the timeout for threads waiting for OAuth token refresh.
|
public OAuthDataController(BoxClient boxClient, java.lang.String clientId, java.lang.String clientSecret, boolean autoRefresh)
public void setAutoRefreshOAuth(boolean autoRefresh)
autoRefresh
- public void setWaitTimeOut(int timeout)
timeout
- public java.lang.String getScheme()
public java.lang.String getAuthority()
public java.lang.String getUrlPath()
public java.lang.String getClientId()
public java.lang.String getClientSecret()
public void setOAuthData(BoxOAuthToken token)
public void setDeviceId(java.lang.String deviceId)
deviceId
- device idpublic void setDeviceName(java.lang.String deviceName)
deviceName
- device namepublic OAuthDataController.OAuthTokenState getTokenState()
public void setTokenState(OAuthDataController.OAuthTokenState tokenState)
tokenState
- the mTokenState to setpublic java.lang.Exception getRefreshFailException()
public void setRefreshFail(java.lang.Exception refreshFailException)
refreshFailException
- the refreshFailException to setpublic void initialize()
public BoxOAuthToken getAuthData() throws AuthFatalFailureException
getAuthData
in interface IAuthDataController
AuthFatalFailureException
public void refresh() throws AuthFatalFailureException
refresh
in interface IAuthDataController
AuthFatalFailureException
- exceptionpublic boolean getAndSetLock(boolean doLock)
doLock
- whether want to lock after getting the lock.public void addOAuthRefreshListener(OAuthRefreshListener listener)