Search in sources :

Example 1 with UserSessionPredicate

use of org.keycloak.models.sessions.infinispan.stream.UserSessionPredicate in project keycloak by keycloak.

the class InfinispanUserSessionProvider method getUserSessionsStream.

protected Stream<UserSessionModel> getUserSessionsStream(final RealmModel realm, ClientModel client, Integer firstResult, Integer maxResults, final boolean offline) {
    if (offline && loadOfflineSessionsFromDatabase) {
        // fetch the actual offline user session count from the database
        UserSessionPersisterProvider persister = session.getProvider(UserSessionPersisterProvider.class);
        return persister.loadUserSessionsStream(realm, client, true, firstResult, maxResults);
    }
    final String clientUuid = client.getId();
    UserSessionPredicate predicate = UserSessionPredicate.create(realm.getId()).client(clientUuid);
    return getUserSessionModels(realm, firstResult, maxResults, offline, predicate);
}
Also used : UserSessionPersisterProvider(org.keycloak.models.session.UserSessionPersisterProvider) UserSessionPredicate(org.keycloak.models.sessions.infinispan.stream.UserSessionPredicate)

Aggregations

UserSessionPersisterProvider (org.keycloak.models.session.UserSessionPersisterProvider)1 UserSessionPredicate (org.keycloak.models.sessions.infinispan.stream.UserSessionPredicate)1