Interface BigSegmentStore

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    public interface BigSegmentStore
    extends java.io.Closeable
    Interface for a read-only data store that allows querying of user membership in Big Segments.

    Big Segments are a specific type of user segments. For more information, read the LaunchDarkly documentation .

    Since:
    5.7.0
    • Method Detail

      • getMembership

        BigSegmentStoreTypes.Membership getMembership​(java.lang.String userHash)
        Queries the store for a snapshot of the current segment state for a specific user.

        The userHash is a base64-encoded string produced by hashing the user key as defined by the Big Segments specification; the store implementation does not need to know the details of how this is done, because it deals only with already-hashed keys, but the string can be assumed to only contain characters that are valid in base64.

        If the store is working, but no membership state is found for this user, the method may return either null or an empty BigSegmentStoreTypes.Membership. It should not throw an exception unless there is an unexpected database error or the retrieved data is malformed.

        Parameters:
        userHash - the hashed user identifier
        Returns:
        the user's segment membership state or null
      • getMetadata

        BigSegmentStoreTypes.StoreMetadata getMetadata()
        Returns information about the overall state of the store.

        This method will be called only when the SDK needs the latest state, so it should not be cached.

        If the store is working, but no metadata has been stored in it yet, the method should return null. It should not throw an exception unless there is an unexpected database error or the retrieved data is malformed.

        Returns:
        the store metadata or null