The event should also support user invalidation events
Closes #33777 Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
parent
9a3d81c23e
commit
f4f3a7de4a
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue