Class ClientScopeStorageManager

All Implemented Interfaces:
ClientScopeProvider, Provider, ClientScopeLookupProvider

  • Constructor Details

    • ClientScopeStorageManager

      public ClientScopeStorageManager(KeycloakSession session)
  • Method Details

    • 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.
    • 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.
    • getClientScopesByProtocol

      public Stream<ClientScopeModel> getClientScopesByProtocol(RealmModel realm, String protocol)
      Description copied from interface: ClientScopeProvider
      Must retrieve all client scopes of the given realm that are use the given protocol.
      Specified by:
      getClientScopesByProtocol in interface ClientScopeProvider
      Parameters:
      realm - the realm to retrieve the client scopes from.
      protocol - the protocol expected from the clientScope
    • getClientScopesByProtocolForUpdate

      public Stream<ClientScopeModel> getClientScopesByProtocolForUpdate(RealmModel realm, String protocol)
      Description copied from interface: ClientScopeProvider
      Retrieves all client scopes of the given realm that use the given protocol while holding a realm-scoped transactional lock. Concurrent callers for the same realm must be serialized until the current transaction completes, including when no matching client scopes exist. The default implementation performs an unlocked query for compatibility; transactional persistence providers must override it to provide the locking guarantee.
      Specified by:
      getClientScopesByProtocolForUpdate in interface ClientScopeProvider
      Parameters:
      realm - the realm to retrieve the client scopes from
      protocol - the protocol expected from the client scopes
      Returns:
      stream of client scopes reflecting the latest committed state
    • getClientScopesByAttributes

      public Stream<ClientScopeModel> getClientScopesByAttributes(RealmModel realm, Map<String,String> searchMap, boolean useOr)
      Description copied from interface: ClientScopeProvider
      Allows us to filter for scopes by specific attributes
      Specified by:
      getClientScopesByAttributes in interface ClientScopeProvider
      Parameters:
      realm - Realm.
      searchMap - a key-value map that holds the attribute names and values to search for.
      useOr - If the search-params should be combined with or-expressions or and-expressions
    • close

      public void close()
      Specified by:
      close in interface Provider