Example usage for io.vertx.core.http HttpHeaders createOptimized

List of usage examples for io.vertx.core.http HttpHeaders createOptimized

Introduction

In this page you can find the example usage for io.vertx.core.http HttpHeaders createOptimized.

Prototype

public static CharSequence createOptimized(String value) 

Source Link

Document

Create an optimized CharSequence which can be used as header name or value.

Usage

From source file:org.hawkular.metrics.clients.ptrans.backend.MetricsSender.java

License:Apache License

public MetricsSender(Configuration configuration) {
    URI restUrl = configuration.getRestUrl();
    URI httpProxy = configuration.getHttpProxy();
    if (httpProxy == null) {
        host = restUrl.getHost();//  w ww . java2  s. co m
        port = restUrl.getPort();
        postUri = restUrl.getPath();
    } else {
        host = httpProxy.getHost();
        port = httpProxy.getPort();
        postUri = restUrl.toString();
    }
    hostHeader = HttpHeaders.createOptimized(restUrl.getHost());

    tenant = HttpHeaders.createOptimized(configuration.getTenant());

    buffer = new MetricBuffer(configuration.getBufferCapacity());
    batchSize = configuration.getBatchSize();
    maxConnections = configuration.getRestMaxConnections();
}