Examples of connectorProvider()


Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

                //                register(singleThreadPool, RequestExecutorProvider.class).
                property(ClientProperties.ASYNC_THREADPOOL_SIZE, 20);
        if (configuration != null)
            config.loadFrom(configuration);
        if (config.getConnectorProvider() == null)
            config.connectorProvider(new JettyConnectorProvider());
        return config;
    }

    @Override
    public Client build() {
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

                register(singleThreadPool, RequestExecutorProvider.class).
                property(ClientProperties.ASYNC_THREADPOOL_SIZE, 20);
        if (configuration != null)
            config.loadFrom(configuration);
        if (config.getConnectorProvider() == null)
            config.connectorProvider(new JettyConnectorProvider());

        return new FiberClient(ClientBuilder.newClient(config));
    }

    @Override
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

  public ParaClient(String accessKey, String secretKey) {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.register(GenericExceptionMapper.class);
    clientConfig.register(new JacksonJsonProvider(Utils.getJsonMapper()));
    clientConfig.connectorProvider(new JettyConnectorProvider());
    this.client = ClientBuilder.newClient(clientConfig);
    this.accessKey = accessKey;
    this.secretKey = secretKey;
  }
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

        clientConfig.register(makeGZipFeature());
        clientConfig.property(ClientProperties.ASYNC_THREADPOOL_SIZE, maxConnections);
        clientConfig.property(ClientProperties.CONNECT_TIMEOUT, castRequestTimeout);
        clientConfig.property(ClientProperties.READ_TIMEOUT, castRequestTimeout);
        clientConfig.property(ApacheClientProperties.CONNECTION_MANAGER, makeConnectionManager(maxConnections));
        clientConfig.connectorProvider(new ApacheConnectorProvider());
        return ClientBuilder.newClient(clientConfig);
    }

    @SuppressWarnings("unchecked")
    private static Feature makeGZipFeature() {
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

        );

        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.CREDENTIALS_PROVIDER, credentialsProvider)
                .property(ApacheClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION, true);
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);

        WebTarget r = client.target(getBaseUri());
        assertEquals("POST", r.request().post(Entity.text("POST"), String.class));
    }
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

                new UsernamePasswordCredentials("name", "password")
        );

        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.CREDENTIALS_PROVIDER, credentialsProvider);
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        WebTarget r = client.target(getBaseUri()).path("test");

        assertEquals("GET", r.request().get(String.class));
    }
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

    }

    @Test
    public void testAuthGetWithClientFilter() {
        ClientConfig cc = new ClientConfig();
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        client.register(HttpAuthenticationFeature.basic("name", "password"));
        WebTarget r = client.target(getBaseUri()).path("test/filter");

        assertEquals("GET", r.request().get(String.class));
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

                new UsernamePasswordCredentials("name", "password")
        );

        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.CREDENTIALS_PROVIDER, credentialsProvider);
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        WebTarget r = client.target(getBaseUri()).path("test");

        assertEquals("POST", r.request().post(Entity.text("POST"), String.class));
    }
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

    }

    @Test
    public void testAuthPostWithClientFilter() {
        ClientConfig cc = new ClientConfig();
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        client.register(HttpAuthenticationFeature.basic("name", "password"));
        WebTarget r = client.target(getBaseUri()).path("test/filter");

        assertEquals("POST", r.request().post(Entity.text("POST"), String.class));
View Full Code Here

Examples of org.glassfish.jersey.client.ClientConfig.connectorProvider()

                AuthScope.ANY,
                new UsernamePasswordCredentials("name", "password")
        );
        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.CREDENTIALS_PROVIDER, credentialsProvider);
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        WebTarget r = client.target(getBaseUri()).path("test");

        Response response = r.request().delete();
        assertEquals(response.getStatus(), 204);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.