org.keycloak.models.map.clientscope

## Class MapClientScopeProvider

- java.lang.Object
- - org.keycloak.models.map.clientscope.MapClientScopeProvider

- All Implemented Interfaces:
    ClientScopeProvider, Provider, ClientScopeLookupProvider

      public class MapClientScopeProvider
      extends Object
      implements ClientScopeProvider

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapClientScopeProvider(KeycloakSession session, MapStorage<MapClientScopeEntity,ClientScopeModel> clientScopeStore)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientScopeModel` | `addClientScope(RealmModel realm, String id, String name)` Creates new client scope with given internal ID and `name` to the given realm.
    `void` | `close()`
    `ClientScopeModel` | `getClientScopeById(RealmModel realm, String id)` Exact search for a client scope by its internal ID..
    `Stream<ClientScopeModel>` | `getClientScopesStream(RealmModel realm)` Returns all the client scopes of the given realm as a stream.
    `boolean` | `removeClientScope(RealmModel realm, String id)` Removes client scope from the given realm.
    `void` | `removeClientScopes(RealmModel realm)` Removes all client scopes from the given realm.

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

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

    - ### Methods inherited from interface org.keycloak.models.ClientScopeProvider

      `addClientScope`

- - ### Constructor Detail

    - #### MapClientScopeProvider

          public MapClientScopeProvider(KeycloakSession session,
                                        MapStorage<MapClientScopeEntity,ClientScopeModel> clientScopeStore)

  - ### Method Detail

    - #### getClientScopesStream

          public Stream<ClientScopeModel> getClientScopesStream(RealmModel realm)

      Description copied from interface: `ClientScopeProvider`
      Returns all the client scopes of the given realm as a stream.
      Specified by:
        `getClientScopesStream` in interface `ClientScopeProvider`
      Parameters:
        `realm` - Realm.
      Returns:
        Stream of the client scopes. Never returns `null`.

    - #### addClientScope

          public ClientScopeModel addClientScope(RealmModel realm,
                                                 String id,
                                                 String name)

      Description copied from interface: `ClientScopeProvider`
      Creates new client scope with given internal ID and `name` to the given realm. Spaces in `name` will be replaced by underscore so that scope name can be used as value of scope parameter.
      Specified by:
        `addClientScope` in interface `ClientScopeProvider`
      Parameters:
        `realm` - Realm owning this client scope.
        `id` - Internal ID of the client scope or `null` if one is to be created by the underlying store
        `name` - String name of the client scope.
      Returns:
        Model of the created client scope.

    - #### removeClientScope

          public boolean removeClientScope(RealmModel realm,
                                           String id)

      Description copied from interface: `ClientScopeProvider`
      Removes client scope from the given realm.
      Specified by:
        `removeClientScope` in interface `ClientScopeProvider`
      Parameters:
        `realm` - Realm.
        `id` - Internal ID of the client scope
      Returns:
        `true` if the client scope existed and has been removed, `false` otherwise.

    - #### removeClientScopes

          public void removeClientScopes(RealmModel realm)

      Description copied from interface: `ClientScopeProvider`
      Removes all client scopes from the given realm.
      Specified by:
        `removeClientScopes` in interface `ClientScopeProvider`
      Parameters:
        `realm` - Realm.

    - #### getClientScopeById

          public ClientScopeModel getClientScopeById(RealmModel realm,
                                                     String id)

      Description copied from interface: `ClientScopeLookupProvider`
      Exact search for a client scope by its internal ID..
      Specified by:
        `getClientScopeById` in interface `ClientScopeLookupProvider`
      Parameters:
        `realm` - Realm.
        `id` - Internal ID of the role.
      Returns:
        Model of the client scope.

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

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