Package org.apache.gravitino.credential
Class JdbcCredential
java.lang.Object
org.apache.gravitino.credential.JdbcCredential
- All Implemented Interfaces:
Credential
JDBC credential for accessing JDBC backend services.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe JDBC password.static final StringThe JDBC user name.static final StringJDBC credential type.Fields inherited from interface org.apache.gravitino.credential.Credential
CREDENTIAL_TYPE, EXPIRE_TIME_IN_MS -
Constructor Summary
ConstructorsConstructorDescriptionThis is the constructor that is used by credential factory to create an instance of credential according to the credential information.JdbcCredential(String jdbcUser, String jdbcPassword) Constructs an instance ofJdbcCredentialwith the JDBC user and password. -
Method Summary
Modifier and TypeMethodDescriptionReturns credential information.Returns the type of the credential.longReturns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.voidinitialize(Map<String, String> credentialInfo, long expireTimeInMs) Initialize the credential with the credential information.Get JDBC password.jdbcUser()Get JDBC user name.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.gravitino.credential.Credential
toProperties
-
Field Details
-
JDBC_CREDENTIAL_TYPE
JDBC credential type.- See Also:
-
GRAVITINO_JDBC_USER
The JDBC user name.- See Also:
-
GRAVITINO_JDBC_PASSWORD
The JDBC password.- See Also:
-
-
Constructor Details
-
JdbcCredential
Constructs an instance ofJdbcCredentialwith the JDBC user and password.- Parameters:
jdbcUser- The JDBC user name.jdbcPassword- The JDBC password.
-
JdbcCredential
public JdbcCredential()This is the constructor that is used by credential factory to create an instance of credential according to the credential information.
-
-
Method Details
-
credentialType
Description copied from interface:CredentialReturns the type of the credential. It should be the same as the credential type of the credential provider.- Specified by:
credentialTypein interfaceCredential- Returns:
- the credential type as a String.
-
expireTimeInMs
public long expireTimeInMs()Description copied from interface:CredentialReturns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.- Specified by:
expireTimeInMsin interfaceCredential- Returns:
- the expiration time as a long.
-
credentialInfo
Description copied from interface:CredentialReturns credential information.- Specified by:
credentialInfoin interfaceCredential- Returns:
- a map of credential information.
-
initialize
Description copied from interface:CredentialInitialize the credential with the credential information.This method is invoked to deserialize the credential in client side.
- Specified by:
initializein interfaceCredential- Parameters:
credentialInfo- The credential information fromCredential.credentialInfo().expireTimeInMs- The expire-time fromCredential.expireTimeInMs().
-
jdbcUser
Get JDBC user name.- Returns:
- The JDBC user name.
-
jdbcPassword
Get JDBC password.- Returns:
- The JDBC password.
-
toString
-