Package com.zopim.android.sdk.store
Class MachineIdPrefsStorage
- java.lang.Object
-
- com.zopim.android.sdk.store.MachineIdPrefsStorage
-
- All Implemented Interfaces:
- BaseStorage, MachineIdStorage
public final class MachineIdPrefsStorage extends java.lang.Object implements MachineIdStorage
Storage for saving the machine id of a chat session.Machine id is defined during initialization and is used to reconnect to a chat if still active.
-
-
Field Summary
Fields Modifier and Type Field and Description protected booleanmDisabledprotected SharedPreferencesmStoragePreferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddelete()Deletes all storage information saved in this shared preferencevoiddisable()Disables the storagejava.lang.StringgetMachineId()Retrieves stored machine id from shared preferences.voidsetMachineId(java.lang.String machineId)Saves the provided machine id in shared preferences.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.zopim.android.sdk.store.BaseStorage
delete, disable
-
-
-
-
Method Detail
-
setMachineId
public void setMachineId(java.lang.String machineId)
Saves the provided machine id in shared preferences.If storage is disabled via
PrefsStorage.disable()this will do nothing.- Specified by:
setMachineIdin interfaceMachineIdStorage- Parameters:
machineId- to save- Throws:
java.lang.IllegalArgumentException- if machine id was null
-
getMachineId
public java.lang.String getMachineId()
Retrieves stored machine id from shared preferences.If storage is disabled via
PrefsStorage.disable()this will return null.- Specified by:
getMachineIdin interfaceMachineIdStorage- Returns:
- machine id of a saved chat session or null if there was none
-
delete
public void delete()
Deletes all storage information saved in this shared preference- Specified by:
deletein interfaceBaseStorage
-
disable
public void disable()
Description copied from interface:BaseStorageDisables the storage- Specified by:
disablein interfaceBaseStorage
-
-