Class StoredCredential
java.lang.Object
com.google.api.client.auth.oauth2.StoredCredential
- All Implemented Interfaces:
Serializable
Beta
Credential information to be stored in a
DataStoreFactory
.
Implementation is thread safe.
- Since:
- 1.16
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Access token ornull
for none.static final String
Default data store ID.private Long
Expected expiration time in milliseconds ornull
for none.private final Lock
Lock on access to the store.private String
Refresh token ornull
for none.private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the access token ornull
for none.static com.google.api.client.util.store.DataStore
<StoredCredential> getDefaultDataStore
(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) Returns the stored credential data store using the IDDEFAULT_DATA_STORE_ID
.Returns the expected expiration time in milliseconds ornull
for none.Returns the refresh token ornull
for none.int
hashCode()
setAccessToken
(String accessToken) Sets the access token ornull
for none.setExpirationTimeMilliseconds
(Long expirationTimeMilliseconds) Sets the expected expiration time in milliseconds ornull
for none.setRefreshToken
(String refreshToken) Sets the refresh token ornull
for none.toString()
-
Field Details
-
DEFAULT_DATA_STORE_ID
Default data store ID. -
serialVersionUID
private static final long serialVersionUID- See Also:
-
lock
Lock on access to the store. -
accessToken
Access token ornull
for none. -
expirationTimeMilliseconds
Expected expiration time in milliseconds ornull
for none. -
refreshToken
Refresh token ornull
for none.
-
-
Constructor Details
-
StoredCredential
public StoredCredential() -
StoredCredential
- Parameters:
credential
- existing credential to copy from
-
-
Method Details
-
getAccessToken
Returns the access token ornull
for none. -
setAccessToken
Sets the access token ornull
for none. -
getExpirationTimeMilliseconds
Returns the expected expiration time in milliseconds ornull
for none. -
setExpirationTimeMilliseconds
Sets the expected expiration time in milliseconds ornull
for none. -
getRefreshToken
Returns the refresh token ornull
for none. -
setRefreshToken
Sets the refresh token ornull
for none. -
toString
-
equals
-
hashCode
public int hashCode() -
getDefaultDataStore
public static com.google.api.client.util.store.DataStore<StoredCredential> getDefaultDataStore(com.google.api.client.util.store.DataStoreFactory dataStoreFactory) throws IOException Returns the stored credential data store using the IDDEFAULT_DATA_STORE_ID
.- Parameters:
dataStoreFactory
- data store factory- Returns:
- stored credential data store
- Throws:
IOException
-