public abstract static class GravitinoClientBase.Builder<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.gravitino.client.AuthDataProvider |
authDataProvider
The authentication provider.
|
protected boolean |
checkVersion
The check version flag.
|
protected java.util.Map<java.lang.String,java.lang.String> |
headers
The request base header for the Gravitino API.
|
protected java.lang.String |
uri
The base URI for the Gravitino API.
|
Modifier | Constructor and Description |
---|---|
protected |
Builder(java.lang.String uri)
The constructor for the Builder class.
|
Modifier and Type | Method and Description |
---|---|
abstract T |
build()
Builds a new instance.
|
GravitinoClientBase.Builder<T> |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set base header for Gravitino Client.
|
GravitinoClientBase.Builder<T> |
withKerberosAuth(KerberosTokenProvider dataProvider)
Sets KerberosTokenProvider for the Gravitino.
|
GravitinoClientBase.Builder<T> |
withOAuth(OAuth2TokenProvider dataProvider)
Sets OAuth2TokenProvider for Gravitino.
|
GravitinoClientBase.Builder<T> |
withSimpleAuth()
Sets the simple mode authentication for Gravitino
|
GravitinoClientBase.Builder<T> |
withSimpleAuth(java.lang.String userName)
Sets the simple mode authentication for Gravitino with a specific username
|
GravitinoClientBase.Builder<T> |
withVersionCheckDisabled()
Optional, set a flag to verify the client is supported to connector the server
|
protected java.lang.String uri
protected org.apache.gravitino.client.AuthDataProvider authDataProvider
protected boolean checkVersion
protected java.util.Map<java.lang.String,java.lang.String> headers
protected Builder(java.lang.String uri)
uri
- The base URI for the Gravitino API.public GravitinoClientBase.Builder<T> withSimpleAuth()
public GravitinoClientBase.Builder<T> withSimpleAuth(java.lang.String userName)
userName
- The username of the user.public GravitinoClientBase.Builder<T> withVersionCheckDisabled()
public GravitinoClientBase.Builder<T> withOAuth(OAuth2TokenProvider dataProvider)
dataProvider
- The OAuth2TokenProvider used as the provider of authentication data for
Gravitino Client.public GravitinoClientBase.Builder<T> withKerberosAuth(KerberosTokenProvider dataProvider)
dataProvider
- The KerberosTokenProvider used as the provider of authentication data for
Gravitino Client.public GravitinoClientBase.Builder<T> withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers
- the base header.public abstract T build()
java.lang.IllegalArgumentException
- If the base URI is null or empty.java.lang.UnsupportedOperationException
- If subclass has not implemented.