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 Scopecreate(String id, String name, ResourceServer resourceServer)Creates a newScopeinstance.default Scopecreate(String name, ResourceServer resourceServer)Creates a newScopeinstance.voiddelete(String id)Deletes a scope from the underlying persistence mechanism.ScopefindById(String id, String resourceServerId)Returns aScopewith the givenidScopefindByName(String name, String resourceServerId)Returns aScopewith the givennameList<Scope>findByResourceServer(String id)List<Scope>findByResourceServer(Map<Scope.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
-
-
-
Method Detail
-
create
default Scope create(String name, ResourceServer resourceServer)
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:
name- the name of the scoperesourceServer- the resource server to which this scope belongs- Returns:
- a new instance of
Scope
-
create
Scope create(String id, String name, ResourceServer resourceServer)
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:
id- the id of the scope. Is generated randomly when nullname- the name of the scoperesourceServer- the resource server to which this scope belongs- 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(String id, String resourceServerId)
Returns aScopewith the givenid- Parameters:
id- the identifier of the scoperesourceServerId- the resource server id- Returns:
- a scope with the given identifier.
-
findByName
Scope findByName(String name, String resourceServerId)
Returns aScopewith the givenname- Parameters:
name- the name of the scoperesourceServerId- the resource server id- Returns:
- a scope with the given name.
-
findByResourceServer
List<Scope> findByResourceServer(String id)
- Parameters:
resourceServerId- the identifier of a resource server- Returns:
- a list of scopes that belong to the given resource server
-
findByResourceServer
List<Scope> findByResourceServer(Map<Scope.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)
- Parameters:
attributes- a map holding the attributes that will be used as a filter; possible filter options are given byScope.FilterOptionresourceServerId- the identifier of a resource server- Returns:
- a list of scopes that belong to the given resource server
- Throws:
IllegalArgumentException- when there is an unknown attribute in theattributesmap
-
-