Build a new Jersey Client that is instrumented for Zipkin

@param configuration Configuration to use for the client
@return new Jersey Client
519528
public Client build(final ZipkinClientConfiguration configuration) {
    final Client client =
        new JerseyClientBuilder(environment)
            .using(configuration)
            .build(configuration.getServiceName());
    return build(client);
  }
1278972
public JestClient createClient(Map<String, String> config, String defaultIndexName) {
        JestClient client;
        String indexName = config.get("client.index"); //$NON-NLS-1$
        if (indexName == null) {
            indexName = defaultIndexName;
        }
        client = createLocalClient(config, indexName, defaultIndexName);
        return client;
    }
907331
public static ConfigBuilder configure(Job job) {
    job.setInputFormatClass(DatasetKeyInputFormat.class);
    Configuration conf = Hadoop.JobContext.getConfiguration.invoke(job);
    return new ConfigBuilder(conf);
  }
660926
@SuppressWarnings("unchecked")
  public static <T> T newInstance(Class<T> theClass, Configuration conf) {
    return newInstance(theClass, conf, true);
  }
180087
private SocketStoreClientFactory getFatClientFactory(String[] bootstrapURLs,
                                                         Properties configProps) {

        ClientConfig fatClientConfig = new ClientConfig(configProps);
        logger.info("Using config: " + fatClientConfig);
        fatClientConfig.setBootstrapUrls(bootstrapURLs)
                       .setEnableCompressionLayer(false)
                       .setEnableSerializationLayer(false)
                       .enableDefaultClient(true)
                       .setEnableLazy(false);

        return new SocketStoreClientFactory(fatClientConfig);
    }
587280
public <K, V> CacheProxy<K, V> createCache(String cacheName, Configuration<K, V> configuration) {
    CaffeineConfiguration<K, V> config = resolveConfigurationFor(configuration);
    return new Builder<>(cacheName, config).build();
  }
1205537
public static HttpClientContext newClientContext(HttpClientSettings settings,
                                                     Map<String, ? extends Object>
                                                             attributes) {
        final HttpClientContext clientContext = new HttpClientContext();

        if (attributes != null && !attributes.isEmpty()) {
            for (Map.Entry<String, ?> entry : attributes.entrySet()) {
                clientContext.setAttribute(entry.getKey(), entry.getValue());
            }
        }

        addPreemptiveAuthenticationProxy(clientContext, settings);

        clientContext.setAttribute(HttpContextUtils.DISABLE_SOCKET_PROXY_PROPERTY, settings.disableSocketProxy());
        return clientContext;

    }
1346381
public JerseyClientBuilder using(ExecutorService executorService, ObjectMapper objectMapper) {
        this.executorService = executorService;
        this.objectMapper = objectMapper;
        return this;
    }
1144925
private Configuration buildVersionConfig() {

        // Inject the library version
        String jersey2ToolkitVersion = Jersey2ToolkitConfig.class
                .getPackage().getImplementationVersion();

        HashMap<String, Object> versionConfigMap = new HashMap<>();
        versionConfigMap.put("jersey2-toolkit.version", jersey2ToolkitVersion);

        return new MapConfiguration(versionConfigMap);
    }
911800
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public JIRAConfiguration newConfiguration(@RequestBody JIRAConfiguration configuration) {
        return jiraConfigurationService.newConfiguration(configuration);
    }
626332
public ConfigurationProvider build() {
    LOG.info("Initializing ConfigurationProvider with "
        + configurationSource.getClass().getCanonicalName() + " source, "
        + reloadStrategy.getClass().getCanonicalName() + " reload strategy and "
        + environment.getClass().getCanonicalName() + " environment");

    final CachedConfigurationSource cachedConfigurationSource = new CachedConfigurationSource(configurationSource);
    if (metricRegistry != null) {
      configurationSource = new MeteredConfigurationSource(metricRegistry, prefix, cachedConfigurationSource);
    }
    cachedConfigurationSource.init();

    Reloadable reloadable = () -> cachedConfigurationSource.reload(environment);

    if (metricRegistry != null) {
      reloadable = new MeteredReloadable(metricRegistry, prefix, reloadable);
    }
    reloadable.reload();
    reloadStrategy.register(reloadable);

    SimpleConfigurationProvider configurationProvider = new SimpleConfigurationProvider(cachedConfigurationSource, environment);
    if (metricRegistry != null) {
      return new MeteredConfigurationProvider(metricRegistry, prefix, configurationProvider);
    }

    return configurationProvider;
  }
1131474
public HTTPClientConfiguration createHTTPClientConfiguration(ConfigurationHolder configurationHolder)
    {
        //get server values
        String hostName=configurationHolder.getConfigurationValue(HTTPClientConfigurationConstants.HOST_NAME_PROPERTY_KEY);
        if(hostName==null)
        {
            throw new FaxException("Host name not defined in property: "+HTTPClientConfigurationConstants.HOST_NAME_PROPERTY_KEY);
        }
        String value=configurationHolder.getConfigurationValue(HTTPClientConfigurationConstants.PORT_PROPERTY_KEY);
        if(value==null)
        {
            value=String.valueOf(-1);
        }
        int port=Integer.parseInt(value);
        boolean ssl=Boolean.parseBoolean(configurationHolder.getConfigurationValue(HTTPClientConfigurationConstants.SSL_PROPERTY_KEY));
        
        //create configuration
        CommonHTTPClientConfiguration configuration=new CommonHTTPClientConfiguration();
        
        //set values
        configuration.setHostName(hostName);
        configuration.setPort(port);
        configuration.setSSL(ssl);

        //set methods
        Enum<?>[] methodProperties=new Enum<?>[]{HTTPClientConfigurationConstants.SUBMIT_HTTP_METHOD_PROPERTY_KEY,
                                                 HTTPClientConfigurationConstants.SUSPEND_HTTP_METHOD_PROPERTY_KEY,
                                                 HTTPClientConfigurationConstants.RESUME_HTTP_METHOD_PROPERTY_KEY,
                                                 HTTPClientConfigurationConstants.CANCEL_HTTP_METHOD_PROPERTY_KEY,
                                                 HTTPClientConfigurationConstants.GET_STATUS_HTTP_METHOD_PROPERTY_KEY};
        FaxActionType[] faxActionTypes=new FaxActionType[]{FaxActionType.SUBMIT_FAX_JOB,
                                                           FaxActionType.SUSPEND_FAX_JOB,
                                                           FaxActionType.RESUME_FAX_JOB,
                                                           FaxActionType.CANCEL_FAX_JOB,
                                                           FaxActionType.GET_FAX_JOB_STATUS};
        HTTPMethod httpMethod=null;
        for(int index=0;index<methodProperties.length;index++)
        {
            //set next method
            value=configurationHolder.getConfigurationValue(methodProperties[index]);
            httpMethod=HTTPMethod.POST;
            if(value!=null)
            {
                httpMethod=HTTPMethod.valueOf(value);
            }
            configuration.setMethod(faxActionTypes[index],httpMethod);
        }

        return configuration;
    }
932938
private static Mono<Void> addConfigurations(ConfigurationAsyncClient client, String configurationSet,
                                                String storageEndpoint, ComplexConfiguration complexConfiguration) throws JsonProcessingException {
        ConfigurationSetting endpointSetting = new ConfigurationSetting()
            .key(CONNECTION_STRING_KEY)
            .label(configurationSet)
            .value(storageEndpoint);
        ConfigurationSetting keyVaultSetting = new ConfigurationSetting()
            .key(COMPLEX_SETTING_KEY)
            .label(configurationSet)
            .value(MAPPER.writeValueAsString(complexConfiguration))
            .contentType("application/json");

        return Flux.merge(client.addSetting(keyVaultSetting), client.addSetting(endpointSetting)).then();
    }
777108
@SneakyThrows
    public static ClientConfiguration buildClientConfiguration(final BaseAmazonWebServicesProperties props) {
        val cfg = new ClientConfiguration();
        cfg.setConnectionTimeout(props.getConnectionTimeout());
        cfg.setMaxConnections(props.getMaxConnections());
        cfg.setRequestTimeout(props.getRequestTimeout());
        cfg.setSocketTimeout(props.getSocketTimeout());
        cfg.setUseGzip(props.isUseGzip());
        cfg.setUseReaper(props.isUseReaper());
        cfg.setUseThrottleRetries(props.isUseThrottleRetries());
        cfg.setUseTcpKeepAlive(props.isUseTcpKeepAlive());
        cfg.setProtocol(Protocol.valueOf(props.getProtocol().toUpperCase()));
        cfg.setClientExecutionTimeout(props.getClientExecutionTimeout());
        if (props.getMaxErrorRetry() > 0) {
            cfg.setMaxErrorRetry(props.getMaxErrorRetry());
        }
        cfg.setProxyHost(props.getProxyHost());
        cfg.setProxyPassword(props.getProxyPassword());
        if (props.getProxyPort() > 0) {
            cfg.setProxyPort(props.getProxyPort());
        }
        cfg.setProxyUsername(props.getProxyUsername());
        cfg.setCacheResponseMetadata(props.isCacheResponseMetadata());

        if (StringUtils.isNotBlank(props.getLocalAddress())) {
            LOGGER.trace("Creating DynamoDb client local address [{}]", props.getLocalAddress());
            cfg.setLocalAddress(InetAddress.getByName(props.getLocalAddress()));
        }

        return cfg;
    }
841520
public ReplicationClientFactory usingApiKey(String apiKey) {
        if (Objects.equal(_apiKey, apiKey)) {
            return this;
        }
        return new ReplicationClientFactory(_jerseyClient, apiKey);
    }
793498
public static ComponentFactory create(InputStream configuration) {
    ComponentFactory factory = null;
    factory = new ComponentFactory(LanguageConfigurationUtil.get(configuration));
    return factory;
  }
892452
@RequestMapping(value = "configurations/create", method = RequestMethod.POST)
    public SVNConfiguration newConfiguration(@RequestBody SVNConfiguration configuration) {
        return svnConfigurationService.newConfiguration(configuration);
    }