> +      Optional<? extends SecurityGroupApi> sgApi = 
> client.getSecurityGroupExtensionForZone(zone);
> +
> +      if (!serverApi.isPresent() || !sgApi.isPresent()) {
> +         return ImmutableSet.of();
> +      }
> +
> +      ServerWithSecurityGroups instance = serverApi.get().get(instanceId);
> +      if (instance == null) {
> +         return ImmutableSet.of();
> +      }
> +
> +      Set<String> groupNames = instance.getSecurityGroupNames();
> +      Set<? extends SecurityGroupInZone> rawGroups =
> +              
> sgApi.get().list().filter(nameIn(groupNames)).transform(groupToGroupInZone(zone)).toSet();
> +
> +      return ImmutableSet.copyOf(transform(filter(rawGroups, notNull()), 
> groupConverter));

Not sure how much value that'd provide over what it's got there already - in 
some cases, it's FluentIterable stuff, and so is going to be in its own little 
world anyway.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/144/files#r6353348

Reply via email to