matched http timeouts with request timeouts for rimu

This commit is contained in:
Adrian Cole 2011-04-01 11:39:29 -07:00
parent efb7795e5f
commit 9bb3e4d041
1 changed files with 7 additions and 0 deletions

View File

@ -20,8 +20,10 @@
package org.jclouds.rimuhosting.miro;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_CONNECTION_TIMEOUT;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_ISO3166_CODES;
import static org.jclouds.Constants.PROPERTY_SO_TIMEOUT;
import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONE;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_ZONES;
@ -30,6 +32,7 @@ import static org.jclouds.rimuhosting.miro.reference.RimuHostingConstants.PROPER
import java.util.Properties;
import org.jclouds.PropertiesBuilder;
import org.jclouds.concurrent.Timeout;
/**
* Builds properties used in RimuHosting Clients
@ -49,6 +52,10 @@ public class RimuHostingPropertiesBuilder extends PropertiesBuilder {
properties.setProperty(PROPERTY_API_VERSION, "TODO");
properties.setProperty(PROPERTY_ENDPOINT, "https://api.rimuhosting.com/r");
properties.setProperty(PROPERTY_RIMUHOSTING_DEFAULT_DC, "DCDALLAS");
Timeout timeout = RimuHostingClient.class.getAnnotation(Timeout.class);
long timeoutMillis = timeout.timeUnit().toMillis(timeout.duration());
properties.setProperty(PROPERTY_SO_TIMEOUT, timeoutMillis + "");
properties.setProperty(PROPERTY_CONNECTION_TIMEOUT, timeoutMillis + "");
return properties;
}