@Override protected void addDefaults(ClientModel client) { for (ProtocolMapperModel model : defaultBuiltins) client.addProtocolMapper(model); }
@Override public ProtocolMapperModel addProtocolMapper(ProtocolMapperModel model) { getDelegateForUpdate(); return updated.addProtocolMapper(model); }
@Override public ProtocolMapperModel addProtocolMapper(ProtocolMapperModel model) { getDelegateForUpdate(); return updated.addProtocolMapper(model); }
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); } } } }
adminConsoleClient.addProtocolMapper(localeMapper);
client.addProtocolMapper(toModel(mapper));