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

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


                "application.services",
                StartupProperties.get().getProperty("application.services")
                        .replace("org.apache.falcon.service.ProcessSubscriberService", ""));
        String store = StartupProperties.get().getProperty("config.store.uri");
        StartupProperties.get().setProperty("config.store.uri", store + System.currentTimeMillis());
        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
    }
View Full Code Here


      throw new NullPointerException();
    }
    this.url = url;
    descriptionEntries = new HashMap<FileName, String>();

    final ClientConfig config = new DefaultClientConfig();
    config.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
    config.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, timeout);
    this.client = Client.create(config);
    this.client.addFilter(new CookiesHandlerFilter()); // must be inserted before HTTPBasicAuthFilter
    this.client.addFilter(new HTTPBasicAuthFilter(username, password));
    this.majorVersion = "999";
    this.minorVersion = "999";
View Full Code Here

 
  /**
     * Used for REST Jersey calls
     */
    private void initRestService() {
      ClientConfig clientConfig = new DefaultClientConfig();
      clientConfig.getClasses().add(MultiPartWriter.class);
      clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
      client = Client.create(clientConfig);
      client.addFilter(new HTTPBasicAuthFilter(username, password));
    }
View Full Code Here

      return;
    }

    String url = "http://localhost:8080/pentaho";

    final ClientConfig config = new DefaultClientConfig();
    config.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
    Client client = Client.create(config);
    client.addFilter(new HTTPBasicAuthFilter("joe", "password"));

    final WebResource resource = client.resource(url + "/api/repo/files/children?depth=-1&filter=*");
    final RepositoryFileTreeDto tree = resource.path("").accept(MediaType.APPLICATION_XML_TYPE).get(RepositoryFileTreeDto.class);
View Full Code Here

        logger.debug("Creating Base URI");
        return UriBuilder.fromUri(baseURI).build();
    }

    private WebResource getProvenanceRegistryBaseResource() {
        ClientConfig config = new DefaultClientConfig();
        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
                Boolean.TRUE);
        Client client = Client.create(config);
        WebResource baseWebResource = client.resource(getBaseURI());
        webResource = baseWebResource.path(
                ResourcePathConstants.ProvenanceResourcePathConstants.REGISTRY_API_PROVENANCEREGISTRY);
View Full Code Here

    String applicationContextPath = getApplicationContextPath();
    APP_BASE_PATH = testProperties.getApplicationPath("/" + applicationContextPath);
    LOGGER.info("Connecting to application "+APP_BASE_PATH);

    ClientConfig clientConfig = new DefaultApacheHttpClient4Config();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = ApacheHttpClient4.create(clientConfig);

    defaultHttpClient = (DefaultHttpClient) client.getClientHandler().getHttpClient();
    HttpParams params = defaultHttpClient.getParams();
    HttpConnectionParams.setConnectionTimeout(params, 3 * 60 * 1000);
 
View Full Code Here

  public TestUtil(TestProperties testProperties) {

    this.testProperties = testProperties;

    // create admin user:
    ClientConfig clientConfig = new DefaultApacheHttpClient4Config();
    clientConfig.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
    client = ApacheHttpClient4.create(clientConfig);

    defaultHttpClient = (DefaultHttpClient) client.getClientHandler().getHttpClient();
  }
View Full Code Here

            this.authenticationToken = FalconClient.getToken(baseUrl);
        } catch (FalconCLIException e) {
            throw new AuthenticationException(e);
        }

        ClientConfig config = new DefaultClientConfig();
        Client client = Client.create(config);
        client.setReadTimeout(500000);
        client.setConnectTimeout(500000);
        this.service = client.resource(UriBuilder.fromUri(BASE_URL).build());
    }
View Full Code Here

  private boolean isEnabled;
  private TimelineAuthenticatedURLConnectionFactory urlFactory;

  public TimelineClientImpl() {
    super(TimelineClientImpl.class.getName());
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(YarnJacksonJaxbJsonProvider.class);
    if (UserGroupInformation.isSecurityEnabled()) {
      urlFactory = new TimelineAuthenticatedURLConnectionFactory();
      client = new Client(new URLConnectionClientHandler(urlFactory), cc);
    } else {
      client = Client.create(cc);
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

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.