org.jclouds.openstack.nova.v2_0.predicates
Class SecurityGroupPredicates

java.lang.Object
  extended by org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates

public class SecurityGroupPredicates
extends Object

Predicates handy when working with SecurityGroups


Constructor Summary
SecurityGroupPredicates()
           
 
Method Summary
static com.google.common.base.Predicate<SecurityGroup> nameEquals(String name)
          matches name of the given security group
static com.google.common.base.Predicate<SecurityGroup> nameIn(Set<String> names)
          matches name of the given security group against a list
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<SecurityGroupRule> ruleCidr(String cidr)
          matches a security group rule by its cidr
static com.google.common.base.Predicate<SecurityGroupRule> ruleEndPort(int endPort)
          matches a security group rule by the end port
static com.google.common.base.Predicate<SecurityGroupRule> ruleGroup(String groupName)
          matches a security group rule by the security group it allows
static com.google.common.base.Predicate<SecurityGroupRule> ruleProtocol(org.jclouds.net.domain.IpProtocol protocol)
          matches a security group rule by the protocol
static com.google.common.base.Predicate<SecurityGroupRule> ruleStartPort(int startPort)
          matches a security group rule by the start port
 
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

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

nameIn

public static com.google.common.base.Predicate<SecurityGroup> nameIn(Set<String> names)
matches name of the given security group against a list

Parameters:
names -
Returns:
predicate that matches one of the names

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

ruleCidr

public static com.google.common.base.Predicate<SecurityGroupRule> ruleCidr(String cidr)
matches a security group rule by its cidr

Parameters:
cidr -
Returns:
predicate that matches cidr

ruleGroup

public static com.google.common.base.Predicate<SecurityGroupRule> ruleGroup(String groupName)
matches a security group rule by the security group it allows

Parameters:
groupName -
Returns:
predicate that matches group

ruleProtocol

public static com.google.common.base.Predicate<SecurityGroupRule> ruleProtocol(org.jclouds.net.domain.IpProtocol protocol)
matches a security group rule by the protocol

Parameters:
protocol -
Returns:
predicate that matches protocol

ruleStartPort

public static com.google.common.base.Predicate<SecurityGroupRule> ruleStartPort(int startPort)
matches a security group rule by the start port

Parameters:
startPort -
Returns:
predicate that matches startPort

ruleEndPort

public static com.google.common.base.Predicate<SecurityGroupRule> ruleEndPort(int endPort)
matches a security group rule by the end port

Parameters:
endPort -
Returns:
predicate that matches endPort


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