public class GoogleApiCredential extends Properties
Values are part of the binding thus available via injection like:
public class MyClass {
@Inject @Named("credential.default.clientId") String clientId;
...
}defaults| Constructor and Description |
|---|
GoogleApiCredential()
Creates default credential used to authenticate all calls unless specified another instance for a specific API.
|
GoogleApiCredential(Properties defaults)
Creates credential map used to authenticate API calls.
|
GoogleApiCredential(String prefix)
Creates specific credential used to authenticate calls to a specific API.
|
| Modifier and Type | Method and Description |
|---|---|
GoogleApiCredential |
setApiKey(String apiKey)
Sets the API Key to be used with any API that supports it.
|
GoogleApiCredential |
setApplicationName(String applicationName)
Sets the name of the client application.
|
GoogleApiCredential |
setClientId(String clientId)
Sets the Google API OAuth 2.0 Client ID Credential.
|
GoogleApiCredential |
setCredentialOn(boolean credentialOn)
Sets the boolean identification whether current environment should use these credential
in order to authenticate client calls or use cloud native environment for authentication.
|
GoogleApiCredential |
setEndpointUrl(String endpointUrl)
Sets the backend service API endpoint URL to be called.
|
GoogleApiCredential |
setFileName(String fileName)
Sets the path name to the private key file.
|
GoogleApiCredential |
setNumberOfRetries(int numberOfRetries)
Sets the number of retries that will be allowed to execute before the request will be
terminated or
0 to not retry requests. |
GoogleApiCredential |
setProjectId(String projectId)
Sets the Google Cloud Project ID also known as applicationId (AppId).
|
GoogleApiCredential |
setServiceAccountEmail(String serviceEmail)
Sets the service account ID (typically an e-mail address).
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNamespublic GoogleApiCredential()
public GoogleApiCredential(String prefix)
prefix - the prefix used to identify specific credentialpublic GoogleApiCredential(Properties defaults)
defaults - map of credentialpublic GoogleApiCredential setProjectId(String projectId)
projectId - the application IDpublic GoogleApiCredential setClientId(String clientId)
clientId - the Client IDpublic GoogleApiCredential setServiceAccountEmail(String serviceEmail)
serviceEmail - the service emailpublic GoogleApiCredential setApplicationName(String applicationName)
null or blank,
the application will use default name Constants.DEFAULT_APP_NAME.applicationName - the application name to be used as caller namepublic GoogleApiCredential setFileName(String fileName)
fileName - the relative path to filepublic GoogleApiCredential setApiKey(String apiKey)
apiKey - the API Key to be setpublic GoogleApiCredential setEndpointUrl(String endpointUrl)
endpointUrl - the endpoint URL to be setpublic GoogleApiCredential setCredentialOn(boolean credentialOn)
credentialOn - true use these credential in order to authenticate callspublic GoogleApiCredential setNumberOfRetries(int numberOfRetries)
0 to not retry requests.
The default value is 1.
numberOfRetries - the number of retriesHttpRequest.setNumberOfRetries(int)Copyright © 2016 Comvai - TurnOnline.biz. All rights reserved.