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

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


  protected Client client = null;
    protected boolean logPassword;
    private JerseyLoggingFilter logger = new JerseyLoggingFilter(Logger.getLogger("os"));

  public JerseyConnector() {
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getClasses().add(JacksonJaxbJsonProvider.class);
    clientConfig.getClasses().add(OpenStackObjectMapper.class);
    client = Client.create(clientConfig);
  }
View Full Code Here


  /**
   * @param env
   */
  public ClientController(Environment env) {
    ClientConfig config = new DefaultClientConfig();
    config.getClasses().add(JacksonJsonProvider.class);
    this.client = Client.create(config);
    Assert.notNull(env);
    this.env = env;
  }
View Full Code Here

  private WebResource webResource;

  @Before
  public void client() {
    ClientConfig config = new DefaultClientConfig();
    // Default jaxb provider cannot properly deserialize lists.
    config.getClasses().add(JacksonJsonProvider.class);

    webResource = Client.create(config).resource(baseUrl()).path("admin").path("resourceServer");
  }
View Full Code Here

  private List<String> resourceServerScopes = Arrays.asList("read", "write");

  @Before
  public void prepareRestClientAndCreateResourceServer() {
    ClientConfig config = new DefaultClientConfig();
    config.getClasses().add(JacksonJsonProvider.class);
    webResource = com.sun.jersey.api.client.Client.create(config)
        .resource(baseUrl())
        .path("admin")
        .path("resourceServer");
View Full Code Here

  /**
   * @return Client
   */
  protected Client createClient() {
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(ObjectMapperProvider.class);
    return Client.create(cc);
  }
View Full Code Here

        }
    }

    private Client getClient(String host) {
        if (!hostMap.containsKey(host)) {
            ClientConfig clientConfig = new DefaultClientConfig();
            clientConfig.getClasses().add(MultiPartWriter.class);
            Client client = Client.create(clientConfig);
            if (isDebug) {
                client.addFilter(new LoggingFilter());
            }
            hostMap.put(host, client);
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

        .post(RegistrationResponse.class, createDummyJSONRegister());
    Assert.assertEquals(RegistrationStatus.OK, response.getResponseStatus());
  }

  protected Client createTestClient() {
    ClientConfig clientConfig = new DefaultClientConfig();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    return Client.create(clientConfig);
  }
View Full Code Here

TOP

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

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.