Package 

Class StateRegistry


  • 
    public final class StateRegistry
    
                        

    Registry of all state objects exposed in the offline plugin. This class should have only one instance for the SDK.

    • Constructor Detail

      • StateRegistry

        StateRegistry(StateFlow<User> userStateFlow, StateFlow<Map<String, User>> latestUsers, StateFlow<List<Location>> activeLiveLocations, Job job, Function0<Long> now, CoroutineScope scope, MessageLimitConfig messageLimitConfig)
        Parameters:
        userStateFlow - The state flow that provides the user once it is set.
        latestUsers - Latest users of the SDK.
        activeLiveLocations - Latest live locations of the SDK.
        job - A background job cancelled after calling clear.
        scope - A scope for new coroutines.
        messageLimitConfig - Configuration for message limits.
    • Method Detail

      • queryChannels

         final QueryChannelsState queryChannels(QueryChannelsIdentifier identifier)

        Returns QueryChannelsState associated with the given identifier. Canonical lookup that works for standard, predefined-filter, and grouped queries. QueryChannelsMutableState derives its initial filter/sort and spec shape from the identifier itself, so this method is just a registry-cache lookup keyed by identifier identity.

        Parameters:
        identifier - The identifier of the QueryChannelsState.
      • channel

         final ChannelState channel(String channelType, String channelId)

        Returns ChannelState that represents a state of particular channel.

        Parameters:
        channelType - The channel type.
        channelId - The channel id.
      • clear

         final Unit clear()

        Clear state of all state objects.