public class BoxDeveloperEditionAPIConnection extends BoxAPIConnection
This class handles everything for Box Developer Edition that isn't already handled by BoxAPIConnection.
DEFAULT_MAX_ATTEMPTS| Constructor and Description |
|---|
BoxDeveloperEditionAPIConnection(String accessToken)
Disabling an invalid constructor for Box Developer Edition.
|
BoxDeveloperEditionAPIConnection(String entityId,
DeveloperEditionEntityType entityType,
String clientID,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Constructs a new BoxDeveloperEditionAPIConnection.
|
BoxDeveloperEditionAPIConnection(String clientID,
String clientSecret)
Disabling an invalid constructor for Box Developer Edition.
|
BoxDeveloperEditionAPIConnection(String clientID,
String clientSecret,
String authCode)
Disabling an invalid constructor for Box Developer Edition.
|
BoxDeveloperEditionAPIConnection(String clientID,
String clientSecret,
String accessToken,
String refreshToken)
Disabling an invalid constructor for Box Developer Edition.
|
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate()
Authenticates the API connection for Box Developer Edition.
|
void |
authenticate(String authCode)
Disabling the non-Box Developer Edition authenticate method.
|
boolean |
canRefresh()
BoxDeveloperEditionAPIConnection can always refresh, but this method is required elsewhere.
|
static BoxDeveloperEditionAPIConnection |
getAppEnterpriseConnection(String enterpriseId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Creates a new Box Developer Edition connection with enterprise token.
|
static BoxDeveloperEditionAPIConnection |
getAppUserConnection(String userId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Creates a new Box Developer Edition connection with App User token.
|
void |
refresh()
Refresh's this connection's access token using Box Developer Edition.
|
addListener, getAccessToken, getAutoRefresh, getBaseUploadURL, getBaseURL, getClientID, getClientSecret, getExpires, getLastRefresh, getMaxRequestAttempts, getProxy, getProxyPassword, getProxyUsername, getRefreshLock, getRefreshToken, getRequestInterceptor, getTokenURL, getUserAgent, needsRefresh, notifyError, notifyRefresh, removeListener, restore, restore, save, setAccessToken, setAutoRefresh, setBaseUploadURL, setBaseURL, setExpires, setLastRefresh, setMaxRequestAttempts, setProxy, setProxyPassword, setProxyUsername, setRefreshToken, setRequestInterceptor, setTokenURL, setUserAgentpublic BoxDeveloperEditionAPIConnection(String accessToken)
accessToken - an initial access token to use for authenticating with the API.public BoxDeveloperEditionAPIConnection(String clientID, String clientSecret, String accessToken, String refreshToken)
clientID - the client ID to use when refreshing the access token.clientSecret - the client secret to use when refreshing the access token.accessToken - an initial access token to use for authenticating with the API.refreshToken - an initial refresh token to use when refreshing the access token.public BoxDeveloperEditionAPIConnection(String clientID, String clientSecret, String authCode)
clientID - the client ID to use when exchanging the auth code for an access token.clientSecret - the client secret to use when exchanging the auth code for an access token.authCode - an auth code obtained from the first half of the OAuth process.public BoxDeveloperEditionAPIConnection(String clientID, String clientSecret)
clientID - the client ID to use when requesting an access token.clientSecret - the client secret to use when requesting an access token.public BoxDeveloperEditionAPIConnection(String entityId, DeveloperEditionEntityType entityType, String clientID, String clientSecret, JWTEncryptionPreferences encryptionPref)
entityId - enterprise ID or a user ID.entityType - the type of entityId.clientID - the client ID to use when exchanging the JWT assertion for an access token.clientSecret - the client secret to use when exchanging the JWT assertion for an access token.encryptionPref - the encryption preferences for signing the JWT.public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(String enterpriseId, String clientId, String clientSecret, JWTEncryptionPreferences encryptionPref)
enterpriseId - the enterprise ID to use for requesting access token.clientId - the client ID to use when exchanging the JWT assertion for an access token.clientSecret - the client secret to use when exchanging the JWT assertion for an access token.encryptionPref - the encryption preferences for signing the JWT.public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, String clientId, String clientSecret, JWTEncryptionPreferences encryptionPref)
userId - the user ID to use for an App User.clientId - the client ID to use when exchanging the JWT assertion for an access token.clientSecret - the client secret to use when exchanging the JWT assertion for an access token.encryptionPref - the encryption preferences for signing the JWT.public void authenticate(String authCode)
authenticate in class BoxAPIConnectionauthCode - an auth code obtained from the first half of the OAuth process.public void authenticate()
public boolean canRefresh()
canRefresh in class BoxAPIConnectionpublic void refresh()
refresh in class BoxAPIConnectionIllegalStateException - if this connection's access token cannot be refreshed.