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

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


        }


        HTTPSProperties prop = new HTTPSProperties(null, context);

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

        Client c = Client.create(dcc);

        WebResource r = c.resource(Server.BASE_URI);
View Full Code Here


            System.out.println("KeyManagementException happened " + kme.getMessage());
        }

        HTTPSProperties prop = new HTTPSProperties(null, context);

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

        Client c = Client.create(dcc);

        WebResource r = c.resource(Server.BASE_URI);
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

  }

  @Test
  public void agentRegistration() throws UniformInterfaceException, JSONException {
    RegistrationResponse response;
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = Client.create(clientConfig);
    WebResource webResource = client.resource("http://localhost:9998/register/dummyhost");
    response = webResource.type(MediaType.APPLICATION_JSON)
        .post(RegistrationResponse.class, createDummyJSONRegister());
    LOG.info("Returned from Server responce=" + response);
View Full Code Here

  }

  @Test
  public void agentHeartBeat() throws UniformInterfaceException, JSONException {
    HeartBeatResponse response;
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = Client.create(clientConfig);
    WebResource webResource = client.resource("http://localhost:9998/heartbeat/dummyhost");
    response = webResource.type(MediaType.APPLICATION_JSON)
        .post(HeartBeatResponse.class, createDummyHeartBeat());
    LOG.info("Returned from Server: "
View Full Code Here

  }

  @Test
  public void agentHeartBeatWithEnv() throws UniformInterfaceException, JSONException {
    HeartBeatResponse response;
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = Client.create(clientConfig);
    WebResource webResource = client.resource("http://localhost:9998/heartbeat/dummyhost");
    response = webResource.type(MediaType.APPLICATION_JSON)
        .post(HeartBeatResponse.class, createDummyHeartBeatWithAgentEnv());
    LOG.info("Returned from Server: "
View Full Code Here

        "org.apache.hadoop.yarn.server.applicationhistoryservice.webapp")
        .contextListenerClass(GuiceServletConfig.class)
        .filterClass(com.google.inject.servlet.GuiceFilter.class)
        .contextPath("jersey-guice-filter")
        .servletPath("/")
        .clientConfig(new DefaultClientConfig(YarnJacksonJaxbJsonProvider.class))
        .build());
  }
View Full Code Here

  private URI resURI;
  private boolean isEnabled;

  public TimelineClientImpl() {
    super(TimelineClientImpl.class.getName());
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(YarnJacksonJaxbJsonProvider.class);
    client = Client.create(cc);
  }
View Full Code Here

    builder = addHeaders( builder );
    return builder;
  }

  private Client createIgnoreHttpsValidationClient() {
    ClientConfig config = new DefaultClientConfig();
    try {
      HTTPSProperties httpProperties = new HTTPSProperties( new HostnameVerifier() {
        @Override
        public boolean verify( String arg0, SSLSession arg1 ) {
          return true;
        }
      } );
      config.getProperties().put( HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, httpProperties );
    } catch( NoSuchAlgorithmException shouldNotHappen ) {
      throw new IllegalStateException( shouldNotHappen );
    }
    return Client.create( config );
  }
View Full Code Here

    /**
     * Create a new client instance.
     *
     */
    public ApacheHttpClient4() {
        this(createDefaultClientHandler(null), new DefaultClientConfig(), null);
    }
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.