org.keycloak.credential

## Interface UserCredentialStore.Streams

- All Superinterfaces:
    Provider, UserCredentialStore
  All Known Subinterfaces:
    UserCredentialManager.Streams
  All Known Implementing Classes:
    JpaUserCredentialStore, JpaUserFederatedStorageProvider, JpaUserProvider, MapUserProvider, UserCredentialStoreManager
  Enclosing interface:
    UserCredentialStore

      public static interface UserCredentialStore.Streams
      extends UserCredentialStore

  The `UserCredentialStore.Streams` interface makes all collection-based methods in `UserCredentialStore` 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.credential.UserCredentialStore

      `UserCredentialStore.Streams`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default List<CredentialModel>` | `getStoredCredentials(RealmModel realm, UserModel user)`
    `default List<CredentialModel>` | `getStoredCredentialsByType(RealmModel realm, UserModel user, String type)`
    `Stream<CredentialModel>` | `getStoredCredentialsByTypeStream(RealmModel realm, UserModel user, String type)` Obtains the stored credentials associated with the specified user that match the specified type.
    `Stream<CredentialModel>` | `getStoredCredentialsStream(RealmModel realm, UserModel user)` Obtains the stored credentials associated with the specified user.

    - ### Methods inherited from interface org.keycloak.credential.UserCredentialStore

      `createCredential, getStoredCredentialById, getStoredCredentialByNameAndType, moveCredentialTo, removeStoredCredential, updateCredential`

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Method Detail

    - #### getStoredCredentials

          default List<CredentialModel> getStoredCredentials(RealmModel realm,
                                                             UserModel user)

      Specified by:
        `getStoredCredentials` in interface `UserCredentialStore`

    - #### getStoredCredentialsStream

          Stream<CredentialModel> getStoredCredentialsStream(RealmModel realm,
                                                             UserModel user)

      Description copied from interface: `UserCredentialStore`
      Obtains the stored credentials associated with the specified user.
      Specified by:
        `getStoredCredentialsStream` in interface `UserCredentialStore`
      Parameters:
        `realm` - a reference to the realm.
        `user` - the user whose credentials are being searched.
      Returns:
        a non-null `Stream` of credentials.

    - #### getStoredCredentialsByType

          default List<CredentialModel> getStoredCredentialsByType(RealmModel realm,
                                                                   UserModel user,
                                                                   String type)

      Specified by:
        `getStoredCredentialsByType` in interface `UserCredentialStore`

    - #### getStoredCredentialsByTypeStream

          Stream<CredentialModel> getStoredCredentialsByTypeStream(RealmModel realm,
                                                                   UserModel user,
                                                                   String type)

      Description copied from interface: `UserCredentialStore`
      Obtains the stored credentials associated with the specified user that match the specified type.
      Specified by:
        `getStoredCredentialsByTypeStream` in interface `UserCredentialStore`
      Parameters:
        `realm` - a reference to the realm.
        `user` - the user whose credentials are being searched.
        `type` - the type of credentials being searched.
      Returns:
        a non-null `Stream` of credentials.

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