All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quorum.tessera.discovery.DiscoveryHelperFactory Maven / Gradle / Ivy

Go to download

Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution of private transactions for Quorum.

There is a newer version: 24.4.2
Show newest version
package com.quorum.tessera.discovery;

import com.quorum.tessera.enclave.Enclave;
import com.quorum.tessera.enclave.EnclaveFactory;
import com.quorum.tessera.encryption.PublicKey;
import com.quorum.tessera.partyinfo.node.NodeInfo;

import java.util.Set;

public class DiscoveryHelperFactory implements DiscoveryHelper {

    public static DiscoveryHelper provider() {
        NetworkStore networkStore = NetworkStore.getInstance();
        Enclave enclave = EnclaveFactory.create().enclave().get();

        return new DiscoveryHelperImpl(networkStore, enclave);
    }

    private final DiscoveryHelper discoveryHelper;

    public DiscoveryHelperFactory() {
        this(provider());
    }

    protected DiscoveryHelperFactory(DiscoveryHelper discoveryHelper) {
        this.discoveryHelper = discoveryHelper;
    }

    @Override
    public NodeInfo buildCurrent() {
        return discoveryHelper.buildCurrent();
    }

    @Override
    public void onCreate() {
        discoveryHelper.onCreate();
    }

    @Override
    public NodeInfo buildRemoteNodeInfo(PublicKey publicKey) {
        return discoveryHelper.buildRemoteNodeInfo(publicKey);
    }

    @Override
    public Set buildRemoteNodeInfos() {
        return discoveryHelper.buildRemoteNodeInfos();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy