Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.BasicAuthentication


  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
View Full Code Here


  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
View Full Code Here

  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
View Full Code Here

                 .build();

      Form form = new Form().param("grant_type", "client_credentials");
      ResteasyWebTarget target = client.target("https://localhost:8443/auth-server/j_oauth_token_grant");
      // this is resteasy specific, check spec to make sure it hasn't added a way to do basic auth
      target.register(new BasicAuthentication("bburke@redhat.com", "password"));
      AccessTokenResponse res = target
              .request()
              .post(Entity.form(form), AccessTokenResponse.class);
      try
      {
View Full Code Here

  private static ResteasyClient createRestClient(DatabaseIdentifier database) {
    ResteasyClientBuilder clientBuilder = new ResteasyClientBuilder();

    if ( database.getUserName() != null ) {
      clientBuilder.register( new BasicAuthentication( database.getUserName(), database.getPassword() ) );
    }

    // using a connection pool size > 1 causes a thread-safe pool implementation to be used under the hoods
    return clientBuilder
        .connectionPoolSize( CONNECTION_POOL_SIZE )
View Full Code Here

   */
  public BTSyncClient(String address, String port, String username, String password) {
    this.baseUrl = String.format("http://%s:%s/api?", address, port);
   
    client = new ResteasyClientBuilder().build();
    client.register(new BasicAuthentication(username, password))
          .register(JsonContentTypeResponseFilter.class);
  }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.jaxrs.BasicAuthentication

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.