org.keycloak.models.authorization.infinispan

## Class CachedScopeStore

- java.lang.Object
- - org.keycloak.models.authorization.infinispan.CachedScopeStore

- All Implemented Interfaces:
    ScopeStore

      public class CachedScopeStore
      extends Object
      implements ScopeStore

  Author:
    Pedro Igor

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachedScopeStore(KeycloakSession session, org.keycloak.models.authorization.infinispan.InfinispanStoreFactoryProvider.CacheTransaction transaction)`

  - ### 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.
    `void` | `delete(String id)` Deletes a scope from the underlying persistence mechanism.
    `Scope` | `findById(String id)` Returns a `Scope` with the given `id`
    `Scope` | `findByName(String name, String resourceServerId)` Returns a `Scope` with the given `name`
    `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`

- - ### Constructor Detail

    - #### CachedScopeStore

          public CachedScopeStore(KeycloakSession session,
                                  org.keycloak.models.authorization.infinispan.InfinispanStoreFactoryProvider.CacheTransaction transaction)

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

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

      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
      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
      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

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