mirror of
https://github.com/keycloak/keycloak.git
synced 2026-02-11 01:39:01 -06:00
Remove redundant information from cache entries
Closes #37034 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
committed by
Pedro Igor
parent
757f46a75a
commit
7bcc2c4b28
@@ -12,19 +12,16 @@ import java.util.Set;
|
||||
public class ClientListQuery extends AbstractRevisioned implements ClientQuery {
|
||||
private final Set<String> clients;
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
|
||||
public ClientListQuery(Long revisioned, String id, RealmModel realm, Set<String> clients) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.clients = clients;
|
||||
}
|
||||
|
||||
public ClientListQuery(Long revisioned, String id, RealmModel realm, String client) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.clients = new HashSet<>();
|
||||
this.clients.add(client);
|
||||
}
|
||||
@@ -43,7 +40,7 @@ public class ClientListQuery extends AbstractRevisioned implements ClientQuery {
|
||||
public String toString() {
|
||||
return "ClientListQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
"realmName='" + realmName + '\'' +
|
||||
"realm='" + realm + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,13 +24,11 @@ import java.util.Set;
|
||||
public class ClientScopeListQuery extends AbstractRevisioned implements ClientScopeQuery {
|
||||
private final Set<String> clientScopes;
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
private String clientUuid;
|
||||
|
||||
public ClientScopeListQuery(Long revisioned, String id, RealmModel realm, Set<String> clientScopes) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.clientScopes = clientScopes;
|
||||
}
|
||||
|
||||
@@ -58,7 +56,7 @@ public class ClientScopeListQuery extends AbstractRevisioned implements ClientSc
|
||||
public String toString() {
|
||||
return "ClientScopeListQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
", realmName='" + realmName + '\'' +
|
||||
", realm='" + realm + '\'' +
|
||||
", clientUuid='" + clientUuid + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -14,13 +14,11 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class GroupListQuery extends AbstractRevisioned implements GroupQuery {
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
private final Map<String, Set<String>> searchKeys;
|
||||
|
||||
public GroupListQuery(Long revisioned, String id, RealmModel realm, String searchKey, Set<String> result) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.searchKeys = new HashMap<>();
|
||||
this.searchKeys.put(searchKey, result);
|
||||
}
|
||||
@@ -28,7 +26,6 @@ public class GroupListQuery extends AbstractRevisioned implements GroupQuery {
|
||||
public GroupListQuery(Long revisioned, String id, RealmModel realm, String searchKey, Set<String> result, GroupListQuery previous) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.searchKeys = new HashMap<>();
|
||||
this.searchKeys.putAll(previous.searchKeys);
|
||||
this.searchKeys.put(searchKey, result);
|
||||
@@ -37,7 +34,6 @@ public class GroupListQuery extends AbstractRevisioned implements GroupQuery {
|
||||
public GroupListQuery(Long revisioned, String id, RealmModel realm, Set<String> ids) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.searchKeys = new HashMap<>();
|
||||
this.searchKeys.put(id, ids);
|
||||
}
|
||||
@@ -66,7 +62,7 @@ public class GroupListQuery extends AbstractRevisioned implements GroupQuery {
|
||||
public String toString() {
|
||||
return "GroupListQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
"realmName='" + realmName + '\'' +
|
||||
"realm='" + realm + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,13 +21,11 @@ import org.keycloak.models.RealmModel;
|
||||
|
||||
public class GroupNameQuery extends AbstractRevisioned implements InRealm {
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
private final String groupId;
|
||||
|
||||
public GroupNameQuery(Long revisioned, String id, String groupId, RealmModel realm) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@@ -43,7 +41,7 @@ public class GroupNameQuery extends AbstractRevisioned implements InRealm {
|
||||
public String toString() {
|
||||
return "GroupNameQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
"realmName='" + realmName + '\'' +
|
||||
"realm='" + realm + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,13 +27,11 @@ import java.util.Set;
|
||||
public class RoleByNameQuery extends AbstractRevisioned implements RoleQuery, InClient {
|
||||
private final String role;
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
private String client;
|
||||
|
||||
public RoleByNameQuery(Long revisioned, String id, RealmModel realm, String role) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@@ -65,7 +63,7 @@ public class RoleByNameQuery extends AbstractRevisioned implements RoleQuery, In
|
||||
public String toString() {
|
||||
return "RoleNameQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
", realmName='" + realmName + '\'' +
|
||||
", realm='" + realm + '\'' +
|
||||
", clientUuid='" + client + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -12,20 +12,17 @@ import java.util.Set;
|
||||
public class RoleListQuery extends AbstractRevisioned implements RoleQuery, InClient {
|
||||
private final Set<String> roles;
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
private String client;
|
||||
|
||||
public RoleListQuery(Long revisioned, String id, RealmModel realm, Set<String> roles) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public RoleListQuery(Long revisioned, String id, RealmModel realm, String role) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.roles = new HashSet<>();
|
||||
this.roles.add(role);
|
||||
}
|
||||
@@ -59,7 +56,7 @@ public class RoleListQuery extends AbstractRevisioned implements RoleQuery, InCl
|
||||
public String toString() {
|
||||
return "RoleListQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
", realmName='" + realmName + '\'' +
|
||||
", realm='" + realm + '\'' +
|
||||
", clientUuid='" + client + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
@@ -12,19 +12,16 @@ import java.util.Set;
|
||||
public class UserListQuery extends AbstractRevisioned implements UserQuery {
|
||||
private final Set<String> users;
|
||||
private final String realm;
|
||||
private final String realmName;
|
||||
|
||||
public UserListQuery(Long revisioned, String id, RealmModel realm, Set<String> users) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
public UserListQuery(Long revisioned, String id, RealmModel realm, String user) {
|
||||
super(revisioned, id);
|
||||
this.realm = realm.getId();
|
||||
this.realmName = realm.getName();
|
||||
this.users = new HashSet<>();
|
||||
this.users.add(user);
|
||||
}
|
||||
@@ -43,7 +40,7 @@ public class UserListQuery extends AbstractRevisioned implements UserQuery {
|
||||
public String toString() {
|
||||
return "UserListQuery{" +
|
||||
"id='" + getId() + "'" +
|
||||
"realmName='" + realmName + '\'' +
|
||||
"realm='" + realm + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user