Class InMemorySessionStore

  • All Implemented Interfaces:
    SessionStore

    public class InMemorySessionStore
    extends java.lang.Object
    implements SessionStore
    • Constructor Detail

      • InMemorySessionStore

        public InMemorySessionStore()
    • Method Detail

      • loadSession

        public SessionRecord loadSession​(SignalProtocolAddress remoteAddress)
        Description copied from interface: SessionStore
        Returns a copy of the SessionRecord 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.

        Specified by:
        loadSession in interface SessionStore
        Parameters:
        remoteAddress - The name and device ID of the remote client.
        Returns:
        a copy of the SessionRecord corresponding to the recipientId + deviceId tuple, or a new SessionRecord if one does not currently exist.
      • getSubDeviceSessions

        public java.util.List<java.lang.Integer> getSubDeviceSessions​(java.lang.String name)
        Description copied from interface: SessionStore
        Returns all known devices with active sessions for a recipient
        Specified by:
        getSubDeviceSessions in interface SessionStore
        Parameters:
        name - the name of the client.
        Returns:
        all known sub-devices with active sessions.
      • deleteAllSessions

        public void deleteAllSessions​(java.lang.String name)
        Description copied from interface: SessionStore
        Remove the SessionRecords corresponding to all devices of a recipientId.
        Specified by:
        deleteAllSessions in interface SessionStore
        Parameters:
        name - the name of the remote client.