org.keycloak.storage.federated

## Interface UserGroupMembershipFederatedStorage.Streams

- All Superinterfaces:
    UserGroupMembershipFederatedStorage
  All Known Subinterfaces:
    UserFederatedStorageProvider.Streams
  All Known Implementing Classes:
    JpaUserFederatedStorageProvider
  Enclosing interface:
    UserGroupMembershipFederatedStorage

      public static interface UserGroupMembershipFederatedStorage.Streams
      extends UserGroupMembershipFederatedStorage

  The `UserGroupMembershipFederatedStorage.Streams` interface makes all collection-based methods in `UserGroupMembershipFederatedStorage` default by providing implementations that delegate to the `Stream`-based variants instead of the other way around.

  It allows for implementations to focus on the `Stream`-based approach for processing sets of data and benefit from the potential memory and performance optimizations of that approach.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.storage.federated.UserGroupMembershipFederatedStorage

      `UserGroupMembershipFederatedStorage.Streams`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default Set<GroupModel>` | `getGroups(RealmModel realm, String userId)`
    `Stream<GroupModel>` | `getGroupsStream(RealmModel realm, String userId)` Obtains the groups associated with the federated user.
    `default List<String>` | `getMembership(RealmModel realm, GroupModel group, int firstResult, int max)`
    `Stream<String>` | `getMembershipStream(RealmModel realm, GroupModel group, int firstResult, int max)` Obtains the federated users that are members of the given `group` in the specified `realm`.

    - ### Methods inherited from interface org.keycloak.storage.federated.UserGroupMembershipFederatedStorage

      `joinGroup, leaveGroup`

- - ### Method Detail

    - #### getGroups

          default Set<GroupModel> getGroups(RealmModel realm,
                                            String userId)

      Specified by:
        `getGroups` in interface `UserGroupMembershipFederatedStorage`

    - #### getGroupsStream

          Stream<GroupModel> getGroupsStream(RealmModel realm,
                                             String userId)

      Description copied from interface: `UserGroupMembershipFederatedStorage`
      Obtains the groups associated with the federated user.
      Specified by:
        `getGroupsStream` in interface `UserGroupMembershipFederatedStorage`
      Parameters:
        `realm` - a reference to the realm.
        `userId` - the user identifier.
      Returns:
        a non-null `Stream` of groups.

    - #### getMembership

          default List<String> getMembership(RealmModel realm,
                                             GroupModel group,
                                             int firstResult,
                                             int max)

      Specified by:
        `getMembership` in interface `UserGroupMembershipFederatedStorage`

    - #### getMembershipStream

          Stream<String> getMembershipStream(RealmModel realm,
                                             GroupModel group,
                                             int firstResult,
                                             int max)

      Description copied from interface: `UserGroupMembershipFederatedStorage`
      Obtains the federated users that are members of the given `group` in the specified `realm`.
      Specified by:
        `getMembershipStream` in interface `UserGroupMembershipFederatedStorage`
      Parameters:
        `realm` - a reference to the realm.
        `group` - a reference to the group whose federated members are being searched.
        `firstResult` - first result to return. Ignored if negative.
        `max` - maximum number of results to return. Ignored if negative.
      Returns:
        a non-null `Stream` of federated user ids that are members of the group in the realm.

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