@Override public ProtocolMapperModel getProtocolMapperById(String id) { for (ProtocolMapperModel mapping : cached.getProtocolMappers()) { if (mapping.getId().equals(id)) return mapping; } return null; }
@Override public Map<String, String> getAttributes() { if (updated != null) return updated.getAttributes(); Map<String, String> copy = new HashMap<String, String>(); copy.putAll(cached.getAttributes()); return copy; }
@Override public RoleModel getRole(String name) { if (updated != null) return updated.getRole(name); String id = cached.getRoles().get(name); if (id == null) return null; return cacheSession.getRoleById(id, cachedRealm); }
@Override public ProtocolMapperModel getProtocolMapperByName(String protocol, String name) { for (ProtocolMapperModel mapping : cached.getProtocolMappers()) { if (mapping.getProtocol().equals(protocol) && mapping.getName().equals(name)) return mapping; } return null; }
public Set<RoleModel> getScopeMappings() { if (updated != null) return updated.getScopeMappings(); Set<RoleModel> roles = new HashSet<RoleModel>(); for (String id : cached.getScope()) { roles.add(cacheSession.getRoleById(id, getRealm())); } return roles; }
@Override public boolean hasScope(RoleModel role) { if (updated != null) return updated.hasScope(role); if (cached.isFullScopeAllowed() || cached.getScope().contains(role.getId())) return true; Set<RoleModel> roles = getScopeMappings(); for (RoleModel mapping : roles) { if (mapping.hasRole(role)) return true; } roles = getRoles(); if (roles.contains(role)) return true; for (RoleModel mapping : roles) { if (mapping.hasRole(role)) return true; } return false; }
@Override public Set<RoleModel> getRoles() { if (updated != null) return updated.getRoles(); Set<RoleModel> roles = new HashSet<RoleModel>(); for (String id : cached.getRoles().values()) { RoleModel roleById = cacheSession.getRoleById(id, cachedRealm); if (roleById == null) continue; roles.add(roleById); } return roles; }
@Override public boolean isImplicitFlowEnabled() { if (updated != null) return updated.isImplicitFlowEnabled(); return cached.isImplicitFlowEnabled(); }
@Override public boolean isStandardFlowEnabled() { if (updated != null) return updated.isStandardFlowEnabled(); return cached.isStandardFlowEnabled(); }
@Override public String getId() { if (updated != null) return updated.getId(); return cached.getId(); }
@Override public boolean isConsentRequired() { if (updated != null) return updated.isConsentRequired(); return cached.isConsentRequired(); }
public boolean isPublicClient() { if (updated != null) return updated.isPublicClient(); return cached.isPublicClient(); }
@Override public ClientTemplateModel getClientTemplate() { if (updated != null) return updated.getClientTemplate(); if (cached.getClientTemplate() == null) return null; return cacheSession.getClientTemplateById(cached.getClientTemplate(), cachedRealm); }
@Override public Map<String, Integer> getRegisteredNodes() { if (updated != null) return updated.getRegisteredNodes(); return cached.getRegisteredNodes(); }
public boolean isFrontchannelLogout() { if (updated != null) return updated.isPublicClient(); return cached.isFrontchannelLogout(); }
@Override public boolean isDirectAccessGrantsEnabled() { if (updated != null) return updated.isDirectAccessGrantsEnabled(); return cached.isDirectAccessGrantsEnabled(); }
@Override public boolean isFullScopeAllowed() { if (updated != null) return updated.isFullScopeAllowed(); return cached.isFullScopeAllowed(); }
@Override public Set<ProtocolMapperModel> getProtocolMappers() { if (updated != null) return updated.getProtocolMappers(); return cached.getProtocolMappers(); }
public int getNotBefore() { if (updated != null) return updated.getNotBefore(); return cached.getNotBefore(); }
@Override public String getAttribute(String name) { if (updated != null) return updated.getAttribute(name); return cached.getAttributes().get(name); }
@Override public boolean isServiceAccountsEnabled() { if (updated != null) return updated.isServiceAccountsEnabled(); return cached.isServiceAccountsEnabled(); }
@Override public String getDescription() { if (updated != null) return updated.getDescription(); return cached.getDescription(); }
public Set<String> getWebOrigins() { if (updated != null) return updated.getWebOrigins(); return cached.getWebOrigins(); }
@Override public boolean isSurrogateAuthRequired() { if (updated != null) return updated.isSurrogateAuthRequired(); return cached.isSurrogateAuthRequired(); }
@Override public int getNodeReRegistrationTimeout() { if (updated != null) return updated.getNodeReRegistrationTimeout(); return cached.getNodeReRegistrationTimeout(); }
@Override public String getManagementUrl() { if (updated != null) return updated.getManagementUrl(); return cached.getManagementUrl(); }
@Override public List<String> getDefaultRoles() { if (updated != null) return updated.getDefaultRoles(); return cached.getDefaultRoles(); }
@Override public boolean isBearerOnly() { if (updated != null) return updated.isBearerOnly(); return cached.isBearerOnly(); }
public Set<String> getRedirectUris() { if (updated != null) return updated.getRedirectUris(); return cached.getRedirectUris(); }
public String getRegistrationToken() { if (updated != null) return updated.getRegistrationToken(); return cached.getRegistrationToken(); }