Package com.zendesk.sdk.storage
Interface PushRegistrationResponseStorage
-
- All Superinterfaces:
- SdkStorage.UserStorage
- All Known Implementing Classes:
- StubPushRegistrationResponseStorage
public interface PushRegistrationResponseStorage extends SdkStorage.UserStorage
Defines the behaviour for storing, querying, and deleting aPushRegistrationResponseon the device. This was implemented to prevent unnecessary/redundant repeated calls to thePushRegistrationProviderwith the same identifier. It is used internally by the SDK and should not need to be touched by an integrator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description PushRegistrationResponsegetPushRegistrationResponse()Gets aPushRegistrationResponseornullfrom storage.booleanhasStoredPushRegistrationResponse()voidremovePushRegistrationResponse()Removes a storedPushRegistrationResponse, if any, from storage.voidstorePushRegistrationResponse(PushRegistrationResponse response)Puts aPushRegistrationResponseinto storage in serialized form.-
Methods inherited from interface com.zendesk.sdk.storage.SdkStorage.UserStorage
clearUserData, getCacheKey
-
-
-
-
Method Detail
-
storePushRegistrationResponse
void storePushRegistrationResponse(PushRegistrationResponse response)
Puts aPushRegistrationResponseinto storage in serialized form. This method is called automatically by any successful call tocom.zendesk.sdk.network.PushRegistrationProvider#registerDeviceWithIdentifier(String, Locale, ZendeskCallback)orcom.zendesk.sdk.network.PushRegistrationProvider#registerDeviceWithUAChannelId(String, Locale, ZendeskCallback). Only onePushRegistrationResponsecan be stored at a time. Each invocation of this method will overwrite any previously storedPushRegistrationResponse.- Parameters:
response- thePushRegistrationResponseto store.
-
getPushRegistrationResponse
PushRegistrationResponse getPushRegistrationResponse()
Gets aPushRegistrationResponseornullfrom storage. If aPushRegistrationResponsehas previously been stored withPushRegistrationResponseStorage.storePushRegistrationResponse(PushRegistrationResponse)and it has not been removed from storage, the stored object will be the return value. If noPushRegistrationResponsehas previously been stored, or storage has not been cleared by a 401 event or registration with a different identifier, this method will return null.- Returns:
- the stored
PushRegistrationResponse, ornullif there isn't one.
-
hasStoredPushRegistrationResponse
boolean hasStoredPushRegistrationResponse()
- Returns:
trueif there is aPushRegistrationResponsein storage,falseif not.
-
removePushRegistrationResponse
void removePushRegistrationResponse()
Removes a storedPushRegistrationResponse, if any, from storage. This is called in the event of a call tocom.zendesk.sdk.network.PushRegistrationProvider#registerDeviceWithIdentifier(String, Locale, ZendeskCallback)orcom.zendesk.sdk.network.PushRegistrationProvider#registerDeviceWithUAChannelId(String, Locale, ZendeskCallback)with anidentifierdifferent to the one in the storedPushRegistrationResponse. It is also called in any "clear all storage" event, such as a 401 response from Zendesk.
-
-