Example usage for io.vertx.core.net NetClientOptions NetClientOptions

List of usage examples for io.vertx.core.net NetClientOptions NetClientOptions

Introduction

In this page you can find the example usage for io.vertx.core.net NetClientOptions NetClientOptions.

Prototype

public NetClientOptions(JsonObject json) 

Source Link

Document

Create options from JSON

Usage

From source file:io.reactiverse.pgclient.impl.PgConnectionFactory.java

License:Apache License

public PgConnectionFactory(Context context, boolean registerCloseHook, PgConnectOptions options) {

    hook = this::close;
    this.registerCloseHook = registerCloseHook;

    ctx = context;/*from   ww w .java  2 s . c om*/
    if (registerCloseHook) {
        ctx.addCloseHook(hook);
    }

    NetClientOptions netClientOptions = new NetClientOptions(options);

    // Make sure ssl=false as we will use STARTLS
    netClientOptions.setSsl(false);

    this.sslMode = options.getSslMode();
    this.hostnameVerificationAlgorithm = netClientOptions.getHostnameVerificationAlgorithm();
    this.trustOptions = netClientOptions.getTrustOptions();
    this.host = options.getHost();
    this.port = options.getPort();
    this.database = options.getDatabase();
    this.username = options.getUser();
    this.password = options.getPassword();
    this.cachePreparedStatements = options.getCachePreparedStatements();
    this.pipeliningLimit = options.getPipeliningLimit();
    this.isUsingDomainSocket = options.isUsingDomainSocket();

    this.client = context.owner().createNetClient(netClientOptions);
}