mirror of https://github.com/apache/jclouds.git
issue 60: refactored http clients to not be bound to a single endpoint such that redirects can be assigned to another host
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1459 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
78d0b7afd3
commit
19989d8374
|
@ -23,11 +23,7 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.gae.config;
|
package org.jclouds.gae.config;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
import org.jclouds.gae.URLFetchServiceClient;
|
import org.jclouds.gae.URLFetchServiceClient;
|
||||||
import org.jclouds.http.HttpConstants;
|
|
||||||
import org.jclouds.http.HttpFutureCommandClient;
|
import org.jclouds.http.HttpFutureCommandClient;
|
||||||
import org.jclouds.http.config.HttpFutureCommandClientModule;
|
import org.jclouds.http.config.HttpFutureCommandClientModule;
|
||||||
|
|
||||||
|
@ -35,8 +31,6 @@ import com.google.appengine.api.urlfetch.URLFetchService;
|
||||||
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
|
import com.google.appengine.api.urlfetch.URLFetchServiceFactory;
|
||||||
import com.google.inject.AbstractModule;
|
import com.google.inject.AbstractModule;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import com.google.inject.Singleton;
|
|
||||||
import com.google.inject.name.Named;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configures {@link URLFetchServiceClient}.
|
* Configures {@link URLFetchServiceClient}.
|
||||||
|
@ -52,17 +46,6 @@ public class URLFetchServiceClientModule extends AbstractModule {
|
||||||
bind(HttpFutureCommandClient.class).to(URLFetchServiceClient.class);
|
bind(HttpFutureCommandClient.class).to(URLFetchServiceClient.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Singleton
|
|
||||||
@Provides
|
|
||||||
protected URI provideAddress(@Named(HttpConstants.PROPERTY_HTTP_ADDRESS) String address,
|
|
||||||
@Named(HttpConstants.PROPERTY_HTTP_PORT) int port,
|
|
||||||
@Named(HttpConstants.PROPERTY_HTTP_SECURE) boolean isSecure)
|
|
||||||
throws MalformedURLException {
|
|
||||||
|
|
||||||
return URI.create(String.format("%1$s://%2$s:%3$s", isSecure ? "https" : "http", address,
|
|
||||||
port));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
URLFetchService provideURLFetchService() {
|
URLFetchService provideURLFetchService() {
|
||||||
return URLFetchServiceFactory.getURLFetchService();
|
return URLFetchServiceFactory.getURLFetchService();
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class URLFetchServiceClientIntegrationTest extends BaseHttpFutureCommandC
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Test(enabled = false, invocationCount = 50, timeOut = 1500)
|
@Test(invocationCount = 50, timeOut = 1500)
|
||||||
public void testPutRedirect() throws MalformedURLException, ExecutionException,
|
public void testPutRedirect() throws MalformedURLException, ExecutionException,
|
||||||
InterruptedException, TimeoutException {
|
InterruptedException, TimeoutException {
|
||||||
setupApiProxy();
|
setupApiProxy();
|
||||||
|
|
Loading…
Reference in New Issue