Package com.zendesk.sdk.storage
Interface IdentityStorage
-
- All Superinterfaces:
- SdkStorage.UserStorage
public interface IdentityStorage extends SdkStorage.UserStorage
Provides storage of an Access token
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description IdentityanonymiseIdentity()Anonymises the stored IdentityIdentitygetIdentity()Gets the stored identity.AccessTokengetStoredAccessToken()Gets a storedAccessTokenfrom the device.java.lang.StringgetStoredAccessTokenAsBearerToken()Gets the stored access token as a bearer value for an authorization header.java.lang.LonggetUserId()Gets a stored user ID from the device.java.lang.StringgetUUID()Gets the stored UUID of the current user or creates one if required.voidstoreAccessToken(AccessToken accessToken)Stores anAccessTokenon the devicevoidstoreIdentity(Identity identity)Stores an identity.voidstoreUserId(java.lang.Long userId)Stores a user ID for use in blips.-
Methods inherited from interface com.zendesk.sdk.storage.SdkStorage.UserStorage
clearUserData, getCacheKey
-
-
-
-
Method Detail
-
storeAccessToken
void storeAccessToken(AccessToken accessToken)
Stores anAccessTokenon the device- Parameters:
accessToken- The access token to store
-
getStoredAccessToken
AccessToken getStoredAccessToken()
Gets a storedAccessTokenfrom the device.- Returns:
- The stored
AccessTokenor null if one is not stored or if the storage is unavailable.
-
storeUserId
void storeUserId(java.lang.Long userId)
Stores a user ID for use in blips. The value should come fromAccessToken.getUserId(), parsed to aLongusingLong.parseLong(String).- Parameters:
userId- The user ID to store.
-
getUserId
java.lang.Long getUserId()
Gets a stored user ID from the device. This should be sent in every blip to identify the authenticated user.- Returns:
- the user ID
-
getStoredAccessTokenAsBearerToken
java.lang.String getStoredAccessTokenAsBearerToken()
Gets the stored access token as a bearer value for an authorization header.- Returns:
- A bearer token for use in an Authorization header or null. If the token is present this will be like "Bearer {token}". If the token is missing it will be null
-
getUUID
java.lang.String getUUID()
Gets the stored UUID of the current user or creates one if required.- Returns:
- the UUID of the current user
-
storeIdentity
void storeIdentity(Identity identity)
Stores an identity.- Parameters:
identity- The identity to store.
-
getIdentity
Identity getIdentity()
Gets the stored identity.- Returns:
- The stored identity if it is available or null if none was found.
-
anonymiseIdentity
Identity anonymiseIdentity()
Anonymises the stored IdentityThis method will anonymise a stored
AnonymousIdentityif one exists. It does not affect JWT identities.- Returns:
- The anonymised identity if one existed or null if it did not.
-
-