> +        Injector injector = 
> newBuilder().modules(modules).overrides(props).buildInjector();
> +        constants = injector.getInstance(OneAndOneConstants.class);
> +        Predicate<Server> serverAvailableCheck = new Predicate<Server>() {
> +            @Override
> +            public boolean apply(Server currentServer) {
> +                Server server = api.serverApi().get(currentServer.id());
> +
> +                if ((server.status().state() != Types.ServerState.POWERED_OFF
> +                        && server.status().state() != 
> Types.ServerState.POWERED_ON)
> +                        || server.status().percent() != 0) {
> +                    return false;
> +                } else {
> +                    return true;
> +                }
> +            }
> +        };

Configure this in a reusable predicate in the HttpApiModule. Take 
[this](https://github.com/jclouds/jclouds/blob/master/providers/digitalocean2/src/main/java/org/jclouds/digitalocean2/compute/config/DigitalOcean2ComputeServiceContextModule.java#L100-L106)
 as an example.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/275/files/0767d011a984011133c9e34b3389b449ca0756cd#r68671611

Reply via email to