Class InMemoryPreKeyStore
- java.lang.Object
-
- org.signal.libsignal.protocol.state.impl.InMemoryPreKeyStore
-
- All Implemented Interfaces:
PreKeyStore
public class InMemoryPreKeyStore extends java.lang.Object implements PreKeyStore
-
-
Constructor Summary
Constructors Constructor Description InMemoryPreKeyStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsPreKey(int preKeyId)PreKeyRecordloadPreKey(int preKeyId)Load a local PreKeyRecord.voidremovePreKey(int preKeyId)Delete a PreKeyRecord from local storage.voidstorePreKey(int preKeyId, PreKeyRecord record)Store a local PreKeyRecord.
-
-
-
Method Detail
-
loadPreKey
public PreKeyRecord loadPreKey(int preKeyId) throws InvalidKeyIdException
Description copied from interface:PreKeyStoreLoad a local PreKeyRecord.- Specified by:
loadPreKeyin interfacePreKeyStore- Parameters:
preKeyId- the ID of the local PreKeyRecord.- Returns:
- the corresponding PreKeyRecord.
- Throws:
InvalidKeyIdException- when there is no corresponding PreKeyRecord.
-
storePreKey
public void storePreKey(int preKeyId, PreKeyRecord record)Description copied from interface:PreKeyStoreStore a local PreKeyRecord.- Specified by:
storePreKeyin interfacePreKeyStore- Parameters:
preKeyId- the ID of the PreKeyRecord to store.record- the PreKeyRecord.
-
containsPreKey
public boolean containsPreKey(int preKeyId)
- Specified by:
containsPreKeyin interfacePreKeyStore- Parameters:
preKeyId- A PreKeyRecord ID.- Returns:
- true if the store has a record for the preKeyId, otherwise false.
-
removePreKey
public void removePreKey(int preKeyId)
Description copied from interface:PreKeyStoreDelete a PreKeyRecord from local storage.- Specified by:
removePreKeyin interfacePreKeyStore- Parameters:
preKeyId- The ID of the PreKeyRecord to remove.
-
-