org.keycloak.models.map.authorization

## Class MapScopeStore

- java.lang.Object
- - org.keycloak.models.map.authorization.MapScopeStore

- All Implemented Interfaces:
    ScopeStore

      public class MapScopeStore
      extends Object
      implements ScopeStore

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapScopeStore(KeycloakSession session, MapStorage<MapScopeEntity,Scope> scopeStore, AuthorizationProvider provider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Scope` | `create(String id, String name, ResourceServer resourceServer)` Creates a new `Scope` instance.
    `void` | `delete(String id)` Deletes a scope from the underlying persistence mechanism.
    `Scope` | `findById(String id, String resourceServerId)` Returns a `Scope` with the given `id`
    `Scope` | `findByName(String name, String resourceServerId)` Returns a `Scope` with the given `name`
    `List<Scope>` | `findByResourceServer(Map<Scope.FilterOption,String[]> attributes, String resourceServerId, int firstResult, int maxResult)` Returns a list of `Scope` associated with a `ResourceServer` with the given `resourceServerId`.
    `List<Scope>` | `findByResourceServer(String id)` Returns a list of `Scope` associated with a `ResourceServer` with the given `resourceServerId`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.authorization.store.ScopeStore

      `create`

- - ### Constructor Detail

    - #### MapScopeStore

          public MapScopeStore(KeycloakSession session,
                               MapStorage<MapScopeEntity,Scope> scopeStore,
                               AuthorizationProvider provider)

  - ### Method Detail

    - #### create

          public Scope create(String id,
                              String name,
                              ResourceServer resourceServer)

      Description copied from interface: `ScopeStore`
      Creates a new `Scope` 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 interface `ScopeStore`
      Parameters:
        `id` - the id of the scope. Is generated randomly when null
        `name` - the name of the scope
        `resourceServer` - the resource server to which this scope belongs
      Returns:
        a new instance of `Scope`

    - #### delete

          public void delete(String id)

      Description copied from interface: `ScopeStore`
      Deletes a scope from the underlying persistence mechanism.
      Specified by:
        `delete` in interface `ScopeStore`
      Parameters:
        `id` - the id of the scope to delete

    - #### findById

          public Scope findById(String id,
                                String resourceServerId)

      Description copied from interface: `ScopeStore`
      Returns a `Scope` with the given `id`
      Specified by:
        `findById` in interface `ScopeStore`
      Parameters:
        `id` - the identifier of the scope
        `resourceServerId` - the resource server id
      Returns:
        a scope with the given identifier.

    - #### findByName

          public Scope findByName(String name,
                                  String resourceServerId)

      Description copied from interface: `ScopeStore`
      Returns a `Scope` with the given `name`
      Specified by:
        `findByName` in interface `ScopeStore`
      Parameters:
        `name` - the name of the scope
        `resourceServerId` - the resource server id
      Returns:
        a scope with the given name.

    - #### findByResourceServer

          public List<Scope> findByResourceServer(String id)

      Description copied from interface: `ScopeStore`
      Returns a list of `Scope` associated with a `ResourceServer` with the given `resourceServerId`.
      Specified by:
        `findByResourceServer` in interface `ScopeStore`
      Returns:
        a list of scopes that belong to the given resource server

    - #### findByResourceServer

          public List<Scope> findByResourceServer(Map<Scope.FilterOption,String[]> attributes,
                                                  String resourceServerId,
                                                  int firstResult,
                                                  int maxResult)

      Description copied from interface: `ScopeStore`
      Returns a list of `Scope` associated with a `ResourceServer` with the given `resourceServerId`.
      Specified by:
        `findByResourceServer` in interface `ScopeStore`
      Parameters:
        `attributes` - a map holding the attributes that will be used as a filter; possible filter options are given by `Scope.FilterOption`
        `resourceServerId` - the identifier of a resource server
      Returns:
        a list of scopes that belong to the given resource server

Copyright © 2021 JBoss by Red Hat. All rights reserved.