Class UserSessionPredicate
- java.lang.Object
-
- org.keycloak.models.sessions.infinispan.stream.UserSessionPredicate
-
- All Implemented Interfaces:
Predicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>
@SerializeWith(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 Description static classUserSessionPredicate.ExternalizerImpl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UserSessionPredicatebrokerSessionId(String id)UserSessionPredicatebrokerUserId(String id)UserSessionPredicateclient(String clientUUID)Adds a test for client.static UserSessionPredicatecreate(String realm)Creates a user session predicate.UserSessionPredicateexpired(Integer expired, Integer expiredRefresh)UserSessionPredicateexpired(Integer expired, Integer expiredRefresh, Integer expiredRememberMe, Integer expiredRefreshRememberMe)StringgetBrokerSessionId()StringgetBrokerUserId()StringgetUserId()Returns the user id.booleantest(Map.Entry<String,SessionEntityWrapper<UserSessionEntity>> entry)UserSessionPredicateuser(String user)
-
-
-
Method Detail
-
create
public static UserSessionPredicate create(String realm)
Creates a user session predicate. If using theclient(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)
-
getUserId
public String getUserId()
Returns the user id.- Returns:
-
getBrokerSessionId
public String getBrokerSessionId()
-
getBrokerUserId
public String getBrokerUserId()
-
test
public boolean test(Map.Entry<String,SessionEntityWrapper<UserSessionEntity>> entry)
- Specified by:
testin interfacePredicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>
-
-