Interface ClientScopeProvider

All Superinterfaces:
ClientScopeLookupProvider, Provider
All Known Subinterfaces:
CacheRealmProvider
All Known Implementing Classes:
ClientScopeStorageManager, JpaRealmProvider, RealmCacheSession

public interface ClientScopeProvider extends Provider, ClientScopeLookupProvider
Provider of the client scopes records.
  • Method Details

    • getClientScopesStream

      Stream<ClientScopeModel> getClientScopesStream(RealmModel realm)
      Returns all the client scopes of the given realm as a stream.
      Parameters:
      realm - Realm.
      Returns:
      Stream of the client scopes. Never returns null.
    • addClientScope

      default ClientScopeModel addClientScope(RealmModel realm, String name)
      Creates new client scope with given 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. The internal ID will be created automatically.
      Parameters:
      realm - Realm owning this client scope.
      name - String name of the client scope.
      Returns:
      Model of the created client scope.
      Throws:
      ModelDuplicateException - if client scope with given name already exists
    • addClientScope

      ClientScopeModel addClientScope(RealmModel realm, String id, String name)
      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.
      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.
      Throws:
      IllegalArgumentException - If id does not conform the format understood by the underlying store.
      ModelDuplicateException - if client scope with given name already exists
    • removeClientScope

      boolean removeClientScope(RealmModel realm, String id)
      Removes client scope from the given realm.
      Parameters:
      realm - Realm.
      id - Internal ID of the client scope
      Returns:
      true if the client scope existed and has been removed, false otherwise.
      Throws:
      ModelException - if client scope is in use.
    • removeClientScopes

      void removeClientScopes(RealmModel realm)
      Removes all client scopes from the given realm.
      Parameters:
      realm - Realm.