public class InMemorySessionStore extends java.lang.Object implements SessionStore
| Constructor and Description |
|---|
InMemorySessionStore() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsSession(SignalProtocolAddress address)
Determine whether there is a committed
SessionRecord for a recipientId + deviceId tuple. |
void |
deleteAllSessions(java.lang.String name)
Remove the
SessionRecords corresponding to all devices of a recipientId. |
void |
deleteSession(SignalProtocolAddress address)
Remove a
SessionRecord for a recipientId + deviceId tuple. |
java.util.List<java.lang.Integer> |
getSubDeviceSessions(java.lang.String name)
Returns all known devices with active sessions for a recipient
|
SessionRecord |
loadSession(SignalProtocolAddress remoteAddress)
Returns a copy of the
SessionRecord corresponding to the recipientId + deviceId tuple,
or a new SessionRecord if one does not currently exist. |
void |
storeSession(SignalProtocolAddress address,
SessionRecord record)
Commit to storage the
SessionRecord for a given recipientId + deviceId tuple. |
public SessionRecord loadSession(SignalProtocolAddress remoteAddress)
SessionStoreSessionRecord corresponding to the recipientId + deviceId tuple,
or a new SessionRecord if one does not currently exist.
It is important that implementations return a copy of the current durable information. The returned SessionRecord may be modified, but those changes should not have an effect on the durable session state (what is returned by subsequent calls to this method) without the store method being called here first.
loadSession in interface SessionStoreremoteAddress - The name and device ID of the remote client.public java.util.List<java.lang.Integer> getSubDeviceSessions(java.lang.String name)
SessionStoregetSubDeviceSessions in interface SessionStorename - the name of the client.public void storeSession(SignalProtocolAddress address, SessionRecord record)
SessionStoreSessionRecord for a given recipientId + deviceId tuple.storeSession in interface SessionStoreaddress - the address of the remote client.record - the current SessionRecord for the remote client.public boolean containsSession(SignalProtocolAddress address)
SessionStoreSessionRecord for a recipientId + deviceId tuple.containsSession in interface SessionStoreaddress - the address of the remote client.SessionRecord exists, false otherwise.public void deleteSession(SignalProtocolAddress address)
SessionStoreSessionRecord for a recipientId + deviceId tuple.deleteSession in interface SessionStoreaddress - the address of the remote client.public void deleteAllSessions(java.lang.String name)
SessionStoreSessionRecords corresponding to all devices of a recipientId.deleteAllSessions in interface SessionStorename - the name of the remote client.