class DisabledAutoDiscovery implements Discovery {

    @Override
    public void onUpdate(NodeInfo nodeInfo) {

        if(!knownPeers.contains(NodeUri.create(nodeInfo.getUrl()))) {
            throw new AutoDiscoveryDisabledException(String.format("%s is not a known peer", nodeInfo.getUrl()));
        }

        final NodeUri callerNodeUri = NodeUri.create(nodeInfo.getUrl());

        final Set<PublicKey> keys = nodeInfo.getRecipients().stream()
            .filter(r -> NodeUri.create(r.getUrl()).equals(callerNodeUri))
            .map(Recipient::getKey)
            .collect(Collectors.toSet());

        final ActiveNode activeNode = ActiveNode.Builder.create()
            .withUri(callerNodeUri)
            .withSupportedVersions(nodeInfo.supportedApiVersions())
            .withKeys(keys)
            .build();

        networkStore.store(activeNode);

    }

    public  DisabledAutoDiscovery(NetworkStore networkStore,Set<NodeUri> knownPeers);

}