|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.auth.oauth2.Credential.Builder
com.google.api.client.googleapis.auth.oauth2.GoogleCredential.Builder
public static class GoogleCredential.Builder
Google credential builder.
Implementation is not thread-safe.
| Constructor Summary | |
|---|---|
GoogleCredential.Builder()
|
|
| Method Summary | |
|---|---|
GoogleCredential.Builder |
addRefreshListener(CredentialRefreshListener refreshListener)
|
GoogleCredential |
build()
|
String |
getServiceAccountId()
Returns the service account ID (typically an e-mail address) or null for none. |
PrivateKey |
getServiceAccountPrivateKey()
Returns the private key to use with the the service account flow or null for none. |
String |
getServiceAccountScopes()
Returns the space-separated OAuth scopes to use with the the service account flow or null for none. |
String |
getServiceAccountUser()
Returns the email address of the user the application is trying to impersonate in the service account flow or null for none. |
GoogleCredential.Builder |
setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
|
GoogleCredential.Builder |
setClientSecrets(GoogleClientSecrets clientSecrets)
Sets the client secrets. |
GoogleCredential.Builder |
setClientSecrets(String clientId,
String clientSecret)
Sets the client identifier and secret. |
GoogleCredential.Builder |
setClock(Clock clock)
|
GoogleCredential.Builder |
setJsonFactory(JsonFactory jsonFactory)
|
GoogleCredential.Builder |
setRefreshListeners(List<CredentialRefreshListener> refreshListeners)
|
GoogleCredential.Builder |
setRequestInitializer(HttpRequestInitializer requestInitializer)
|
GoogleCredential.Builder |
setServiceAccountId(String serviceAccountId)
Sets the service account ID (typically an e-mail address) or null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKey(PrivateKey serviceAccountPrivateKey)
Sets the private key to use with the the service account flow or null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyFromP12File(File p12File)
Sets the private key to use with the the service account flow or null for none. |
GoogleCredential.Builder |
setServiceAccountScopes(Iterable<String> serviceAccountScopes)
Sets the space-separated OAuth scopes to use with the the service account flow or null for none. |
GoogleCredential.Builder |
setServiceAccountScopes(String... serviceAccountScopes)
Sets the space-separated OAuth scopes to use with the the service account flow or null for none. |
GoogleCredential.Builder |
setServiceAccountUser(String serviceAccountUser)
Sets the email address of the user the application is trying to impersonate in the service account flow or null for none. |
GoogleCredential.Builder |
setTokenServerEncodedUrl(String tokenServerEncodedUrl)
|
GoogleCredential.Builder |
setTokenServerUrl(GenericUrl tokenServerUrl)
|
GoogleCredential.Builder |
setTransport(HttpTransport transport)
|
| Methods inherited from class com.google.api.client.auth.oauth2.Credential.Builder |
|---|
getClientAuthentication, getClock, getJsonFactory, getMethod, getRefreshListeners, getRequestInitializer, getTokenServerUrl, getTransport |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GoogleCredential.Builder()
| Method Detail |
|---|
public GoogleCredential build()
build in class Credential.Builderpublic GoogleCredential.Builder setTransport(HttpTransport transport)
setTransport in class Credential.Builderpublic GoogleCredential.Builder setJsonFactory(JsonFactory jsonFactory)
setJsonFactory in class Credential.Builderpublic GoogleCredential.Builder setClock(Clock clock)
setClock in class Credential.Builder
public GoogleCredential.Builder setClientSecrets(String clientId,
String clientSecret)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setClientSecrets(GoogleClientSecrets clientSecrets)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getServiceAccountId()
null for none.
public GoogleCredential.Builder setServiceAccountId(String serviceAccountId)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getServiceAccountScopes()
null for none.
public GoogleCredential.Builder setServiceAccountScopes(String... serviceAccountScopes)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
serviceAccountScopes - list of scopes to be joined by a space separator (or a single
value containing multiple space-separated scopes)public GoogleCredential.Builder setServiceAccountScopes(Iterable<String> serviceAccountScopes)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
serviceAccountScopes - list of scopes to be joined by a space separator (or a single
value containing multiple space-separated scopes)public final PrivateKey getServiceAccountPrivateKey()
null for none.
public GoogleCredential.Builder setServiceAccountPrivateKey(PrivateKey serviceAccountPrivateKey)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setServiceAccountPrivateKeyFromP12File(File p12File)
throws GeneralSecurityException,
IOException
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
p12File - input stream to the p12 file (closed at the end of this method in a finally
block)
GeneralSecurityException
IOExceptionpublic final String getServiceAccountUser()
null for none.
public GoogleCredential.Builder setServiceAccountUser(String serviceAccountUser)
null for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
setRequestInitializer in class Credential.Builderpublic GoogleCredential.Builder addRefreshListener(CredentialRefreshListener refreshListener)
addRefreshListener in class Credential.Builderpublic GoogleCredential.Builder setRefreshListeners(List<CredentialRefreshListener> refreshListeners)
setRefreshListeners in class Credential.Builderpublic GoogleCredential.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
setTokenServerUrl in class Credential.Builderpublic GoogleCredential.Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl)
setTokenServerEncodedUrl in class Credential.Builderpublic GoogleCredential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
setClientAuthentication in class Credential.Builder
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||