text: //
  //  SignalSessionStore.h
  //  SignalProtocol-ObjC
  //
  //  Created by Chris Ballinger on 6/27/16.
  //
  //
  
  #import <Foundation/Foundation.h>
  #import "SignalAddress.h"
  
  NS_ASSUME_NONNULL_BEGIN
  @protocol SignalSessionStore <NSObject>
  
  @required
  
  /**
   * Returns a copy of the serialized session record corresponding to the
   * provided recipient ID + device ID tuple.
   * or nil if not found.
   */
  - (nullable NSData*) sessionRecordForAddress:(SignalAddress*)address;
  
  /**
   * Commit to storage the session record for a given
   * recipient ID + device ID tuple.
   *
   * Return YES on success, NO on failure.
   */
  - (BOOL) storeSessionRecord:(NSData*)recordData forAddress:(SignalAddress*)address;
  
  /**
   * Determine whether there is a committed session record for a
   * recipient ID + device ID tuple.
   */
  - (BOOL) sessionRecordExistsForAddress:(SignalAddress*)address;
  
  /**
   * Remove a session record for a recipient ID + device ID tuple.
   */
  - (BOOL) deleteSessionRecordForAddress:(SignalAddress*)address;
  
  /**
   * Returns all known devices with active sessions for a recipient
   */
  - (NSArray<NSNumber*>*) allDeviceIdsForAddressName:(NSString*)addressName;
  
  /**
   * Remove the session records corresponding to all devices of a recipient ID.
   *
   * @return the number of deleted sessions on success, negative on failure
   */
  - (int) deleteAllSessionsForAddressName:(NSString*)addressName;
  
  @end
  NS_ASSUME_NONNULL_END