Class StoreFactoryCacheSession.ScopeCache
- java.lang.Object
-
- org.keycloak.models.cache.infinispan.authorization.StoreFactoryCacheSession.ScopeCache
-
- All Implemented Interfaces:
ScopeStore
- Enclosing class:
- StoreFactoryCacheSession
protected class StoreFactoryCacheSession.ScopeCache extends Object implements ScopeStore
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ScopeCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Scope
create(ResourceServer resourceServer, String name)
Creates a newScope
instance.Scope
create(ResourceServer resourceServer, String id, String name)
Creates a newScope
instance.void
delete(RealmModel realm, String id)
Deletes a scope from the underlying persistence mechanism.Scope
findById(RealmModel realm, ResourceServer resourceServer, String id)
Returns aScope
with the givenid
Scope
findByName(ResourceServer resourceServer, String name)
Returns aScope
with the givenname
List<Scope>
findByResourceServer(ResourceServer resourceServer)
Returns a list ofScope
associated with theResourceServer
.List<Scope>
findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults)
-
-
-
Method Detail
-
create
public Scope create(ResourceServer resourceServer, String name)
Description copied from interface:ScopeStore
Creates a newScope
instance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.- Specified by:
create
in interfaceScopeStore
- Parameters:
resourceServer
- the resource server to which this scope belongs. Cannot benull
.name
- the name of the scope- Returns:
- a new instance of
Scope
-
create
public Scope create(ResourceServer resourceServer, String id, String name)
Description copied from interface:ScopeStore
Creates a newScope
instance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.- Specified by:
create
in interfaceScopeStore
- Parameters:
resourceServer
- the resource server to which this scope belongs. Cannot benull
.id
- the id of the scope. Is generated randomly when nullname
- the name of the scope- Returns:
- a new instance of
Scope
-
delete
public void delete(RealmModel realm, String id)
Description copied from interface:ScopeStore
Deletes a scope from the underlying persistence mechanism.- Specified by:
delete
in interfaceScopeStore
- Parameters:
realm
- the realm. Cannot benull
.id
- the id of the scope to delete
-
findById
public Scope findById(RealmModel realm, ResourceServer resourceServer, String id)
Description copied from interface:ScopeStore
Returns aScope
with the givenid
- Specified by:
findById
in interfaceScopeStore
- Parameters:
realm
- the realm. Cannot benull
.resourceServer
- the resource server id. Ignored ifnull
.id
- the identifier of the scope- Returns:
- a scope with the given identifier.
-
findByName
public Scope findByName(ResourceServer resourceServer, String name)
Description copied from interface:ScopeStore
Returns aScope
with the givenname
- Specified by:
findByName
in interfaceScopeStore
- Parameters:
resourceServer
- the resource server. Cannot benull
.name
- the name of the scope- Returns:
- a scope with the given name.
-
findByResourceServer
public List<Scope> findByResourceServer(ResourceServer resourceServer)
Description copied from interface:ScopeStore
Returns a list ofScope
associated with theResourceServer
.- Specified by:
findByResourceServer
in interfaceScopeStore
- Parameters:
resourceServer
- the resource server. Cannot benull
.- Returns:
- a list of scopes that belong to the given resource server
-
findByResourceServer
public List<Scope> findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults)
Description copied from interface:ScopeStore
- Specified by:
findByResourceServer
in interfaceScopeStore
- Parameters:
resourceServer
- the resource server. Cannot benull
.attributes
- a map holding the attributes that will be used as a filter; possible filter options are given byScope.FilterOption
firstResult
- first result to return. Ignored if negative ornull
.maxResults
- maximum number of results to return. Ignored if negative ornull
.- Returns:
- a list of scopes that belong to the given resource server
-
-