mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-25 16:42:34 +00:00
The event should also support user invalidation events
Closes #33777 Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
@@ -23,9 +23,10 @@ import org.infinispan.protostream.annotations.ProtoFactory;
|
||||
import org.infinispan.protostream.annotations.ProtoTypeId;
|
||||
import org.keycloak.marshalling.Marshalling;
|
||||
import org.keycloak.models.cache.infinispan.RealmCacheManager;
|
||||
import org.keycloak.models.cache.infinispan.UserCacheManager;
|
||||
|
||||
@ProtoTypeId(Marshalling.CACHE_KEY_INVALIDATION_EVENT)
|
||||
public class CacheKeyInvalidatedEvent extends InvalidationEvent implements RealmCacheInvalidationEvent {
|
||||
public class CacheKeyInvalidatedEvent extends InvalidationEvent implements RealmCacheInvalidationEvent, UserCacheInvalidationEvent {
|
||||
|
||||
@ProtoFactory
|
||||
public CacheKeyInvalidatedEvent(String id) {
|
||||
@@ -36,4 +37,9 @@ public class CacheKeyInvalidatedEvent extends InvalidationEvent implements Realm
|
||||
public void addInvalidations(RealmCacheManager realmCache, Set<String> invalidations) {
|
||||
realmCache.invalidateCacheKey(getId(), invalidations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInvalidations(UserCacheManager userCache, Set<String> invalidations) {
|
||||
userCache.invalidateCacheKey(getId(), invalidations);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user