/** * Constructor. */ @SuppressWarnings("nls") public HawkularMetricsAccessor(Map<String, String> config) { String endpoint = config.get("hawkular.endpoint"); Map<String, String> httpOptions = new HashMap<>(); httpOptions.put("http.timeouts.read", config.get("http.timeouts.read")); httpOptions.put("http.timeouts.write", config.get("http.timeouts.write")); httpOptions.put("http.timeouts.connect", config.get("http.timeouts.connect")); httpOptions.put("http.followRedirects", config.get("http.followRedirects")); client = new HawkularMetricsClient(endpoint, new HttpConnectorOptions(httpOptions)); }
/** * Constructor. * @param config */ @SuppressWarnings("nls") public HawkularMetrics(Map<String, String> config) { String endpoint = config.get("hawkular.endpoint"); if (endpoint == null) { throw new RuntimeException("Missing configuration property: apiman-gateway.metrics.hawkular.endpoint"); } Map<String, String> httpOptions = new HashMap<>(); httpOptions.put("http.timeouts.read", config.get("http.timeouts.read")); httpOptions.put("http.timeouts.write", config.get("http.timeouts.write")); httpOptions.put("http.timeouts.connect", config.get("http.timeouts.connect")); httpOptions.put("http.followRedirects", config.get("http.followRedirects")); client = new HawkularMetricsClient(endpoint, new HttpConnectorOptions(httpOptions)); int queueSize = DEFAULT_QUEUE_SIZE; String queueSizeConfig = config.get("hawkular.queueSize"); if (queueSizeConfig != null) { queueSize = new Integer(queueSizeConfig); } queue = new LinkedBlockingDeque<>(queueSize); startConsumerThread(); }
/** * Constructor. * @param config */ @SuppressWarnings("nls") public HawkularMetrics(Map<String, String> config) { String endpoint = config.get("hawkular.endpoint"); if (endpoint == null) { throw new RuntimeException("Missing configuration property: apiman-gateway.metrics.hawkular.endpoint"); } Map<String, String> httpOptions = new HashMap<>(); httpOptions.put("http.timeouts.read", config.get("http.timeouts.read")); httpOptions.put("http.timeouts.write", config.get("http.timeouts.write")); httpOptions.put("http.timeouts.connect", config.get("http.timeouts.connect")); httpOptions.put("http.followRedirects", config.get("http.followRedirects")); client = new HawkularMetricsClient(endpoint, new HttpConnectorOptions(httpOptions)); int queueSize = DEFAULT_QUEUE_SIZE; String queueSizeConfig = config.get("hawkular.queueSize"); if (queueSizeConfig != null) { queueSize = new Integer(queueSizeConfig); } queue = new LinkedBlockingDeque<>(queueSize); startConsumerThread(); }
/** * Constructor. * @param config map of configuration options */ public HttpConnectorFactory(Map<String, String> config) { this.tlsOptions = new TLSOptions(config); this.connectorOptions = new HttpConnectorOptions(config); this.okClient = createHttpClient(); }
/** * Constructor. * @param config map of configuration options */ public HttpConnectorFactory(Map<String, String> config) { this.tlsOptions = new TLSOptions(config); this.connectorOptions = new HttpConnectorOptions(config); this.okClient = createHttpClient(); }