Package org.apache.hadoop.hbase
Class TestHBaseConfiguration.ReflectiveCredentialProviderClient
java.lang.Object
org.apache.hadoop.hbase.TestHBaseConfiguration.ReflectiveCredentialProviderClient
- Enclosing class:
- TestHBaseConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Methodstatic final Stringprivate static Methodprivate static Methodprivate static Methodprivate static Methodstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate static Booleanprivate static Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateEntry(org.apache.hadoop.conf.Configuration conf, String name, char[] credential) Create a CredentialEntry using the configured Providers.private voidcreateEntryInProvider(Object credentialProvider, String name, char[] credential) Create a CredentialEntry with the give name and credential in the credentialProvider.getCredentialProviders(org.apache.hadoop.conf.Configuration conf) Wrapper to fetch the configuredList<CredentialProvider>s.private booleanDetermine if we can load the necessary CredentialProvider classes.private MethodloadMethod(Class<?> clz, String name, Class<?>... classes)
-
Field Details
-
HADOOP_CRED_PROVIDER_FACTORY_CLASS_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_FACTORY_GET_PROVIDERS_METHOD_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_CLASS_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_GET_CREDENTIAL_ENTRY_METHOD_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_GET_ALIASES_METHOD_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_CREATE_CREDENTIAL_ENTRY_METHOD_NAME
- See Also:
-
HADOOP_CRED_PROVIDER_FLUSH_METHOD_NAME
- See Also:
-
HADOOP_CRED_ENTRY_CLASS_NAME
- See Also:
-
HADOOP_CRED_ENTRY_GET_CREDENTIAL_METHOD_NAME
- See Also:
-
CREDENTIAL_PROVIDER_PATH
- See Also:
-
hadoopCredProviderFactory
-
getProvidersMethod
-
getCredentialEntryMethod
-
getCredentialMethod
-
createCredentialEntryMethod
-
flushMethod
-
hadoopClassesAvailable
-
-
Constructor Details
-
ReflectiveCredentialProviderClient
private ReflectiveCredentialProviderClient()
-
-
Method Details
-
isHadoopCredentialProviderAvailable
Determine if we can load the necessary CredentialProvider classes. Only loaded the first time, so subsequent invocations of this method should return fast.- Returns:
- True if the CredentialProvider classes/methods are available, false otherwise.
-
loadMethod
- Throws:
Exception
-
getCredentialProviders
Wrapper to fetch the configuredList<CredentialProvider>s. Configuration with GENERAL_SECURITY_CREDENTIAL_PROVIDER_PATHS defined- Returns:
- List of CredentialProviders, or null if they could not be loaded
-
createEntry
public void createEntry(org.apache.hadoop.conf.Configuration conf, String name, char[] credential) throws Exception Create a CredentialEntry using the configured Providers. If multiple CredentialProviders are configured, the first will be used. Configuration for the CredentialProvider CredentialEntry name (alias) The credential- Throws:
Exception
-
createEntryInProvider
private void createEntryInProvider(Object credentialProvider, String name, char[] credential) throws Exception Create a CredentialEntry with the give name and credential in the credentialProvider. The credentialProvider argument must be an instance of Hadoop CredentialProvider. Instance of CredentialProvider CredentialEntry name (alias) The credential to store- Throws:
Exception
-