org.jclouds.cloudstack.predicates
Class SecurityGroupPredicates

java.lang.Object
  extended by org.jclouds.cloudstack.predicates.SecurityGroupPredicates

public class SecurityGroupPredicates
extends Object


Constructor Summary
SecurityGroupPredicates()
           
 
Method Summary
static com.google.common.base.Predicate<SecurityGroup> any()
           
static com.google.common.base.Predicate<SecurityGroup> hasCidr(String cidr)
           
static com.google.common.base.Predicate<SecurityGroup> nameEquals(String name)
          matches name of the given security group
static com.google.common.base.Predicate<SecurityGroup> nameMatches(com.google.common.base.Predicate<String> name)
          matches name of the given security group
static com.google.common.base.Predicate<SecurityGroup> portInRange(int port)
           
static com.google.common.base.Predicate<SecurityGroup> portInRangeForCidr(int port, String cidr)
           
static com.google.common.base.Predicate<IngressRule> ruleCidrMatches(String protocol, int startPort, int endPort, Set<String> cidrs)
          matches IngressRules with the given protocol, start and end port, and any of the given CIDRs.
static com.google.common.base.Predicate<IngressRule> ruleGroupMatches(String protocol, int startPort, int endPort, com.google.common.collect.Multimap<String,String> accountGroupNames)
          matches IngressRules with the given protocol, start and end port, and any of the given account/security group name pairs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityGroupPredicates

public SecurityGroupPredicates()
Method Detail

portInRange

public static com.google.common.base.Predicate<SecurityGroup> portInRange(int port)
Returns:
true, if the security group contains an ingress rule with the given port in the port range

hasCidr

public static com.google.common.base.Predicate<SecurityGroup> hasCidr(String cidr)
Returns:
true, if the security group contains an ingress rule with the given cidr

portInRangeForCidr

public static com.google.common.base.Predicate<SecurityGroup> portInRangeForCidr(int port,
                                                                                 String cidr)
Returns:
true, if the security group contains an ingress rule with the given cidr and the given port in range

any

public static com.google.common.base.Predicate<SecurityGroup> any()
Returns:
always returns true.

nameEquals

public static com.google.common.base.Predicate<SecurityGroup> nameEquals(String name)
matches name of the given security group

Parameters:
name -
Returns:
predicate that matches name

nameMatches

public static com.google.common.base.Predicate<SecurityGroup> nameMatches(com.google.common.base.Predicate<String> name)
matches name of the given security group

Parameters:
name -
Returns:
predicate that matches name

ruleCidrMatches

public static com.google.common.base.Predicate<IngressRule> ruleCidrMatches(String protocol,
                                                                            int startPort,
                                                                            int endPort,
                                                                            Set<String> cidrs)
matches IngressRules with the given protocol, start and end port, and any of the given CIDRs.

Parameters:
protocol -
startPort -
endPort -
cidrs -
Returns:
predicate that matches as described

ruleGroupMatches

public static com.google.common.base.Predicate<IngressRule> ruleGroupMatches(String protocol,
                                                                             int startPort,
                                                                             int endPort,
                                                                             com.google.common.collect.Multimap<String,String> accountGroupNames)
matches IngressRules with the given protocol, start and end port, and any of the given account/security group name pairs.

Parameters:
protocol -
startPort -
endPort -
accountGroupNames -
Returns:
predicate that matches as described


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.