Class SecurityGroupPredicates
java.lang.Object
org.jclouds.cloudstack.predicates.SecurityGroupPredicates
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.base.Predicate<SecurityGroup> any()static com.google.common.base.Predicate<SecurityGroup> 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.
-
Constructor Details
-
SecurityGroupPredicates
public SecurityGroupPredicates()
-
-
Method Details
-
portInRange
- Returns:
- true, if the security group contains an ingress rule with the given port in the port range
-
hasCidr
- 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
- Returns:
- always returns true.
-
nameEquals
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
-