Search in sources :

Example 1 with UserFullInvalidationEvent

use of org.keycloak.models.cache.infinispan.events.UserFullInvalidationEvent in project keycloak by keycloak.

the class UserCacheSession method fullyInvalidateUser.

// just in case the transaction is rolled back you need to invalidate the user and all cache queries for that user
protected void fullyInvalidateUser(RealmModel realm, UserModel user) {
    Stream<FederatedIdentityModel> federatedIdentities = realm.isIdentityFederationEnabled() ? getFederatedIdentitiesStream(realm, user) : Stream.empty();
    UserFullInvalidationEvent event = UserFullInvalidationEvent.create(user.getId(), user.getUsername(), user.getEmail(), realm.getId(), realm.isIdentityFederationEnabled(), federatedIdentities);
    cache.fullUserInvalidation(user.getId(), user.getUsername(), user.getEmail(), realm.getId(), realm.isIdentityFederationEnabled(), event.getFederatedIdentities(), invalidations);
    invalidationEvents.add(event);
}
Also used : UserFullInvalidationEvent(org.keycloak.models.cache.infinispan.events.UserFullInvalidationEvent) FederatedIdentityModel(org.keycloak.models.FederatedIdentityModel)

Aggregations

FederatedIdentityModel (org.keycloak.models.FederatedIdentityModel)1 UserFullInvalidationEvent (org.keycloak.models.cache.infinispan.events.UserFullInvalidationEvent)1