@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ClientModel)) return false; ClientTemplateModel that = (ClientTemplateModel) o; return that.getId().equals(getId()); }
@Override public String getId() { if (updated != null) return updated.getId(); return cached.getId(); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof ClientTemplateModel)) return false; ClientTemplateModel that = (ClientTemplateModel) o; return that.getId().equals(getId()); }
@Override public ClientTemplateModel addClientTemplate(String id, String name) { getDelegateForUpdate(); ClientTemplateModel app = updated.addClientTemplate(id, name); cacheSession.registerClientTemplateInvalidation(app.getId()); return app; }
@Override public ClientTemplateModel addClientTemplate(String name) { getDelegateForUpdate(); ClientTemplateModel app = updated.addClientTemplate(name); cacheSession.registerClientTemplateInvalidation(app.getId()); return app; }
@Override public void setClientTemplate(ClientTemplateModel template) { if (template == null) { getMongoEntity().setClientTemplate(null); } else { getMongoEntity().setClientTemplate(template.getId()); } updateMongoEntity(); }
public static ClientTemplateRepresentation toRepresentation(ClientTemplateModel clientModel) { ClientTemplateRepresentation rep = new ClientTemplateRepresentation(); rep.setId(clientModel.getId()); rep.setName(clientModel.getName()); rep.setDescription(clientModel.getDescription()); rep.setProtocol(clientModel.getProtocol()); if (!clientModel.getProtocolMappers().isEmpty()) { List<ProtocolMapperRepresentation> mappings = new LinkedList<>(); for (ProtocolMapperModel model : clientModel.getProtocolMappers()) { mappings.add(toRepresentation(model)); } rep.setProtocolMappers(mappings); } rep.setFullScopeAllowed(clientModel.isFullScopeAllowed()); return rep; }
public CachedClientTemplate(RealmCache cache, RealmProvider delegate, RealmModel realm, ClientTemplateModel model) { id = model.getId(); name = model.getName(); description = model.getDescription(); this.realm = realm.getId(); protocol = model.getProtocol(); fullScopeAllowed = model.isFullScopeAllowed(); for (ProtocolMapperModel mapper : model.getProtocolMappers()) { this.protocolMappers.add(mapper); } for (RoleModel role : model.getScopeMappings()) { scope.add(role.getId()); } attributes.putAll(model.getAttributes()); frontchannelLogout = model.isFrontchannelLogout(); publicClient = model.isPublicClient(); bearerOnly = model.isBearerOnly(); consentRequired = model.isConsentRequired(); standardFlowEnabled = model.isStandardFlowEnabled(); implicitFlowEnabled = model.isImplicitFlowEnabled(); directAccessGrantsEnabled = model.isDirectAccessGrantsEnabled(); serviceAccountsEnabled = model.isServiceAccountsEnabled(); } public String getId() {
registeredNodes = new TreeMap<String, Integer>(model.getRegisteredNodes()); if (model.getClientTemplate() != null) { clientTemplate = model.getClientTemplate().getId();
clientTemplates.add(template.getId()); CachedClientTemplate cachedClient = new CachedClientTemplate(cache, delegate, model, template); cache.addCachedClientTemplate(cachedClient);