Class SecurityGroupPredicates
- java.lang.Object
 - 
- org.jclouds.cloudstack.predicates.SecurityGroupPredicates
 
 
- 
public class SecurityGroupPredicates extends Object
 
- 
- 
Constructor Summary
Constructors Constructor Description SecurityGroupPredicates() 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 groupstatic com.google.common.base.Predicate<SecurityGroup>nameMatches(com.google.common.base.Predicate<String> name)matches name of the given security groupstatic 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. 
 - 
 
- 
- 
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
 
 
 - 
 
 -