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 boolean
mDisabled
protected SharedPreferences
mStoragePreferences
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
delete()
Deletes all storage information saved in this shared preferencevoid
disable()
Disables the storagejava.lang.String
getMachineId()
Retrieves stored machine id from shared preferences.void
setMachineId(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:
setMachineId
in 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:
getMachineId
in 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:
delete
in interfaceBaseStorage
-
disable
public void disable()
Description copied from interface:BaseStorage
Disables the storage- Specified by:
disable
in interfaceBaseStorage
-
-