@Override public int getAccessCodeLifespan() { if (updated != null) return updated.getAccessCodeLifespan(); return cached.getAccessCodeLifespan(); }
@Override public int getAccessCodeLifespanLogin() { if (updated != null) return updated.getAccessCodeLifespanLogin(); return cached.getAccessCodeLifespanLogin(); }
@Override public int getAccessCodeLifespanUserAction() { if (updated != null) return updated.getAccessCodeLifespanUserAction(); return cached.getAccessCodeLifespanUserAction(); }
@Override public RealmModel getRealmByName(String name) { if (!cache.isEnabled()) return getDelegate().getRealmByName(name); CachedRealm cached = cache.getCachedRealmByName(name); if (cached == null) { RealmModel model = getDelegate().getRealmByName(name); if (model == null) return null; if (realmInvalidations.contains(model.getId())) return model; cached = new CachedRealm(cache, this, model); cache.addCachedRealm(cached); } else if (realmInvalidations.contains(cached.getId())) { return getDelegate().getRealmByName(name); } else if (managedRealms.containsKey(cached.getId())) { return managedRealms.get(cached.getId()); } RealmAdapter adapter = new RealmAdapter(cached, this); managedRealms.put(cached.getId(), adapter); return adapter; }
@Override public List<AuthenticationFlowModel> getAuthenticationFlows() { if (updated != null) return updated.getAuthenticationFlows(); List<AuthenticationFlowModel> models = new ArrayList<>(); models.addAll(cached.getAuthenticationFlows().values()); return models; }
@Override public String getAccountTheme() { if (updated != null) return updated.getAccountTheme(); return cached.getAccountTheme(); }
@Override public String getAdminTheme() { if (updated != null) return updated.getAdminTheme(); return cached.getAdminTheme(); }
@Override public int getAccessTokenLifespan() { if (updated != null) return updated.getAccessTokenLifespan(); return cached.getAccessTokenLifespan(); }
@Override public int getAccessTokenLifespanForImplicitFlow() { if (updated != null) return updated.getAccessTokenLifespanForImplicitFlow(); return cached.getAccessTokenLifespanForImplicitFlow(); }
@Override public List<AuthenticationExecutionModel> getAuthenticationExecutions(String flowId) { if (updated != null) return updated.getAuthenticationExecutions(flowId); return cached.getAuthenticationExecutions().get(flowId); }
@Override public RealmModel getRealm(String id) { if (!cache.isEnabled()) return getDelegate().getRealm(id); CachedRealm cached = cache.getCachedRealm(id); if (cached == null) { RealmModel model = getDelegate().getRealm(id); if (model == null) return null; if (realmInvalidations.contains(id)) return model; cached = new CachedRealm(cache, this, model); cache.addCachedRealm(cached); } else if (realmInvalidations.contains(id)) { return getDelegate().getRealm(id); } else if (managedRealms.containsKey(id)) { return managedRealms.get(id); } RealmAdapter adapter = new RealmAdapter(cached, this); managedRealms.put(id, adapter); return adapter; }
@Override public AuthenticationFlowModel getAuthenticationFlowById(String id) { if (updated != null) return updated.getAuthenticationFlowById(id); return cached.getAuthenticationFlows().get(id); }