public class BoxDeveloperEditionAPIConnection extends BoxAPIConnection
This class handles everything for Box Developer Edition that isn't already handled by BoxAPIConnection.
BoxAPIConnection.ResourceLinkType
DEFAULT_BASE_AUTHORIZATION_URL, DEFAULT_HOSTNAME_VERIFIER, DEFAULT_MAX_RETRIES, DEFAULT_TRUST_MANAGER
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)
Constructs a new BoxDeveloperEditionAPIConnection.
|
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)
Creates a new Box Developer Edition connection with enterprise token.
|
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 |
getUserConnection(String userId,
BoxConfig boxConfig)
Creates a new Box Developer Edition connection with App User or Managed User token.
|
static BoxDeveloperEditionAPIConnection |
getUserConnection(String userId,
BoxConfig boxConfig,
IAccessTokenCache accessTokenCache)
Creates a new Box Developer Edition connection with App User or Managed User token leveraging BoxConfig
and access token cache.
|
static BoxDeveloperEditionAPIConnection |
getUserConnection(String userId,
String clientId,
String clientSecret,
JWTEncryptionPreferences encryptionPref,
IAccessTokenCache accessTokenCache)
Creates a new Box Developer Edition connection with App User or Managed User token.
|
void |
refresh()
Refresh's this connection's access token using Box Developer Edition.
|
addListener, asSelf, asUser, configureSslCertificatesValidation, createNewCall, createTokenRequest, determineResourceLinkType, enableNotifications, extractTokens, getAccessToken, getAuthorizationURL, getAuthorizationURL, getAutoRefresh, getBaseAppUrl, getBaseUploadURL, getBaseURL, getClientID, getClientSecret, getConnectTimeout, getExpires, getHostnameVerifier, getKeyValueOrDefault, getLastRefresh, getLowerScopedToken, getMaxRetryAttempts, getProxy, getProxyPassword, getProxyUsername, getReadTimeout, getRefreshLock, getRefreshToken, getRequestInterceptor, getRevokeURL, getTokenURL, getTrustManager, getUserAgent, modifyHttpClientBuilder, needsRefresh, notifyError, notifyRefresh, removeCustomHeader, removeListener, restore, restore, revokeToken, save, setAccessToken, setAutoRefresh, setBaseAppUrl, setBaseAuthorizationURL, setBaseUploadURL, setBaseURL, setConnectTimeout, setCustomHeader, setExpires, setLastRefresh, setMaxRetryAttempts, setProxy, setProxyAuthenticator, setProxyBasicAuthentication, setProxyPassword, setProxyUsername, setReadTimeout, setRefreshToken, setRequestInterceptor, setUserAgent, suppressNotifications
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, String clientID, String clientSecret, JWTEncryptionPreferences encryptionPref)
InMemoryLRUAccessTokenCache
with a size of 100 to prevent unneeded
requests to Box for access tokens.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, 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)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(String enterpriseId, String clientId, String clientSecret, JWTEncryptionPreferences encryptionPref)
InMemoryLRUAccessTokenCache
with a size of 100 to prevent unneeded
requests to Box for access tokens.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(BoxConfig boxConfig, IAccessTokenCache accessTokenCache)
boxConfig
- box configuration settings objectaccessTokenCache
- the cache for storing access token information (to minimize fetching new tokens)public static BoxDeveloperEditionAPIConnection getAppEnterpriseConnection(BoxConfig boxConfig)
InMemoryLRUAccessTokenCache
with a size of 100 to prevent unneeded
requests to Box for access tokens.boxConfig
- box configuration settings objectpublic static BoxDeveloperEditionAPIConnection getUserConnection(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 getUserConnection(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 static BoxDeveloperEditionAPIConnection getUserConnection(String userId, BoxConfig boxConfig)
InMemoryLRUAccessTokenCache
with a size of 100 to prevent unneeded
requests to Box for access tokens.userId
- the user ID to use for an App User.boxConfig
- box configuration settings objectpublic void authenticate(String authCode)
authenticate
in class BoxAPIConnection
authCode
- an auth code obtained from the first half of the OAuth process.public void authenticate()
public boolean canRefresh()
canRefresh
in class BoxAPIConnection
public void refresh()
refresh
in class BoxAPIConnection
IllegalStateException
- if this connection's access token cannot be refreshed.