org.keycloak.models.sessions.infinispan.stream

## Class UserSessionPredicate

- java.lang.Object
- - org.keycloak.models.sessions.infinispan.stream.UserSessionPredicate

- All Implemented Interfaces:
    Predicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>

      @SerializeWith(value=UserSessionPredicate.ExternalizerImpl.class)
      public class UserSessionPredicate
      extends Object
      implements Predicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>

  Author:
    Stian Thorgersen

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `UserSessionPredicate.ExternalizerImpl`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `UserSessionPredicate` | `brokerSessionId(String id)`
    `UserSessionPredicate` | `brokerUserId(String id)`
    `UserSessionPredicate` | `client(String clientUUID)` Adds a test for client.
    `static UserSessionPredicate` | `create(String realm)` Creates a user session predicate.
    `UserSessionPredicate` | `expired(Integer expired, Integer expiredRefresh)`
    `UserSessionPredicate` | `expired(Integer expired, Integer expiredRefresh, Integer expiredRememberMe, Integer expiredRefreshRememberMe)`
    `boolean` | `test(Map.Entry<String,SessionEntityWrapper<UserSessionEntity>> entry)`
    `UserSessionPredicate` | `user(String user)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.function.Predicate

      `and, isEqual, negate, or`

- - ### Method Detail

    - #### create

          public static UserSessionPredicate create(String realm)

      Creates a user session predicate. If using the `client(java.lang.String)` method, see its warning.
      Parameters:
        `realm` -
      Returns:

    - #### user

          public UserSessionPredicate user(String user)

    - #### client

          public UserSessionPredicate client(String clientUUID)

      Adds a test for client. Note that this test can return stale sessions because on detaching client session from user session, only client session is deleted and user session is not updated for performance reason.
      Parameters:
        `clientUUID` -
      Returns:
      See Also:
        `AuthenticatedClientSessionAdapter.detachFromUserSession()`

    - #### expired

          public UserSessionPredicate expired(Integer expired,
                                              Integer expiredRefresh)

    - #### expired

          public UserSessionPredicate expired(Integer expired,
                                              Integer expiredRefresh,
                                              Integer expiredRememberMe,
                                              Integer expiredRefreshRememberMe)

    - #### brokerSessionId

          public UserSessionPredicate brokerSessionId(String id)

    - #### brokerUserId

          public UserSessionPredicate brokerUserId(String id)

    - #### test

          public boolean test(Map.Entry<String,SessionEntityWrapper<UserSessionEntity>> entry)

      Specified by:
        `test` in interface `Predicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>`

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