Tabnine Logo
CachedClientTemplate
Code IndexAdd Tabnine to your IDE (free)

How to use
CachedClientTemplate
in
org.keycloak.models.cache.entities

Best Java code snippets using org.keycloak.models.cache.entities.CachedClientTemplate (Showing top 16 results out of 315)

origin: org.keycloak/keycloak-invalidation-cache-infinispan

@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;
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public String getDescription() {
  if (updated != null) return updated.getDescription();
  return cached.getDescription();
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public void addCachedClientTemplate(CachedClientTemplate app) {
  if (!enabled) return;
  logger.tracev("Adding client template {0}", app.getId());
  cache.putForExternalRead(app.getId(), app);
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public ClientTemplateModel getClientTemplateById(String id, RealmModel realm) {
  if (!cache.isEnabled()) return getDelegate().getClientTemplateById(id, realm);
  CachedClientTemplate cached = cache.getClientTemplate(id);
  if (cached != null && !cached.getRealm().equals(realm.getId())) {
    cached = null;
  }
  if (cached == null) {
    ClientTemplateModel model = getDelegate().getClientTemplateById(id, realm);
    if (model == null) return null;
    if (clientTemplateInvalidations.contains(id)) return model;
    cached = new CachedClientTemplate(cache, getDelegate(), realm, model);
    cache.addCachedClientTemplate(cached);
  } else if (clientTemplateInvalidations.contains(id)) {
    return getDelegate().getClientTemplateById(id, realm);
  } else if (managedClientTemplates.containsKey(id)) {
    return managedClientTemplates.get(id);
  }
  ClientTemplateModel adapter = new ClientTemplateAdapter(realm, cached, this, cache);
  managedClientTemplates.put(id, adapter);
  return adapter;
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@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;
  }
  return false;
}
origin: org.keycloak/keycloak-invalidation-cache-model

CachedClientTemplate cachedClient = new CachedClientTemplate(cache, delegate, model, template);
cache.addCachedClientTemplate(cachedClient);
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public Set<ProtocolMapperModel> getProtocolMappers() {
  if (updated != null) return updated.getProtocolMappers();
  return cached.getProtocolMappers();
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public String getName() {
  if (updated != null) return updated.getName();
  return cached.getName();
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public String getProtocol() {
  if (updated != null) return updated.getProtocol();
  return cached.getProtocol();
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public boolean isBearerOnly() {
  if (updated != null) return updated.isBearerOnly();
  return cached.isBearerOnly();
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

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;
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public ProtocolMapperModel getProtocolMapperById(String id) {
  for (ProtocolMapperModel mapping : cached.getProtocolMappers()) {
    if (mapping.getId().equals(id)) return mapping;
  }
  return null;
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public void invalidateClientTemplate(CachedClientTemplate app) {
  logger.tracev("Removing client template {0}", app.getId());
  cache.remove(app.getId());
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@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;
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public String getAttribute(String name) {
  if (updated != null) return updated.getAttribute(name);
  return cached.getAttributes().get(name);
}
origin: org.keycloak/keycloak-invalidation-cache-infinispan

@Override
public String getId() {
  if (updated != null) return updated.getId();
  return cached.getId();
}
org.keycloak.models.cache.entitiesCachedClientTemplate

Most used methods

  • <init>
  • getAttributes
  • getDescription
  • getId
  • getName
  • getProtocol
  • getProtocolMappers
  • getRealm
  • getScope
  • isBearerOnly
  • isConsentRequired
  • isDirectAccessGrantsEnabled
  • isConsentRequired,
  • isDirectAccessGrantsEnabled,
  • isFrontchannelLogout,
  • isFullScopeAllowed,
  • isImplicitFlowEnabled,
  • isPublicClient,
  • isServiceAccountsEnabled,
  • isStandardFlowEnabled

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Table (org.hibernate.mapping)
    A relational table
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now