jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - ComputeServiceAdapter (#145)
Date Tue, 03 Mar 2015 22:09:34 GMT
> +
> +@Singleton
> +public class ProfitBricksComputeServiceAdapter implements ComputeServiceAdapter<Server,
Hardware, Image, DataCenter> {
> +
> +   @Resource
> +   @Named(ComputeServiceConstants.COMPUTE_LOGGER)
> +   protected Logger logger = Logger.NULL;
> +
> +   private final ProfitBricksApi api;
> +   private final Predicate<String> waitDcUntilAvailable;
> +
> +   @Inject
> +   ProfitBricksComputeServiceAdapter(ProfitBricksApi api) {
> +      this.api = api;
> +      this.waitDcUntilAvailable = Predicates2.retry(new ProvisioningStatusPollingPredicate(
> +              api, ProvisioningStatusAware.DATACENTER, ProvisioningState.AVAILABLE),
10l * 60l, 2l, TimeUnit.SECONDS);

Consider making the predicate injectable. That would facilitate making the timeouts configurable
so users can customise them. Take a look at [Azure](https://github.com/jclouds/jclouds-labs/blob/master/azurecompute/src/main/java/org/jclouds/azurecompute/compute/config/AzureComputeServiceContextModule.java#L95-L101)
to see an example.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/145/files#r25732194
Mime
View raw message