@@ -0,0 +1,2309 @@
+package won.node.protocol.impl;%0A%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.context.annotation.Primary;%0Aimport org.springframework.stereotype.Component;%0Aimport org.springframework.transaction.annotation.Transactional;%0Aimport won.cryptography.rdfsign.DefaultWebIdKeyLoader;%0Aimport won.cryptography.rdfsign.WebIdKeyLoader;%0Aimport won.cryptography.rdfsign.WonKeysReaderWriter;%0Aimport won.node.service.persistence.AtomService;%0Aimport won.protocol.model.Atom;%0A%0Aimport java.lang.invoke.MethodHandles;%0Aimport java.net.URI;%0Aimport java.security.NoSuchAlgorithmException;%0Aimport java.security.NoSuchProviderException;%0Aimport java.security.PublicKey;%0Aimport java.security.spec.InvalidKeySpecException;%0Aimport java.util.Map;%0Aimport java.util.Optional;%0Aimport java.util.Set;%0A%0Aimport static java.util.stream.Collectors.toSet;%0A%0A@Component%0A@Primary%0Apublic class DbBackedWebIdKeyLoader implements WebIdKeyLoader %7B%0A    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());%0A    WonKeysReaderWriter wonKeysReaderWriter = new WonKeysReaderWriter();%0A    @Autowired%0A    private DefaultWebIdKeyLoader defaultWebIdKeyLoader;%0A    @Autowired%0A    private AtomService atomService;%0A%0A    public DbBackedWebIdKeyLoader() %7B%0A    %7D%0A%0A    @Override%0A    @Transactional%0A    public Set%3CPublicKey%3E loadKey(String keyURI)%0A                    throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException %7B%0A        Set%3CPublicKey%3E keys = getKeyFromLocalAtom(keyURI);%0A        if (keys != null) %7B%0A            return keys;%0A        %7D%0A        return defaultWebIdKeyLoader.loadKey(keyURI);%0A    %7D%0A%0A    private Set%3CPublicKey%3E getKeyFromLocalAtom(String keyURI) %7B%0A        try %7B%0A            Optional%3CAtom%3E atomOpt = atomService.getAtom(URI.create(keyURI));%0A            if (atomOpt.isEmpty()) %7B%0A                return null;%0A            %7D%0A            Map%3CString, PublicKey%3E keys = wonKeysReaderWriter%0A                            .readFromDataset(atomOpt.get().getDatatsetHolder().getDataset());%0A            return keys.values().stream().collect(toSet());%0A        %7D catch (Exception e) %7B%0A            logger.debug(%22could not load key locally: %7B%7D%22, keyURI);%0A        %7D%0A        return null;%0A    %7D%0A%7D%0A

Add missing class