Package org.keycloak.authorization.store
Interface ScopeStore
- All Known Implementing Classes:
 JPAScopeStore,StoreFactoryCacheSession.ScopeCache
public interface ScopeStore
A 
ScopeStore is responsible to manage the persistence of Scope instances.- Author:
 - Pedro Igor
 
- 
Method Summary
Modifier and TypeMethodDescriptiondefault Scopecreate(ResourceServer resourceServer, String name) Creates a newScopeinstance.create(ResourceServer resourceServer, String id, String name) Creates a newScopeinstance.voidDeletes a scope from the underlying persistence mechanism.findById(ResourceServer resourceServer, String id) Returns aScopewith the givenidfindByName(ResourceServer resourceServer, String name) Returns aScopewith the givennamefindByResourceServer(ResourceServer resourceServer) Returns a list ofScopeassociated with theResourceServer.findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption, String[]> attributes, Integer firstResult, Integer maxResults)  
- 
Method Details
- 
create
Creates a newScopeinstance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.- 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
Creates a newScopeinstance. The new instance is not necessarily persisted though, which may require a call to the {#save} method to actually make it persistent.- 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
Deletes a scope from the underlying persistence mechanism.- Parameters:
 id- the id of the scope to delete
 - 
findById
Returns aScopewith the givenid- Parameters:
 resourceServer- the resource server id. Ignored ifnull.id- the identifier of the scope- Returns:
 - a scope with the given identifier.
 
 - 
findByName
Returns aScopewith the givenname- Parameters:
 resourceServer- the resource server. Cannot benull.name- the name of the scope- Returns:
 - a scope with the given name.
 
 - 
findByResourceServer
Returns a list ofScopeassociated with theResourceServer.- Parameters:
 resourceServer- the resource server. Cannot benull.- Returns:
 - a list of scopes that belong to the given resource server
 
 - 
findByResourceServer
List<Scope> findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption, String[]> attributes, Integer firstResult, Integer maxResults) - 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.FilterOptionfirstResult- 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
 - Throws:
 IllegalArgumentException- when there is an unknown attribute in theattributesmap
 
 -