jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Phillips <notificati...@github.com>
Subject Re: [jclouds-labs] CloudSigma2 ComputeService and SecurityGroupExtension (#70)
Date Sun, 21 Sep 2014 14:53:40 GMT
> +
> +   @Override
> +   public boolean removeSecurityGroup(String id) {
> +      FirewallPolicy firewallPolicy = api.getFirewallPolicy(id);
> +      if (firewallPolicy == null) {
> +         throw new IllegalArgumentException("There is no SecurityGroup with " + id +
" id");
> +      }
> +
> +      if (any(firewallPolicy.getServers(), new Predicate<Server>() {
> +         @Override
> +         public boolean apply(Server server) {
> +            ServerInfo serverInfo = api.getServerInfo(server.getUuid());
> +            return !ServerStatus.STOPPED.equals(serverInfo.getStatus());
> +         }
> +      })) {
> +         throw new IllegalStateException("Can't delete SecurityGroup while there are
nodes running in them");

"SecurityGroup"?

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