Package org.apache.gravitino.client
Class GravitinoClientBase.Builder<T>
java.lang.Object
org.apache.gravitino.client.GravitinoClientBase.Builder<T>
- Direct Known Subclasses:
GravitinoAdminClient.AdminClientBuilder
,GravitinoClient.ClientBuilder
- Enclosing class:
- GravitinoClientBase
Builder class for constructing a GravitinoClient.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.gravitino.client.AuthDataProvider
The authentication provider.protected boolean
The check version flag.The request base header for the Gravitino API.A map of properties (key-value pairs) used to configure the Gravitino client.protected String
The base URI for the Gravitino API. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract T
build()
Builds a new instance.withClientConfig
(Map<String, String> properties) Set base client config for Gravitino Client.withCustomTokenAuth
(CustomTokenProvider dataProvider) Sets CustomTokenProvider for the Gravitino.withHeaders
(Map<String, String> headers) Set base header for Gravitino Client.withKerberosAuth
(KerberosTokenProvider dataProvider) Sets KerberosTokenProvider for the Gravitino.withOAuth
(OAuth2TokenProvider dataProvider) Sets OAuth2TokenProvider for Gravitino.Sets the simple mode authentication for GravitinowithSimpleAuth
(String userName) Sets the simple mode authentication for Gravitino with a specific usernameOptional, set a flag to verify the client is supported to connector the server
-
Field Details
-
uri
The base URI for the Gravitino API. -
authDataProvider
protected org.apache.gravitino.client.AuthDataProvider authDataProviderThe authentication provider. -
checkVersion
protected boolean checkVersionThe check version flag. -
headers
The request base header for the Gravitino API. -
properties
A map of properties (key-value pairs) used to configure the Gravitino client.
-
-
Constructor Details
-
Builder
The constructor for the Builder class.- Parameters:
uri
- The base URI for the Gravitino API.
-
-
Method Details
-
withSimpleAuth
Sets the simple mode authentication for Gravitino- Returns:
- This Builder instance for method chaining.
-
withSimpleAuth
Sets the simple mode authentication for Gravitino with a specific username- Parameters:
userName
- The username of the user.- Returns:
- This Builder instance for method chaining.
-
withVersionCheckDisabled
Optional, set a flag to verify the client is supported to connector the server- Returns:
- This Builder instance for method chaining.
-
withOAuth
Sets OAuth2TokenProvider for Gravitino.- Parameters:
dataProvider
- The OAuth2TokenProvider used as the provider of authentication data for Gravitino Client.- Returns:
- This Builder instance for method chaining.
-
withKerberosAuth
Sets KerberosTokenProvider for the Gravitino.- Parameters:
dataProvider
- The KerberosTokenProvider used as the provider of authentication data for Gravitino Client.- Returns:
- This Builder instance for method chaining.
-
withCustomTokenAuth
Sets CustomTokenProvider for the Gravitino.- Parameters:
dataProvider
- The CustomTokenProvider used as the provider of authentication data for Gravitino Client.- Returns:
- This Builder instance for method chaining.
-
withHeaders
Set base header for Gravitino Client.- Parameters:
headers
- the base header.- Returns:
- This Builder instance for method chaining.
-
withClientConfig
Set base client config for Gravitino Client.- Parameters:
properties
- A map of properties (key-value pairs) used to configure the Gravitino client.- Returns:
- This Builder instance for method chaining.
-
build
Builds a new instance. Subclasses should overwrite this method.- Returns:
- A new instance of Gravitino Client.
- Throws:
IllegalArgumentException
- If the base URI is null or empty.UnsupportedOperationException
- If subclass has not implemented.
-