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

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


     *
     * @param root the root client handler for dispatching a request and
     *        returning a response.
     */
    public ApacheHttpClient4(final ApacheHttpClient4Handler root) {
        this(root, new DefaultClientConfig(), null);
    }
View Full Code Here


    public static class RestClient{
        private Client client;
        private final ObjectMapper objectMapper = createObjectMapper();

        public RestClient() {
            ClientConfig cc = new DefaultClientConfig();
            JacksonConfigurator jc = new JacksonConfigurator(objectMapper);
            cc.getSingletons().add(jc);
            cc.getClasses().add(JacksonJsonProvider.class);
            this.client =  Client.create(cc);
            this.client.addFilter(new LoggingFilter());
        }
View Full Code Here

       * be holding the Client as a static variable.
       */
      if(httpClient != null) {
        return httpClient;
      }
      ClientConfig config = new DefaultClientConfig();
      httpClient = Client.create(config);
      return httpClient;
    }
    catch(Exception e) {
      e.printStackTrace();
View Full Code Here

       */
      if(httpClient != null) {
        return httpClient;
      }
     
      ClientConfig config = new DefaultClientConfig();
      SSLContext ctx = SSLContext.getDefault();
     
        config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(new HostnameVerifier() {
              @Override
              public boolean verify(String arg0, SSLSession arg1) {
                  return true;
              }}, ctx));
      Client http_client = Client.create(config);
View Full Code Here

    public ClientProvider(ServerProvider serverProvider) {
        this.serverProvider = serverProvider;
    }

    public WebResource getWebResource() {
        Client client = Client.create(new DefaultClientConfig());
        return client.resource(serverProvider.getBaseURI());
    }
View Full Code Here

  public IvoryClient(String ivoryUrl) throws IOException {
    this.baseUrl = notEmpty(ivoryUrl, "IvoryUrl");
    if (!this.baseUrl.endsWith("/")) {
      this.baseUrl += "/";
    }
    Client client = Client.create(new DefaultClientConfig());
    setIvoryTimeOut(client);
    IvoryClient.service = client.resource(UriBuilder.fromUri(baseUrl)
        .build());
    client.resource(UriBuilder.fromUri(baseUrl).build());
View Full Code Here

            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

        } else if (new File("src/main/webapp").exists()) {
            this.server = new EmbeddedServer(15000, "src/main/webapp");
        } else {
            throw new RuntimeException("Cannot run jersey tests");
        }
        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
        this.server.start();

        if (System.getProperty("ivory.test.hadoop.embedded", "true").equals("true")) {
View Full Code Here

            this.resourceConfig = ad.getResourceConfig();
            this.webApp = WebApplicationFactory.createWebApplication();
        }

        public Client getClient() {
            ClientConfig clientConfig = new DefaultClientConfig();

            clientConfig.getSingletons().addAll(resourceConfig.getProviderSingletons());

            return new Client(new TestResourceClientHandler(baseUri, webApp), clientConfig);
        }
View Full Code Here

     * @param uri URI of the deployed Contacts Service to contact
     * @param username Username of the client calling this service
     * @param password Password of the client calling this service
     */
    public ContactsClient(String uri, String username, String password) {
        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        service = client.resource(uri);
        authentication = "Basic " + encodeCredentialsBasic(username, password);
        helper = new ContentHelper(client.getProviders());
    }
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.