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 class
UserSessionPredicate.ExternalizerImpl
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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)
String
getBrokerSessionId()
String
getBrokerUserId()
String
getUserId()
Returns the user id.boolean
test(Map.Entry<String,SessionEntityWrapper<UserSessionEntity>> entry)
UserSessionPredicate
user(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:
test
in interfacePredicate<Map.Entry<String,SessionEntityWrapper<UserSessionEntity>>>
-
-