@Override public Set<ProtocolMapperModel> getProtocolMappers() { if (updated != null) return updated.getProtocolMappers(); return cached.getProtocolMappers(); }
private void updateClientRepWithProtocolMappers(ClientModel clientModel, ClientRepresentation rep) { List<ProtocolMapperRepresentation> mappings = new LinkedList<>(); for (ProtocolMapperModel model : clientModel.getProtocolMappers()) { mappings.add(ModelToRepresentation.toRepresentation(model)); } rep.setProtocolMappers(mappings); }
@Override public Set<ProtocolMapperModel> getProtocolMappers() { if (isUpdated()) return updated.getProtocolMappers(); return cached.getProtocolMappers(); }
private void updatePairwiseSubMappers(ClientModel clientModel, SubjectType subjectType, String sectorIdentifierUri) { Set<ProtocolMapperModel> protocolMappers = clientModel.getProtocolMappers(); if (subjectType == SubjectType.PAIRWISE) { // See if we have existing pairwise mapper and update it. Otherwise // create new AtomicBoolean foundPairwise = new AtomicBoolean(false); for (ProtocolMapperModel mapping : protocolMappers) { if (mapping.getProtocolMapper().endsWith(AbstractPairwiseSubMapper.PROVIDER_ID_SUFFIX)) { foundPairwise.set(true); PairwiseSubMapperHelper.setSectorIdentifierUri(mapping, sectorIdentifierUri); clientModel.updateProtocolMapper(mapping); } } // We don't have existing pairwise mapper. So create new if (!foundPairwise.get()) { ProtocolMapperRepresentation newPairwise = SHA256PairwiseSubMapper .createPairwiseMapper(sectorIdentifierUri, null); clientModel.addProtocolMapper(RepresentationToModel.toModel(newPairwise)); } } else { // Rather find and remove all pairwise mappers for (ProtocolMapperModel mapping : protocolMappers) { if (mapping.getProtocolMapper().endsWith(AbstractPairwiseSubMapper.PROVIDER_ID_SUFFIX)) { protocolMappers.remove(mapping); } } } }
scope.add(role.getId()); for (ProtocolMapperModel mapper : model.getProtocolMappers()) { this.protocolMappers.add(mapper);
scope.add(role.getId()); for (ProtocolMapperModel mapper : model.getProtocolMappers()) { this.protocolMappers.add(mapper);
if (!clientModel.getProtocolMappers().isEmpty()) { List<ProtocolMapperRepresentation> mappings = new LinkedList<>(); for (ProtocolMapperModel model : clientModel.getProtocolMappers()) { mappings.add(toRepresentation(model));
Set<ProtocolMapperModel> mappers = client.getProtocolMappers(); for (ProtocolMapperModel mapper : mappers) client.removeProtocolMapper(mapper);