From acf2d662c2d7356933da092269aa9d6c4dd41213 Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Wed, 17 Feb 2016 16:09:25 -0500 Subject: [PATCH] remove RealmModel.getClientNameMap() --- .../infinispan/InfinispanCacheRealmProviderFactory.java | 2 +- .../org/keycloak/models/cache/infinispan/RealmAdapter.java | 2 +- .../locking/LockingCacheRealmProviderFactory.java | 2 +- .../infinispan/locking/entities/RevisionedCachedRealm.java | 2 +- .../org/keycloak/models/cache/entities/CachedRealm.java | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java index ac8f3734fd..34aa5ced85 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java @@ -141,7 +141,7 @@ public class InfinispanCacheRealmProviderFactory implements CacheRealmProviderFa realmCache.evictRoleById(r); } - for (String c : realm.getClients().values()) { + for (String c : realm.getClients()) { realmCache.evictClientById(c); } diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java index 690d2fe429..2f3048ad31 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/RealmAdapter.java @@ -591,7 +591,7 @@ public class RealmAdapter implements RealmModel { public List getClients() { if (updated != null) return updated.getClients(); List apps = new LinkedList<>(); - for (String id : cached.getClients().values()) { + for (String id : cached.getClients()) { ClientModel model = cacheSession.getClientById(id, this); if (model == null) { throw new IllegalStateException("Cached application not found: " + id); diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/LockingCacheRealmProviderFactory.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/LockingCacheRealmProviderFactory.java index 23f8e53bba..d2bfbf4389 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/LockingCacheRealmProviderFactory.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/LockingCacheRealmProviderFactory.java @@ -138,7 +138,7 @@ public class LockingCacheRealmProviderFactory implements CacheRealmProviderFacto realmCache.evictRoleById(r); } - for (String c : realm.getClients().values()) { + for (String c : realm.getClients()) { realmCache.evictClientById(c); } diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/entities/RevisionedCachedRealm.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/entities/RevisionedCachedRealm.java index 2b3a524386..c4fd4870dd 100755 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/entities/RevisionedCachedRealm.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/locking/entities/RevisionedCachedRealm.java @@ -42,7 +42,7 @@ public class RevisionedCachedRealm extends CachedRealm implements Revisioned { @Override protected void cacheClients(RealmCache cache, RealmProvider delegate, RealmModel model) { for (ClientModel client : model.getClients()) { - clients.put(client.getClientId(), client.getId()); + clients.add(client.getId()); } } diff --git a/server-spi/src/main/java/org/keycloak/models/cache/entities/CachedRealm.java b/server-spi/src/main/java/org/keycloak/models/cache/entities/CachedRealm.java index ad2ba6a397..a037d0549b 100755 --- a/server-spi/src/main/java/org/keycloak/models/cache/entities/CachedRealm.java +++ b/server-spi/src/main/java/org/keycloak/models/cache/entities/CachedRealm.java @@ -147,7 +147,7 @@ public class CachedRealm implements Serializable { protected List defaultGroups = new LinkedList(); protected Set groups = new HashSet(); protected Map realmRoles = new HashMap(); - protected Map clients = new HashMap(); + protected List clients = new LinkedList<>(); protected List clientTemplates= new LinkedList<>(); protected boolean internationalizationEnabled; protected Set supportedLocales; @@ -296,7 +296,7 @@ public class CachedRealm implements Serializable { protected void cacheClients(RealmCache cache, RealmProvider delegate, RealmModel model) { for (ClientModel client : model.getClients()) { - clients.put(client.getClientId(), client.getId()); + clients.add(client.getId()); CachedClient cachedClient = new CachedClient(cache, delegate, model, client); cache.addClient(cachedClient); } @@ -339,7 +339,7 @@ public class CachedRealm implements Serializable { return realmRoles; } - public Map getClients() { + public List getClients() { return clients; }