Class OneDriveConnectionBuilder
java.lang.Object
com.amilesend.onedrive.connection.OneDriveConnectionBuilder
Builder to configure and return a new
OneDriveConnection instance.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionauthManager(OneDriveAuthManager authManager) TheOneDriveAuthManagerused to manage authentication and access tokens.build(OneDriveAuthInfo authInfo) Builds a newOneDriveConnectioninstance with the givenauthInfo.Builds a newOneDriveConnectioninstance with the givenauthCode.The application client identifier.clientSecret(String clientSecret) The application client secret.httpClient(okhttp3.OkHttpClient httpClient) The underlying http client.static OneDriveConnectionBuilderCreates a newOneDriveConnectionBuilderinstance.redirectUrl(String redirectUrl) The OAuth redirect URL.retryStrategy(com.amilesend.client.connection.retry.RetryStrategy retryStrategy) TheRetryStrategyused for the underyling client connection.threadPool(ExecutorService threadPool) The executor service to manage async operations for the client.Sets the user-agent string that is included in requests.
-
Field Details
-
DEFAULT_NUM_THREADS
public static final int DEFAULT_NUM_THREADS
-
-
Method Details
-
newInstance
Creates a newOneDriveConnectionBuilderinstance.- Returns:
- the builder
-
userAgent
Sets the user-agent string that is included in requests.- Parameters:
userAgent- the user agent- Returns:
- this builder
-
httpClient
The underlying http client. This is optional.- Parameters:
httpClient- the http client- Returns:
- this builder
-
clientId
The application client identifier. This is required.- Parameters:
clientId- the application client identifier- Returns:
- this builder
-
clientSecret
The application client secret. This is required.- Parameters:
clientSecret- the application client secret- Returns:
- this builder
-
redirectUrl
The OAuth redirect URL. This is required.- Parameters:
redirectUrl- the OAuth redirectUrl- Returns:
- this builder
-
authManager
TheOneDriveAuthManagerused to manage authentication and access tokens.- Parameters:
authManager- the auth manager- Returns:
- this builder
-
retryStrategy
public OneDriveConnectionBuilder retryStrategy(com.amilesend.client.connection.retry.RetryStrategy retryStrategy) TheRetryStrategyused for the underyling client connection.- Parameters:
retryStrategy- the retry strategy- Returns:
- this builder
- See Also:
-
threadPool
The executor service to manage async operations for the client.- Parameters:
threadPool- the thread pool- Returns:
- this builder
-
build
Builds a newOneDriveConnectioninstance with the givenauthCode.- Parameters:
authCode- the authorization code obtained from the OAuth handshake.- Returns:
- the connection
-
build
Builds a newOneDriveConnectioninstance with the givenauthInfo.- Parameters:
authInfo- the authorization information that contains the refresh token- Returns:
- the connection
-