public class BoxOAuthManagerImpl extends AbstractBoxResourceManager implements IBoxOAuthManager
Constructor and Description |
---|
BoxOAuthManagerImpl(IBoxConfig config,
IBoxResourceHub resourceHub,
IBoxJSONParser parser,
IBoxRESTClient restClient)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
BoxOAuthToken |
createOAuth(BoxOAuthRequestObject requestObject) |
BoxOAuthToken |
createOAuth(java.lang.String code,
java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String redirectUrl) |
BoxOAuthToken |
createOAuth(java.lang.String code,
java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String redirectUrl,
java.lang.String deviceId,
java.lang.String deviceName) |
BoxOAuthToken |
refreshOAuth(BoxOAuthRequestObject requestObject) |
BoxOAuthToken |
refreshOAuth(java.lang.String refreshToken,
java.lang.String clientId,
java.lang.String clientSecret)
Refresh OAuth.
|
BoxOAuthToken |
refreshOAuth(java.lang.String refreshToken,
java.lang.String clientId,
java.lang.String clientSecret,
java.lang.String deviceId,
java.lang.String deviceName)
Refresh OAuth.
|
void |
revokeOAuth(BoxOAuthRequestObject requestObject) |
void |
revokeOAuth(java.lang.String accessToken,
java.lang.String clientId,
java.lang.String clientSecret)
Revoke OAuth.
|
executeRequestWithNoResponseBody, getAuth, getClassFromType, getConfig, getJSONParser, getResourceHub, getResponseAndParse, getResponseAndParseAndTryCast, getRestClient, tryCastBoxItem, tryCastObject
public BoxOAuthManagerImpl(IBoxConfig config, IBoxResourceHub resourceHub, IBoxJSONParser parser, IBoxRESTClient restClient)
config
- configresourceHub
- resource hubparser
- json parserrestClient
- REST client to make api calls.public BoxOAuthToken createOAuth(java.lang.String code, java.lang.String clientId, java.lang.String clientSecret, java.lang.String redirectUrl) throws BoxRestException, BoxServerException, AuthFatalFailureException
createOAuth
in interface IBoxOAuthManager
code
- The authorization code you retrieved previously used to create OAuth.clientId
- client idclientSecret
- client secretredirectUrl
- optional, required only if a redirect URI is not configured at Box Developers Services, use
null if don't want to supply this field.BoxRestException
- See BoxRestException
for more info.BoxServerException
- See com.box.restclientv2.exceptions.BoxServerException
for more info.AuthFatalFailureException
- See com.box.restclientv2.exceptions.AuthFatalFailureException
for more info.public BoxOAuthToken createOAuth(java.lang.String code, java.lang.String clientId, java.lang.String clientSecret, java.lang.String redirectUrl, java.lang.String deviceId, java.lang.String deviceName) throws BoxRestException, BoxServerException, AuthFatalFailureException
createOAuth
in interface IBoxOAuthManager
code
- The authorization code you retrieved previously used to create OAuth.clientId
- client idclientSecret
- client secretredirectUrl
- optional, required only if a redirect URI is not configured at Box Developers Services, use
null if don't want to supply this field.deviceId
- device iddeviceName
- device nameBoxRestException
- See BoxRestException
for more info.BoxServerException
- See com.box.restclientv2.exceptions.BoxServerException
for more info.AuthFatalFailureException
- See com.box.restclientv2.exceptions.AuthFatalFailureException
for more info.public BoxOAuthToken createOAuth(BoxOAuthRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
public BoxOAuthToken refreshOAuth(java.lang.String refreshToken, java.lang.String clientId, java.lang.String clientSecret, java.lang.String deviceId, java.lang.String deviceName) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxOAuthManager
refreshOAuth
in interface IBoxOAuthManager
refreshToken
- refresh token.clientId
- client id.clientSecret
- client secret.deviceId
- device id.deviceName
- device name.BoxRestException
- See BoxRestException
for more info.BoxServerException
- See com.box.restclientv2.exceptions.BoxServerException
for more info.AuthFatalFailureException
- See com.box.restclientv2.exceptions.AuthFatalFailureException
for more info.public BoxOAuthToken refreshOAuth(java.lang.String refreshToken, java.lang.String clientId, java.lang.String clientSecret) throws BoxRestException, BoxServerException, AuthFatalFailureException
IBoxOAuthManager
refreshOAuth
in interface IBoxOAuthManager
refreshToken
- refresh token.clientId
- client id.clientSecret
- client secret.BoxRestException
- See BoxRestException
for more info.BoxServerException
- See com.box.restclientv2.exceptions.BoxServerException
for more info.AuthFatalFailureException
- See com.box.restclientv2.exceptions.AuthFatalFailureException
for more info.public void revokeOAuth(java.lang.String accessToken, java.lang.String clientId, java.lang.String clientSecret) throws BoxServerException, BoxRestException, AuthFatalFailureException
IBoxOAuthManager
revokeOAuth
in interface IBoxOAuthManager
accessToken
- current access token (to be revoked).clientId
- client id.clientSecret
- client secret.BoxServerException
- See com.box.restclientv2.exceptions.BoxServerException
for more info.BoxRestException
- See BoxRestException
for more info.AuthFatalFailureException
- See com.box.restclientv2.exceptions.AuthFatalFailureException
for more info.public BoxOAuthToken refreshOAuth(BoxOAuthRequestObject requestObject) throws BoxRestException, BoxServerException, AuthFatalFailureException
public void revokeOAuth(BoxOAuthRequestObject requestObject) throws BoxServerException, BoxRestException, AuthFatalFailureException