org.jclouds.googlecomputeengine.domain
Class Firewall.Rule

java.lang.Object
  extended by org.jclouds.googlecomputeengine.domain.Firewall.Rule
Enclosing class:
Firewall

public static final class Firewall.Rule
extends Object

A Firewall rule. Rule specifies a protocol and port-range tuple that describes a permitted connection.

Author:
David Alves
See Also:

Nested Class Summary
static class Firewall.Rule.Builder
           
 
Method Summary
static Firewall.Rule.Builder builder()
           
 boolean equals(Object obj)
          
 org.jclouds.net.domain.IpProtocol getIpProtocol()
          This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number.
 com.google.common.collect.RangeSet<Integer> getPorts()
          Each entry must be either an integer or a range.
 int hashCode()
          
static Firewall.Rule permitTcpRule(Integer port)
           
static Firewall.Rule permitTcpRule(Integer start, Integer end)
           
static Firewall.Rule permitUdpRule(Integer port)
           
static Firewall.Rule permitUdpRule(Integer start, Integer end)
           
 com.google.common.base.Objects.ToStringHelper string()
          
 Firewall.Rule.Builder toBuilder()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

permitTcpRule

public static Firewall.Rule permitTcpRule(Integer start,
                                          Integer end)

permitTcpRule

public static Firewall.Rule permitTcpRule(Integer port)

permitUdpRule

public static Firewall.Rule permitUdpRule(Integer start,
                                          Integer end)

permitUdpRule

public static Firewall.Rule permitUdpRule(Integer port)

getIpProtocol

public org.jclouds.net.domain.IpProtocol getIpProtocol()
This can either be a well known protocol string (tcp, udp or icmp) or the IP protocol number.

Returns:
this is the IP protocol that is allowed for this rule.

getPorts

public com.google.common.collect.RangeSet<Integer> getPorts()
Each entry must be either an integer or a range. If not specified, connections through any port are allowed. Example inputs include: ["22"], ["80,"443"], and ["12345-12349"].

It is an error to specify this for any protocol that isn't UDP or TCP.

Returns:
An optional list of ports which are allowed.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

string

public com.google.common.base.Objects.ToStringHelper string()


toString

public String toString()

Overrides:
toString in class Object

builder

public static Firewall.Rule.Builder builder()

toBuilder

public Firewall.Rule.Builder toBuilder()


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