public void setConfiguration ( Entries entries ) { for ( String prefix : prefixes ) { Optional < Boolean > enableServiceAccounts = maybeGetBoolean ( entries , prefix + ENABLE_SERVICE_ACCOUNTS_SUFFIX ) ; if ( enableServiceAccounts . isPresent ( ) ) { setEnableServiceAccounts ( enableServiceAccounts . get ( ) ) ; } String serviceEmailAccount = entries . getPassword ( prefix + SERVICE_ACCOUNT_EMAIL_SUFFIX ) ; if ( serviceEmailAccount != null ) { setServiceAccountEmail ( serviceEmailAccount ) ; } // Parameters for ServiceAccount directly in Configuration String serviceAccountPrivateKeyId = entries . getPassword ( prefix + SERVICE_ACCOUNT_PRIVATE_KEY_ID_SUFFIX ) ; if ( serviceAccountPrivateKeyId != null ) { setServiceAccountPrivateKeyId ( serviceAccountPrivateKeyId ) ; } String serviceAccountPrivateKey = entries . getPassword ( prefix + SERVICE_ACCOUNT_PRIVATE_KEY_SUFFIX ) ; if ( serviceAccountPrivateKey != null ) { setServiceAccountPrivateKey ( serviceAccountPrivateKey ) ; } // Parameters for file based credentials String serviceAccountKeyFile = entries . get ( prefix + SERVICE_ACCOUNT_KEYFILE_SUFFIX ) ; if ( serviceAccountKeyFile != null ) { setServiceAccountKeyFile ( serviceAccountKeyFile ) ; } String serviceAccountJsonKeyFile = entries . get ( prefix + JSON_KEYFILE_SUFFIX ) ; if ( serviceAccountJsonKeyFile != null ) { setServiceAccountJsonKeyFile ( serviceAccountJsonKeyFile ) ; } String clientId = entries . get ( prefix + CLIENT_ID_SUFFIX ) ; if ( clientId != null ) { setClientId ( clientId ) ; } String clientSecret = entries . get ( prefix + CLIENT_SECRET_SUFFIX ) ; if ( clientSecret != null ) { setClientSecret ( clientSecret ) ; } String oAuthCredentialPath = entries . get ( prefix + OAUTH_CLIENT_FILE_SUFFIX ) ; if ( oAuthCredentialPath != null ) { setOAuthCredentialFile ( oAuthCredentialPath ) ; } Optional < Boolean > enableNullCredential = maybeGetBoolean ( entries , prefix + ENABLE_NULL_CREDENTIAL_SUFFIX ) ; if ( enableNullCredential . isPresent ( ) ) { setNullCredentialEnabled ( enableNullCredential . get ( ) ) ; } } // Transport configuration does not use prefixes String proxyAddress = entries . get ( PROXY_ADDRESS_KEY ) ; if ( proxyAddress != null ) { setProxyAddress ( proxyAddress ) ; } String proxyUsername = entries . getPassword ( PROXY_USERNAME_KEY ) ; if ( proxyUsername != null ) { setProxyUsername ( proxyUsername ) ; } String proxyPassword = entries . getPassword ( PROXY_PASSWORD_KEY ) ; if ( proxyPassword != null ) { setProxyPassword ( proxyPassword ) ; } String transportType = entries . get ( HTTP_TRANSPORT_KEY ) ; if ( transportType != null ) { setTransportType ( HttpTransportType . valueOf ( transportType ) ) ; } }
Load configuration values from the provided configuration source . For any key that does not have a corresponding value in the configuration no changes will be made to the state of this object .