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 aPushRegistrationResponse
on the device. This was implemented to prevent unnecessary/redundant repeated calls to thePushRegistrationProvider
with 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 PushRegistrationResponse
getPushRegistrationResponse()
Gets aPushRegistrationResponse
ornull
from storage.boolean
hasStoredPushRegistrationResponse()
void
removePushRegistrationResponse()
Removes a storedPushRegistrationResponse
, if any, from storage.void
storePushRegistrationResponse(PushRegistrationResponse response)
Puts aPushRegistrationResponse
into storage in serialized form.-
Methods inherited from interface com.zendesk.sdk.storage.SdkStorage.UserStorage
clearUserData, getCacheKey
-
-
-
-
Method Detail
-
storePushRegistrationResponse
void storePushRegistrationResponse(PushRegistrationResponse response)
Puts aPushRegistrationResponse
into 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 onePushRegistrationResponse
can be stored at a time. Each invocation of this method will overwrite any previously storedPushRegistrationResponse
.- Parameters:
response
- thePushRegistrationResponse
to store.
-
getPushRegistrationResponse
PushRegistrationResponse getPushRegistrationResponse()
Gets aPushRegistrationResponse
ornull
from storage. If aPushRegistrationResponse
has previously been stored withPushRegistrationResponseStorage.storePushRegistrationResponse(PushRegistrationResponse)
and it has not been removed from storage, the stored object will be the return value. If noPushRegistrationResponse
has 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
, ornull
if there isn't one.
-
hasStoredPushRegistrationResponse
boolean hasStoredPushRegistrationResponse()
- Returns:
true
if there is aPushRegistrationResponse
in storage,false
if 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 anidentifier
different to the one in the storedPushRegistrationResponse
. It is also called in any "clear all storage" event, such as a 401 response from Zendesk.
-
-