Package com.sun.jersey.api.client.config

Examples of com.sun.jersey.api.client.config.DefaultClientConfig


            String httpMethod = getHttpMethod(method);
            String mimeType = getConsumes(method);
            String accept = MediaType.WILDCARD;
            String user = CurrentUser.getUser();

            ClientResponse response = Client.create(new DefaultClientConfig())
                    .resource(UriBuilder.fromUri(url).build())
                    .header(REMOTE_USER, user).accept(accept)
                    .type(mimeType).method(httpMethod, ClientResponse.class,
                            (isPost(httpMethod) ? incomingRequest.getInputStream() : null));
            incomingRequest.getInputStream().reset();
View Full Code Here


  }

  @Test
  public void testStacks() throws UniformInterfaceException, JSONException,
    IOException {
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = Client.create(clientConfig);
    WebResource webResource = client.resource("http://localhost:9998/stacks");
   
    String output = webResource.get(String.class);
    LOG.info("All Stack Info \n" + output);
View Full Code Here

  protected AppDescriptor configure() {
    // initTest();

    WebAppDescriptor wd = new WebAppDescriptor.Builder(
        "org.saiku.web.rest.resources").contextPath("/")
                                       .contextParam("", "").clientConfig(new DefaultClientConfig()).build();

    return wd;
  }
View Full Code Here

    @Before
    public void setUp() throws Exception {
        Main.start();

        clientConfig = new DefaultClientConfig();
        // use the following jaxb context resolver
        //cc.getProviderClasses().add(JAXBContextResolver.class);
        client = Client.create(clientConfig);
        resource = client.resource(Main.getRootUrl());
    }
View Full Code Here

        getOptionValue( Messages.getInstance().getString( "CommandLineProcessor.INFO_OPTION_USERNAME_KEY" ), Messages
            .getInstance().getString( "CommandLineProcessor.INFO_OPTION_USERNAME_NAME" ), true, false );
    String password =
        getOptionValue( Messages.getInstance().getString( "CommandLineProcessor.INFO_OPTION_PASSWORD_KEY" ), Messages
            .getInstance().getString( "CommandLineProcessor.INFO_OPTION_PASSWORD_NAME" ), true, false );
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE );
    client = Client.create( clientConfig );
    client.addFilter( new HTTPBasicAuthFilter( username, password ) );

    // check if the user has permissions to upload/download data
    String contextURL =
View Full Code Here

  }

  protected Client client;

  protected Client getClient(PiCloudCreds credsToUse) {
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(JacksonJsonProvider.class);

    Client client = ApacheHttpClient4.create(cc);

    client.setFollowRedirects(Boolean.TRUE);
    client.addFilter(new HTTPBasicAuthFilter(credsToUse.getKey(), credsToUse.getSecretKey()));
View Full Code Here

    };
  }

  @Override
  protected AppDescriptor configure() {
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(JacksonJsonProvider.class);
    return new LowLevelAppDescriptor.Builder(new ClasspathResourceConfig()).clientConfig(cc).build();
  }
View Full Code Here

            if (command == null || command.trim().isEmpty()) {
                throw new InvalidParameterException("No command to execute.");
            }

            try {
                ClientConfig config = new DefaultClientConfig();
                Client client = Client.create(config);
                WebResource webResource = client.resource(UriBuilder.fromUri(restprotocol + elastiCenterAddress + restpath).build());

                MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
                queryParams.add(queryparamapikey, apiKey);
View Full Code Here

        return c;
    }

    private DockerClient(Config config) {
    restEndpointUrl = config.url + "/v" + config.version;
    ClientConfig clientConfig = new DefaultClientConfig();
    //clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);

    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme("http", config.url.getPort(), PlainSocketFactory.getSocketFactory()));
    schemeRegistry.register(new Scheme("https", 443, SSLSocketFactory.getSocketFactory()));
View Full Code Here

        }

        HTTPSProperties prop = new HTTPSProperties(null, context);

        DefaultClientConfig dcc = new DefaultClientConfig();
        dcc.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, prop);

        Client c = Client.create(dcc);

        // client basic auth demonstration
        c.addFilter(new HTTPBasicAuthFilter("user", "password"));
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.client.config.DefaultClientConfig

Copyright © 2018 www.massapicom. 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.