class RestResendClientFactory implements ResendClientFactory {

    public ResendClient create(final Config config) {
        final String resendWaitTime =
                new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime();

        final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create();

        final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory);
        final Client client = clientFactory.buildFrom(config.getP2PServerConfig());

        client.property("jersey.config.client.readTimeout", resendWaitTime);
        return new RestResendClient(client);
    }

}