/** * Construct a {@link FlowConfigClient} to communicate with http flow config server at URI serverUri * @param restClient restClient to send restli request */ public FlowConfigClient(RestClient restClient) { LOG.debug("FlowConfigClient with restClient " + restClient); _httpClientFactory = Optional.absent(); _restClient = Optional.of(restClient); _flowconfigsRequestBuilders = new FlowconfigsRequestBuilders(); }
/** * Construct a {@link FlowConfigClient} to communicate with http flow config server at URI serverUri * @param serverUri address and port of the REST server */ public FlowConfigClient(String serverUri) { LOG.debug("FlowConfigClient with serverUri " + serverUri); _httpClientFactory = Optional.of(new HttpClientFactory()); Client r2Client = new TransportClientAdapter(_httpClientFactory.get().getClient(Collections.<String, String>emptyMap())); _restClient = Optional.of(new RestClient(r2Client, serverUri)); _flowconfigsRequestBuilders = new FlowconfigsRequestBuilders(); }