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

com.quorum.tessera.discovery.Discovery 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.encryption.PublicKey;
import com.quorum.tessera.partyinfo.node.NodeInfo;

import java.net.URI;
import java.util.ServiceLoader;
import java.util.Set;

public interface Discovery {

    default void onCreate() {
        DiscoveryHelper discoveryHelper = DiscoveryHelper.getInstance();
        discoveryHelper.onCreate();
    }

    void onUpdate(NodeInfo nodeInfo);

    void onDisconnect(URI nodeUri);

    default NodeInfo getCurrent() {
        DiscoveryHelper discoveryHelper = DiscoveryHelper.getInstance();
        return discoveryHelper.buildCurrent();
    }

    default NodeInfo getRemoteNodeInfo(PublicKey publicKey) {
        DiscoveryHelper discoveryHelper = DiscoveryHelper.getInstance();
        return discoveryHelper.buildRemoteNodeInfo(publicKey);
    }

    default Set getRemoteNodeInfos() {
        DiscoveryHelper discoveryHelper = DiscoveryHelper.getInstance();
        return discoveryHelper.buildRemoteNodeInfos();
    }

    static Discovery getInstance() {
        return ServiceLoader.load(Discovery.class).findFirst().get();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy