public final class BoxCCGAPIConnection extends BoxAPIConnection
BoxAPIConnection.ResourceLinkType
DEFAULT_BASE_AUTHORIZATION_URL, DEFAULT_HOSTNAME_VERIFIER, DEFAULT_MAX_RETRIES, DEFAULT_TRUST_MANAGER
Modifier and Type | Method and Description |
---|---|
static BoxCCGAPIConnection |
applicationServiceAccountConnection(String clientId,
String clientSecret,
String enterpriseId)
Creates connection that authenticates as a Service Account
|
boolean |
canRefresh()
Determines if this connection's access token can be refreshed.
|
protected BoxAPIRequest |
createTokenRequest(URL url) |
protected void |
extractTokens(JsonObject jsonObject) |
boolean |
isUserConnection() |
void |
restore(String state)
Restores a saved connection state into this BoxAPIConnection.
|
static BoxCCGAPIConnection |
restore(String clientID,
String clientSecret,
String state)
Restores a BoxAPIConnection from a saved state.
|
String |
save()
Saves the state of this connection to a string so that it can be persisted and restored at a later time.
|
static BoxCCGAPIConnection |
userConnection(String clientId,
String clientSecret,
String userId)
Creates connection that authenticates as a User
|
addListener, asSelf, asUser, authenticate, configureSslCertificatesValidation, createNewCall, determineResourceLinkType, enableNotifications, 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, refresh, removeCustomHeader, removeListener, revokeToken, setAccessToken, setAutoRefresh, setBaseAppUrl, setBaseAuthorizationURL, setBaseUploadURL, setBaseURL, setConnectTimeout, setCustomHeader, setExpires, setLastRefresh, setMaxRetryAttempts, setProxy, setProxyAuthenticator, setProxyBasicAuthentication, setProxyPassword, setProxyUsername, setReadTimeout, setRefreshToken, setRequestInterceptor, setUserAgent, suppressNotifications
public static BoxCCGAPIConnection applicationServiceAccountConnection(String clientId, String clientSecret, String enterpriseId)
clientId
- the client ID to use when getting the access token.clientSecret
- the client secret to use when getting the access token.enterpriseId
- the enterprise ID to use when getting the access token.public static BoxCCGAPIConnection userConnection(String clientId, String clientSecret, String userId)
clientId
- the client ID to use when getting the access token.clientSecret
- the client secret to use when getting the access token.userId
- the user ID to use when getting the access token.public static BoxCCGAPIConnection restore(String clientID, String clientSecret, String state)
protected BoxAPIRequest createTokenRequest(URL url)
createTokenRequest
in class BoxAPIConnection
protected void extractTokens(JsonObject jsonObject)
extractTokens
in class BoxAPIConnection
public boolean canRefresh()
BoxAPIConnection
canRefresh
in class BoxAPIConnection
public boolean isUserConnection()
public String save()
BoxAPIConnection
Note that proxy settings aren't automatically saved or restored. This is mainly due to security concerns around persisting proxy authentication details to the state string. If your connection uses a proxy, you will have to manually configure it again after restoring the connection.
save
in class BoxAPIConnection
BoxAPIConnection.restore(java.lang.String, java.lang.String, java.lang.String)
public void restore(String state)
BoxAPIConnection
restore
in class BoxAPIConnection
state
- the saved state that was created with BoxAPIConnection.save()
.BoxAPIConnection.save()