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

com.quorum.tessera.p2p.partyinfo.P2pClientProvider Maven / Gradle / Ivy

package com.quorum.tessera.p2p.partyinfo;

import com.quorum.tessera.config.Config;
import com.quorum.tessera.config.ConfigFactory;
import com.quorum.tessera.jaxrs.client.ClientFactory;
import com.quorum.tessera.partyinfo.P2pClient;
import com.quorum.tessera.ssl.context.ClientSSLContextFactory;
import com.quorum.tessera.ssl.context.SSLContextFactory;
import jakarta.ws.rs.client.Client;

public class P2pClientProvider {

  public static P2pClient provider() {
    Config config = ConfigFactory.create().getConfig();

    SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create();

    ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory);
    Client client = clientFactory.buildFrom(config.getP2PServerConfig());

    return new RestP2pClient(client);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy