org.keycloak.models

## Interface RoleContainerModel

- All Known Subinterfaces:
    CachedRealmModel, ClientModel, RealmModel
  All Known Implementing Classes:
    AbstractClientModel, AbstractClientStorageAdapter, AbstractReadOnlyClientStorageAdapter, AbstractRealmModel, ClientAdapter, ClientAdapter, ClientModelLazyDelegate, ClientModelLazyDelegate.WithId, MapClientAdapter, MapRealmAdapter, OpenshiftSAClientAdapter, RealmAdapter, RealmAdapter, UnsupportedOperationsClientStorageAdapter

      public interface RoleContainerModel

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `RoleContainerModel.RoleRemovedEvent`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDefaultRole(String name)` Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
    `RoleModel` | `addRole(String name)`
    `RoleModel` | `addRole(String id, String name)`
    `default List<String>` | `getDefaultRoles()` Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
    `Stream<String>` | `getDefaultRolesStream()` Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
    `String` | `getId()`
    `RoleModel` | `getRole(String name)`
    `default Set<RoleModel>` | `getRoles()` Deprecated. Use `getRolesStream` instead.
    `default Set<RoleModel>` | `getRoles(Integer firstResult, Integer maxResults)` Deprecated. Use `getRolesStream` instead.
    `Stream<RoleModel>` | `getRolesStream()` Returns available roles as a stream.
    `Stream<RoleModel>` | `getRolesStream(Integer firstResult, Integer maxResults)` Returns available roles as a stream.
    `void` | `removeDefaultRoles(String... defaultRoles)` Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
    `boolean` | `removeRole(RoleModel role)`
    `default Set<RoleModel>` | `searchForRoles(String search, Integer first, Integer max)` Deprecated. Use `searchForRolesStream` instead.
    `Stream<RoleModel>` | `searchForRolesStream(String search, Integer first, Integer max)` Searches roles by the given name.
    `default void` | `updateDefaultRoles(String... defaultRoles)` Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.

- - ### Method Detail

    - #### getId

          String getId()

    - #### getRole

          RoleModel getRole(String name)

    - #### addRole

          RoleModel addRole(String name)

    - #### addRole

          RoleModel addRole(String id,
                            String name)

    - #### removeRole

          boolean removeRole(RoleModel role)

    - #### getRoles

          @Deprecated
          default Set<RoleModel> getRoles()

      Deprecated. Use `getRolesStream` instead.

    - #### getRolesStream

          Stream<RoleModel> getRolesStream()

      Returns available roles as a stream.
      Returns:
        Stream of `RoleModel`. Never returns `null`.

    - #### getRoles

          @Deprecated
          default Set<RoleModel> getRoles(Integer firstResult,
                                                      Integer maxResults)

      Deprecated. Use `getRolesStream` instead.

    - #### getRolesStream

          Stream<RoleModel> getRolesStream(Integer firstResult,
                                           Integer maxResults)

      Returns available roles as a stream.
      Parameters:
        `firstResult` - `Integer` Index of the first desired role. Ignored if negative or `null`.
        `maxResults` - `Integer` Maximum number of returned roles. Ignored if negative or `null`.
      Returns:
        Stream of `RoleModel`. Never returns `null`.

    - #### searchForRoles

          @Deprecated
          default Set<RoleModel> searchForRoles(String search,
                                                            Integer first,
                                                            Integer max)

      Deprecated. Use `searchForRolesStream` instead.

    - #### searchForRolesStream

          Stream<RoleModel> searchForRolesStream(String search,
                                                 Integer first,
                                                 Integer max)

      Searches roles by the given name. Returns all roles that match the given filter.
      Parameters:
        `search` - `String` Name of the role to be used as a filter.
        `first` - `Integer` Index of the first desired role. Ignored if negative or `null`.
        `max` - `Integer` Maximum number of returned roles. Ignored if negative or `null`.
      Returns:
        Stream of `RoleModel`. Never returns `null`.

    - #### getDefaultRoles

          @Deprecated
          default List<String> getDefaultRoles()

      Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
      Returns:
        List of default roles names or empty list if there are none. Never returns `null`.

    - #### getDefaultRolesStream

          @Deprecated
          Stream<String> getDefaultRolesStream()

      Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.
      Returns:
        Stream of default roles names or empty stream if there are none. Never returns `null`.

    - #### addDefaultRole

          @Deprecated
          void addDefaultRole(String name)

      Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.

    - #### updateDefaultRoles

          @Deprecated
          default void updateDefaultRoles(String... defaultRoles)

      Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.

    - #### removeDefaultRoles

          @Deprecated
          void removeDefaultRoles(String... defaultRoles)

      Deprecated. Default roles are now managed by `RealmModel.getDefaultRole()`. This method will be removed.

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