Interface RoleLookupProvider

All Known Subinterfaces:
CacheRealmProvider, RoleProvider, RoleStorageProvider
All Known Implementing Classes:
JpaRealmProvider, MapRoleProvider, RealmCacheSession, RoleStorageManager

public interface RoleLookupProvider
Abstraction interface for lookup of both realm roles and client roles by id, name and description.
  • Method Details

    • getRealmRole

      RoleModel getRealmRole(RealmModel realm, String name)
      Exact search for a role by given name.
      Parameters:
      realm - Realm.
      name - String name of the role.
      Returns:
      Model of the role, or null if no role is found.
    • getRoleById

      RoleModel getRoleById(RealmModel realm, String id)
      Exact search for a role by its internal ID..
      Parameters:
      realm - Realm.
      id - Internal ID of the role.
      Returns:
      Model of the role.
    • searchForRolesStream

      Stream<RoleModel> searchForRolesStream(RealmModel realm, String search, Integer first, Integer max)
      Case-insensitive search for roles that contain the given string in their name or description.
      Parameters:
      realm - Realm.
      search - Searched substring of the role's name or description.
      first - First result to return. Ignored if negative or null.
      max - Maximum number of results to return. Ignored if negative or null.
      Returns:
      Stream of the realm roles their name or description contains given search string. Never returns null.
    • getClientRole

      RoleModel getClientRole(ClientModel client, String name)
      Exact search for a client role by given name.
      Parameters:
      client - Client.
      name - String name of the role.
      Returns:
      Model of the role, or null if no role is found.
    • searchForClientRolesStream

      Stream<RoleModel> searchForClientRolesStream(ClientModel client, String search, Integer first, Integer max)
      Case-insensitive search for client roles that contain the given string in their name or description.
      Parameters:
      client - Client.
      search - String to search by role's name or description.
      first - First result to return. Ignored if negative or null.
      max - Maximum number of results to return. Ignored if negative or null.
      Returns:
      Stream of the client roles their name or description contains given search string. Never returns null.