class ClientFactory implements RestClientFactory {

    public Client buildFrom(final ServerConfig config) {

        final ClientBuilder clientBuilder = ClientBuilder.newBuilder();

        final long pollInterval = new IntervalPropertyHelper(config.getProperties()).partyInfoInterval();
        final long timeout = Math.round(Math.ceil(pollInterval * 0.75));
        clientBuilder.connectTimeout(timeout, TimeUnit.MILLISECONDS);
        clientBuilder.readTimeout(timeout, TimeUnit.MILLISECONDS);
        clientBuilder.register(VersionHeaderDecorator.class);

        if (config.isUnixSocket()) {
            Configuration clientConfig = createUnixServerSocketConfig();
            URI unixfile = config.getServerUri();
            return ClientBuilder.newClient(clientConfig).property("unixfile", unixfile);

        } else if (config.isSsl()) {
            final SSLContext sslContext =
                    sslContextFactory.from(config.getServerUri().toString(), config.getSslConfig());
            return clientBuilder.sslContext(sslContext).build();
        } else {
            return clientBuilder.build();
        }
    }

    public  ClientFactory(final SSLContextFactory sslContextFactory);
    public  ClientFactory();

}