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 entityId,
DeveloperEditionEntityType entityType,
BoxConfig boxConfig,
IAccessTokenCache accessTokenCache)
Constructs a new BoxDeveloperEditionAPIConnection.
|
BoxDeveloperEditionAPIConnection(String entityId,
DeveloperEditionEntityType entityType,
String clientID,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Deprecated.
Use the version of this constructor that accepts an IAccessTokenCache to prevent unneeded
requests to Box for access tokens.
|
BoxDeveloperEditionAPIConnection(String entityId,
DeveloperEditionEntityType entityType,
String clientID,
String clientSecret,
JWTEncryptionPreferences encryptionPref,
IAccessTokenCache accessTokenCache)
Constructs a new BoxDeveloperEditionAPIConnection leveraging an access token cache.
|
| 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(BoxConfig boxConfig)
Creates a new Box Developer Edition connection with enterprise token leveraging BoxConfig.
|
static BoxDeveloperEditionAPIConnection |
getAppEnterpriseConnection(BoxConfig boxConfig,
IAccessTokenCache accessTokenCache)
Creates a new Box Developer Edition connection with enterprise token leveraging BoxConfig and access token cache.
|
static BoxDeveloperEditionAPIConnection |
getAppEnterpriseConnection(String enterpriseId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Deprecated.
Use the version of this method that accepts an IAccessTokenCache to prevent unneeded
requests to Box for access tokens.
|
static BoxDeveloperEditionAPIConnection |
getAppEnterpriseConnection(String enterpriseId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref,
IAccessTokenCache accessTokenCache)
Creates a new Box Developer Edition connection with enterprise token leveraging an access token cache.
|
static BoxDeveloperEditionAPIConnection |
getAppUserConnection(String userId,
BoxConfig boxConfig)
Creates a new Box Developer Edition connection with App User token levaraging BoxConfig.
|
static BoxDeveloperEditionAPIConnection |
getAppUserConnection(String userId,
BoxConfig boxConfig,
IAccessTokenCache accessTokenCache)
Creates a new Box Developer Edition connection with App User token leveraging BoxConfig and access token cache.
|
static BoxDeveloperEditionAPIConnection |
getAppUserConnection(String userId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref)
Deprecated.
Use the version of this method that accepts an IAccessTokenCache to prevent unneeded
requests to Box for access tokens.
|
static BoxDeveloperEditionAPIConnection |
getAppUserConnection(String userId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref,
IAccessTokenCache accessTokenCache)
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, getAuthorizationURL, getAutoRefresh, getBaseUploadURL, getBaseURL, getClientID, getClientSecret, getExpires, getLastRefresh, getLowerScopedToken, getMaxRequestAttempts, getProxy, getProxyPassword, getProxyUsername, getRefreshLock, getRefreshToken, getRequestInterceptor, getRevokeURL, getTokenURL, getUserAgent, needsRefresh, notifyError, notifyRefresh, removeListener, restore, restore, revokeToken, save, setAccessToken, setAutoRefresh, setBaseUploadURL, setBaseURL, setExpires, setLastRefresh, setMaxRequestAttempts, setProxy, setProxyPassword, setProxyUsername, setRefreshToken, setRequestInterceptor, setRevokeURL, setTokenURL, setUserAgent@Deprecated 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 BoxDeveloperEditionAPIConnection(String entityId, DeveloperEditionEntityType entityType, String clientID, String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache)
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.accessTokenCache - the cache for storing access token information (to minimize fetching new tokens)public BoxDeveloperEditionAPIConnection(String entityId, DeveloperEditionEntityType entityType, BoxConfig boxConfig, IAccessTokenCache accessTokenCache)
entityId - enterprise ID or a user ID.entityType - the type of entityId.boxConfig - box configuration settings objectaccessTokenCache - the cache for storing access token information (to minimize fetching new tokens)@Deprecated 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 getAppEnterpriseConnection(String enterpriseId, String clientId, String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache)
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.accessTokenCache - the cache for storing access token information (to minimize fetching new tokens)public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(BoxConfig boxConfig)
boxConfig - box configuration settings objectpublic static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(BoxConfig boxConfig, IAccessTokenCache accessTokenCache)
boxConfig - box configuration settings objectaccessTokenCache - the cache for storing access token information (to minimize fetching new tokens)@Deprecated 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 static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, String clientId, String clientSecret, JWTEncryptionPreferences encryptionPref, IAccessTokenCache accessTokenCache)
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.accessTokenCache - the cache for storing access token information (to minimize fetching new tokens)public static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig)
userId - the user ID to use for an App User.boxConfig - box configuration settings objectpublic static BoxDeveloperEditionAPIConnection getAppUserConnection(String userId, BoxConfig boxConfig, IAccessTokenCache accessTokenCache)
userId - the user ID to use for an App User.boxConfig - box configuration settings objectaccessTokenCache - the cache for storing access token information (to minimize fetching new tokens)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.