Class StoreFactoryCacheSession
- java.lang.Object
-
- org.keycloak.models.cache.infinispan.authorization.StoreFactoryCacheSession
-
- All Implemented Interfaces:
StoreFactory
,CachedStoreFactoryProvider
,Provider
public class StoreFactoryCacheSession extends Object implements CachedStoreFactoryProvider
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
StoreFactoryCacheSession.PermissionTicketCache
protected class
StoreFactoryCacheSession.PolicyCache
protected class
StoreFactoryCacheSession.ResourceCache
protected class
StoreFactoryCacheSession.ResourceServerCache
protected class
StoreFactoryCacheSession.ScopeCache
-
Field Summary
-
Constructor Summary
Constructors Constructor Description StoreFactoryCacheSession(StoreFactoryCacheManager cache, KeycloakSession session)
-
Method Summary
-
-
-
Field Detail
-
logger
protected static final org.jboss.logging.Logger logger
-
cache
protected StoreFactoryCacheManager cache
-
transactionActive
protected boolean transactionActive
-
setRollbackOnly
protected boolean setRollbackOnly
-
managedResourceServers
protected Map<String,ResourceServerAdapter> managedResourceServers
-
managedScopes
protected Map<String,ScopeAdapter> managedScopes
-
managedResources
protected Map<String,ResourceAdapter> managedResources
-
managedPolicies
protected Map<String,PolicyAdapter> managedPolicies
-
managedPermissionTickets
protected Map<String,PermissionTicketAdapter> managedPermissionTickets
-
invalidationEvents
protected Set<InvalidationEvent> invalidationEvents
-
clearAll
protected boolean clearAll
-
startupRevision
protected final long startupRevision
-
delegate
protected StoreFactory delegate
-
session
protected KeycloakSession session
-
resourceServerCache
protected StoreFactoryCacheSession.ResourceServerCache resourceServerCache
-
scopeCache
protected StoreFactoryCacheSession.ScopeCache scopeCache
-
resourceCache
protected StoreFactoryCacheSession.ResourceCache resourceCache
-
policyCache
protected StoreFactoryCacheSession.PolicyCache policyCache
-
permissionTicketCache
protected StoreFactoryCacheSession.PermissionTicketCache permissionTicketCache
-
-
Constructor Detail
-
StoreFactoryCacheSession
public StoreFactoryCacheSession(StoreFactoryCacheManager cache, KeycloakSession session)
-
-
Method Detail
-
getResourceServerStore
public ResourceServerStore getResourceServerStore()
Description copied from interface:StoreFactory
Returns aResourceServerStore
.- Specified by:
getResourceServerStore
in interfaceStoreFactory
- Returns:
- the resource server store
-
getScopeStore
public ScopeStore getScopeStore()
Description copied from interface:StoreFactory
Returns aScopeStore
.- Specified by:
getScopeStore
in interfaceStoreFactory
- Returns:
- the scope store
-
getResourceStore
public ResourceStore getResourceStore()
Description copied from interface:StoreFactory
Returns aResourceStore
.- Specified by:
getResourceStore
in interfaceStoreFactory
- Returns:
- the resource store
-
getPolicyStore
public PolicyStore getPolicyStore()
Description copied from interface:StoreFactory
Returns aPolicyStore
.- Specified by:
getPolicyStore
in interfaceStoreFactory
- Returns:
- the policy store
-
getPermissionTicketStore
public PermissionTicketStore getPermissionTicketStore()
Description copied from interface:StoreFactory
Returns aPermissionTicketStore
.- Specified by:
getPermissionTicketStore
in interfaceStoreFactory
- Returns:
- the permission ticket store
-
setReadOnly
public void setReadOnly(boolean readOnly)
Description copied from interface:StoreFactory
Sets whether or not changes to instances returned from this factory are supported. Once marked as read-only, any attempt to change state will throw anIllegalStateException
.- Specified by:
setReadOnly
in interfaceStoreFactory
- Parameters:
readOnly
- if true, changes are not supported
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:StoreFactory
Indicates if instances returned from storage are read-only.- Specified by:
isReadOnly
in interfaceStoreFactory
- Returns:
- if true, instances only support reads.
-
runInvalidations
protected void runInvalidations()
-
getStartupRevision
public long getStartupRevision()
-
isInvalid
public boolean isInvalid(String id)
-
registerResourceServerInvalidation
public void registerResourceServerInvalidation(String id)
-
registerScopeInvalidation
public void registerScopeInvalidation(String id, String name, String serverId)
-
registerResourceInvalidation
public void registerResourceInvalidation(String id, String name, String type, Set<String> uris, Set<String> scopes, String serverId, String owner)
-
registerPolicyInvalidation
public void registerPolicyInvalidation(String id, String name, Set<String> resources, Set<String> scopes, String defaultResourceType, String serverId)
-
registerPermissionTicketInvalidation
public void registerPermissionTicketInvalidation(String id, String owner, String requester, String resource, String resourceName, String scope, String serverId)
-
getResourceServerStoreDelegate
public ResourceServerStore getResourceServerStoreDelegate()
-
getScopeStoreDelegate
public ScopeStore getScopeStoreDelegate()
-
getResourceStoreDelegate
public ResourceStore getResourceStoreDelegate()
-
getPolicyStoreDelegate
public PolicyStore getPolicyStoreDelegate()
-
getPermissionTicketStoreDelegate
public PermissionTicketStore getPermissionTicketStoreDelegate()
-
getResourceServerByClientCacheKey
public static String getResourceServerByClientCacheKey(String clientId)
-
getResourceByNameCacheKey
public static String getResourceByNameCacheKey(String name, String ownerId, String serverId)
-
getResourceByOwnerCacheKey
public static String getResourceByOwnerCacheKey(String owner, String serverId)
-
getResourceByTypeCacheKey
public static String getResourceByTypeCacheKey(String type, String serverId)
-
getResourceByTypeCacheKey
public static String getResourceByTypeCacheKey(String type, String owner, String serverId)
-
getResourceByTypeInstanceCacheKey
public static String getResourceByTypeInstanceCacheKey(String type, String serverId)
-
getResourceByUriCacheKey
public static String getResourceByUriCacheKey(String uri, String serverId)
-
getResourceByScopeCacheKey
public static String getResourceByScopeCacheKey(String scopeId, String serverId)
-
getPolicyByResourceScope
public static String getPolicyByResourceScope(String scope, String resourceId, String serverId)
-
getPermissionTicketByResource
public static String getPermissionTicketByResource(String resourceId, String serverId)
-
getPermissionTicketByScope
public static String getPermissionTicketByScope(String scopeId, String serverId)
-
getPermissionTicketByGranted
public static String getPermissionTicketByGranted(String userId, String serverId)
-
getPermissionTicketByResourceNameAndGranted
public static String getPermissionTicketByResourceNameAndGranted(String resourceName, String userId, String serverId)
-
getPermissionTicketByOwner
public static String getPermissionTicketByOwner(String owner, String serverId)
-
getDelegate
public StoreFactory getDelegate()
-
-