Class QSessionStoreRegistry

java.lang.Object
com.kingsrook.qqq.backend.core.modules.authentication.QSessionStoreRegistry

public class QSessionStoreRegistry extends Object
Registry for session store providers. QBits or application code implement QSessionStoreProviderInterface and register their implementation with this registry on startup. QQQ core uses the registered provider for session caching without needing to know about the specific implementation. This follows the same pattern as SpaNotFoundHandlerRegistry - core defines the interface and registry, implementations register themselves. Usage: - QBit/App: QSessionStoreRegistry.getInstance().register(myProvider); - Core: QSessionStoreRegistry.getInstance().getProvider().ifPresent(p -> p.store(...));
  • Method Details

    • getInstance

      public static QSessionStoreRegistry getInstance()
      Get the singleton instance of the registry.
      Returns:
      The singleton QSessionStoreRegistry instance
    • register

      public void register(QSessionStoreProviderInterface provider)
      Register a session store provider. Called by QBits or application code on startup to register their session store implementation.
      Parameters:
      provider - The provider implementation to register
    • isAvailable

      public boolean isAvailable()
      Check if a session store provider is registered.
      Returns:
      true if a provider is registered, false otherwise
    • getProvider

      Get the registered session store provider.
      Returns:
      Optional containing the provider if registered
    • clear

      public void clear()
      Clear the registered provider (useful for testing).