public static final class ConnectionRule.Builder
extends java.lang.Object
ConnectionRule
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ConnectionRule |
build()
Builds the configured instance.
|
ConnectionRule.Builder |
description(java.lang.String description)
Sets the value of
ConnectionRule.getDescription() |
ConnectionRule.Builder |
fromPort(java.lang.Number fromPort)
Sets the value of
ConnectionRule.getFromPort() |
ConnectionRule.Builder |
protocol(java.lang.String protocol)
Sets the value of
ConnectionRule.getProtocol() |
ConnectionRule.Builder |
toPort(java.lang.Number toPort)
Sets the value of
ConnectionRule.getToPort() |
public ConnectionRule.Builder fromPort(java.lang.Number fromPort)
ConnectionRule.getFromPort()
fromPort
- Start of port range for the TCP and UDP protocols, or an ICMP type number. This parameter is required.
If you specify icmp for the IpProtocol property, you can specify
-1 as a wildcard (i.e., any ICMP type number).this
public ConnectionRule.Builder description(java.lang.String description)
ConnectionRule.getDescription()
description
- Description of this connection.
It is applied to both the ingress rule
and the egress rule.this
public ConnectionRule.Builder protocol(java.lang.String protocol)
ConnectionRule.getProtocol()
protocol
- The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).
Use -1 to specify all protocols. If you specify -1, or a protocol number
other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is
allowed, regardless of any ports you specify. For tcp, udp, and icmp, you
must specify a port range. For protocol 58 (ICMPv6), you can optionally
specify a port range; if you don't, traffic for all types and codes is
allowed.this
public ConnectionRule.Builder toPort(java.lang.Number toPort)
ConnectionRule.getToPort()
toPort
- End of port range for the TCP and UDP protocols, or an ICMP code.
If you specify icmp for the IpProtocol property, you can specify -1 as a
wildcard (i.e., any ICMP code).this
public ConnectionRule build()
ConnectionRule
java.lang.NullPointerException
- if any required attribute was not provided