Class QSessionStoreRegistry
java.lang.Object
com.kingsrook.qqq.backend.core.modules.authentication.QSessionStoreRegistry
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 Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the registered provider (useful for testing).static QSessionStoreRegistryGet the singleton instance of the registry.Get the registered session store provider.booleanCheck if a session store provider is registered.voidregister(QSessionStoreProviderInterface provider) Register a session store provider.
-
Method Details
-
getInstance
Get the singleton instance of the registry.- Returns:
- The singleton QSessionStoreRegistry instance
-
register
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).
-