Package org.glassfish.jersey.client

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


                .trustStorePassword("asdfgh")
                .keyStoreBytes(ByteStreams.toByteArray(keyStore))
                .keyPassword("asdfgh");

        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.SSL_CONFIG, sslConfig);
        cc.connectorProvider(new ApacheConnectorProvider());

        Client client = ClientBuilder.newClient(cc);
        // client basic auth demonstration
        client.register(HttpAuthenticationFeature.basic("user", "password"));
View Full Code Here


                .keyStoreBytes(ByteStreams.toByteArray(keyStore))
                .keyPassword("asdfgh");


        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.SSL_CONFIG, sslConfig);
        cc.connectorProvider(new ApacheConnectorProvider());

        Client client = ClientBuilder.newClient(cc);

        System.out.println("Client: GET " + Server.BASE_URI);
View Full Code Here

        SslConfigurator sslConfig = SslConfigurator.newInstance()
                .trustStoreBytes(ByteStreams.toByteArray(trustStore))
                .trustStorePassword("asdfgh");

        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.SSL_CONFIG, sslConfig);
        cc.connectorProvider(new ApacheConnectorProvider());

        Client client = ClientBuilder.newClient(cc);

        System.out.println("Client: GET " + Server.BASE_URI);
View Full Code Here

    private void _test(final String response, final Boolean globalDisable, final Boolean clientDisable) throws Exception {
        final ClientConfig config = new ClientConfig();
        config.register(Filter.class);

        if (globalDisable != null) {
            config.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
        }
        if (clientDisable != null) {
            config.property(ClientProperties.JSON_PROCESSING_FEATURE_DISABLE, clientDisable);
        }
View Full Code Here

        if (globalDisable != null) {
            config.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
        }
        if (clientDisable != null) {
            config.property(ClientProperties.JSON_PROCESSING_FEATURE_DISABLE, clientDisable);
        }

        final Client client = ClientBuilder.newClient(config);
        final Invocation.Builder request = client.target("").request();
View Full Code Here

    @Test
    public void testAsyncClientRequests() throws InterruptedException {
        HttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
        ClientConfig cc = new ClientConfig();
        cc.property(ApacheClientProperties.CONNECTION_MANAGER, connectionManager);
        cc.connectorProvider(new ApacheConnectorProvider());
        Client client = ClientBuilder.newClient(cc);
        WebTarget target = client.target(getBaseUri());
        final int REQUESTS = 20;
        final CountDownLatch latch = new CountDownLatch(REQUESTS);
View Full Code Here

    }

    @Test
    public void testDisabledCookies() {
        ClientConfig cc = new ClientConfig();
        cc.property(JettyClientProperties.DISABLE_COOKIES, true);
        cc.connectorProvider(new JettyConnectorProvider());
        JerseyClient client = JerseyClientBuilder.createClient(cc);
        WebTarget r = client.target(getBaseUri());

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

    }

    @Test
    public void testPostChunked() {
        ClientConfig config = new ClientConfig();
        config.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024);
        config.connectorProvider(new JettyConnectorProvider());
        config.register(new LoggingFilter(LOGGER, true));

        Client client = ClientBuilder.newClient(config);
        WebTarget r = client.target(getBaseUri());
View Full Code Here

                .trustStorePassword("asdfgh")
                .keyStoreBytes(ByteStreams.toByteArray(keyStore))
                .keyPassword("asdfgh");

        ClientConfig config = new ClientConfig();
        config.property(JettyClientProperties.SSL_CONFIG, sslConfig);
        config.connectorProvider(new JettyConnectorProvider());

        Client client = ClientBuilder.newClient(config);

        // client basic auth demonstration
View Full Code Here

                .keyStoreBytes(ByteStreams.toByteArray(keyStore))
                .keyPassword("asdfgh");


        ClientConfig cc = new ClientConfig();
        cc.property(JettyClientProperties.SSL_CONFIG, sslConfig);
        cc.connectorProvider(new JettyConnectorProvider());

        Client client = ClientBuilder.newClient(cc);

        System.out.println("Client: GET " + Server.BASE_URI);
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.