org.keycloak.authorization.jpa.store

## Class JPAScopeStore

- java.lang.Object
- - org.keycloak.authorization.jpa.store.JPAScopeStore

- All Implemented Interfaces:
    ScopeStore

      public class JPAScopeStore
      extends Object
      implements ScopeStore

  Author:
    Pedro Igor

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JPAScopeStore(javax.persistence.EntityManager entityManager, AuthorizationProvider provider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Scope` | `create(String name, ResourceServer resourceServer)` Creates a new `Scope` instance.
    `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<String,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 serverId)` 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`

- - ### Constructor Detail

    - #### JPAScopeStore

          public JPAScopeStore(javax.persistence.EntityManager entityManager,
                               AuthorizationProvider provider)

  - ### Method Detail

    - #### create

          public Scope create(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:
        `name` - the name of the scope
        `resourceServer` - the resource server to which this scope belongs
      Returns:
        a new instance of `Scope`

    - #### 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
        `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 serverId)

      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<String,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
        `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.