Package org.keycloak.authorization.store
Interface ScopeStore
-
public interface ScopeStoreAScopeStoreis responsible to manage the persistence ofScopeinstances.- Author:
- Pedro Igor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Scopecreate(ResourceServer resourceServer, String name)Creates a newScopeinstance.Scopecreate(ResourceServer resourceServer, String id, String name)Creates a newScopeinstance.voiddelete(String id)Deletes a scope from the underlying persistence mechanism.ScopefindById(ResourceServer resourceServer, String id)Returns aScopewith the givenidScopefindByName(ResourceServer resourceServer, String name)Returns aScopewith the givennameList<Scope>findByResourceServer(ResourceServer resourceServer)List<Scope>findByResourceServer(ResourceServer resourceServer, Map<Scope.FilterOption,String[]> attributes, Integer firstResult, Integer maxResults)
-
-
-
Method Detail
-
create
default Scope create(ResourceServer resourceServer, String name)
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 belongsname- the name of the scope- Returns:
- a new instance of
Scope
-
create
Scope create(ResourceServer resourceServer, String id, String name)
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 belongsid- the id of the scope. Is generated randomly when nullname- the name of the scope- Returns:
- a new instance of
Scope
-
delete
void delete(String id)
Deletes a scope from the underlying persistence mechanism.- Parameters:
id- the id of the scope to delete
-
findById
Scope findById(ResourceServer resourceServer, String id)
Returns aScopewith the givenid- Parameters:
resourceServer- the resource server idid- the identifier of the scope- Returns:
- a scope with the given identifier.
-
findByName
Scope findByName(ResourceServer resourceServer, String name)
Returns aScopewith the givenname- Parameters:
resourceServer- the resource servername- the name of the scope- Returns:
- a scope with the given name.
-
findByResourceServer
List<Scope> findByResourceServer(ResourceServer resourceServer)
- Parameters:
resourceServer- the identifier of a resource server- 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 serverattributes- 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
-
-