public abstract class ServiceOptions<ServiceT,OptionsT> implements Serializable
Abstract class representing service options.
Type Parameters |
| Name |
Description |
ServiceT |
|
OptionsT |
|
Static Fields
CREDENTIAL_ENV_NAME
public static final String CREDENTIAL_ENV_NAME
| Field Value |
| Type |
Description |
String |
|
Static Methods
<T>getFromServiceLoader(Class<? extends T> clazz, T defaultInstance)
public static T <T>getFromServiceLoader(Class<? extends T> clazz, T defaultInstance)
| Parameters |
| Name |
Description |
clazz |
Class<? extends T>
|
defaultInstance |
T
|
| Returns |
| Type |
Description |
T |
|
<T>newInstance(String className)
public static T <T>newInstance(String className)
| Parameter |
| Name |
Description |
className |
String
|
| Returns |
| Type |
Description |
T |
|
getAppEngineAppId()
public static String getAppEngineAppId()
| Returns |
| Type |
Description |
String |
|
getAppEngineProjectId()
protected static String getAppEngineProjectId()
| Returns |
| Type |
Description |
String |
|
getAppEngineProjectIdFromAppId()
protected static String getAppEngineProjectIdFromAppId()
| Returns |
| Type |
Description |
String |
|
getDefaultProjectId()
public static String getDefaultProjectId()
Returns the default project ID, or null if no default project ID could be found. This
method returns the first available project ID among the following sources:
- The project ID specified by the GOOGLE_CLOUD_PROJECT environment variable
- The App Engine project ID
- The project ID specified in the JSON credentials file pointed by the
GOOGLE_APPLICATION_CREDENTIALS environment variable
- The Google Cloud SDK project ID
- The Compute Engine project ID
| Returns |
| Type |
Description |
String |
|
getDefaultRetrySettings()
public static RetrySettings getDefaultRetrySettings()
getGoogApiClientLibName()
public static String getGoogApiClientLibName()
Returns the library's name used by x-goog-api-client header as a string.
| Returns |
| Type |
Description |
String |
|
getGoogleCloudProjectId()
protected static String getGoogleCloudProjectId()
| Returns |
| Type |
Description |
String |
|
getLibraryName()
public static String getLibraryName()
Returns the library's name, gcloud-java, as a string.
| Returns |
| Type |
Description |
String |
|
getNoRetrySettings()
public static RetrySettings