com.amazonaws.services.ec2.model
Class IpPermission

java.lang.Object
  extended by com.amazonaws.services.ec2.model.IpPermission
All Implemented Interfaces:
java.io.Serializable

public class IpPermission
extends java.lang.Object
implements java.io.Serializable

Describes a security group rule.

See Also:
Serialized Form

Constructor Summary
IpPermission()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Integer getFromPort()
          The start of port range for the TCP and UDP protocols, or an ICMP type number.
 java.lang.String getIpProtocol()
          The protocol.
 java.util.List<java.lang.String> getIpRanges()
          One or more IP ranges.
 java.lang.Integer getToPort()
          The end of port range for the TCP and UDP protocols, or an ICMP code.
 java.util.List<UserIdGroupPair> getUserIdGroupPairs()
          One or more security group and AWS account ID pairs.
 int hashCode()
           
 void setFromPort(java.lang.Integer fromPort)
          The start of port range for the TCP and UDP protocols, or an ICMP type number.
 void setIpProtocol(java.lang.String ipProtocol)
          The protocol.
 void setIpRanges(java.util.Collection<java.lang.String> ipRanges)
          One or more IP ranges.
 void setToPort(java.lang.Integer toPort)
          The end of port range for the TCP and UDP protocols, or an ICMP code.
 void setUserIdGroupPairs(java.util.Collection<UserIdGroupPair> userIdGroupPairs)
          One or more security group and AWS account ID pairs.
 java.lang.String toString()
          Returns a string representation of this object; useful for testing and debugging.
 IpPermission withFromPort(java.lang.Integer fromPort)
          The start of port range for the TCP and UDP protocols, or an ICMP type number.
 IpPermission withIpProtocol(java.lang.String ipProtocol)
          The protocol.
 IpPermission withIpRanges(java.util.Collection<java.lang.String> ipRanges)
          One or more IP ranges.
 IpPermission withIpRanges(java.lang.String... ipRanges)
          One or more IP ranges.
 IpPermission withToPort(java.lang.Integer toPort)
          The end of port range for the TCP and UDP protocols, or an ICMP code.
 IpPermission withUserIdGroupPairs(java.util.Collection<UserIdGroupPair> userIdGroupPairs)
          One or more security group and AWS account ID pairs.
 IpPermission withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs)
          One or more security group and AWS account ID pairs.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IpPermission

public IpPermission()
Method Detail

getIpProtocol

public java.lang.String getIpProtocol()
The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.

Returns:
The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.


setIpProtocol

public void setIpProtocol(java.lang.String ipProtocol)
The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.

Parameters:
ipProtocol - The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.


withIpProtocol

public IpPermission withIpProtocol(java.lang.String ipProtocol)
The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ipProtocol - The protocol.

When you call DescribeSecurityGroups, the protocol value returned is the number. Exception: For TCP, UDP, and ICMP, the value returned is the name (for example, tcp, udp, or icmp). For a list of protocol numbers, see Protocol Numbers.

Returns:
A reference to this updated object so that method calls can be chained together.

getFromPort

public java.lang.Integer getFromPort()
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

Returns:
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

setFromPort

public void setFromPort(java.lang.Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

Parameters:
fromPort - The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

withFromPort

public IpPermission withFromPort(java.lang.Integer fromPort)
The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.

Returns a reference to this object so that method calls can be chained together.

Parameters:
fromPort - The start of port range for the TCP and UDP protocols, or an ICMP type number. A value of -1 indicates all ICMP types.
Returns:
A reference to this updated object so that method calls can be chained together.

getToPort

public java.lang.Integer getToPort()
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

Returns:
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

setToPort

public void setToPort(java.lang.Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

Parameters:
toPort - The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

withToPort

public IpPermission withToPort(java.lang.Integer toPort)
The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.

Returns a reference to this object so that method calls can be chained together.

Parameters:
toPort - The end of port range for the TCP and UDP protocols, or an ICMP code. A value of -1 indicates all ICMP codes for the specified ICMP type.
Returns:
A reference to this updated object so that method calls can be chained together.

getUserIdGroupPairs

public java.util.List<UserIdGroupPair> getUserIdGroupPairs()
One or more security group and AWS account ID pairs.

Returns:
One or more security group and AWS account ID pairs.

setUserIdGroupPairs

public void setUserIdGroupPairs(java.util.Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.

Parameters:
userIdGroupPairs - One or more security group and AWS account ID pairs.

withUserIdGroupPairs

public IpPermission withUserIdGroupPairs(UserIdGroupPair... userIdGroupPairs)
One or more security group and AWS account ID pairs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
userIdGroupPairs - One or more security group and AWS account ID pairs.
Returns:
A reference to this updated object so that method calls can be chained together.

withUserIdGroupPairs

public IpPermission withUserIdGroupPairs(java.util.Collection<UserIdGroupPair> userIdGroupPairs)
One or more security group and AWS account ID pairs.

Returns a reference to this object so that method calls can be chained together.

Parameters:
userIdGroupPairs - One or more security group and AWS account ID pairs.
Returns:
A reference to this updated object so that method calls can be chained together.

getIpRanges

public java.util.List<java.lang.String> getIpRanges()
One or more IP ranges.

Returns:
One or more IP ranges.

setIpRanges

public void setIpRanges(java.util.Collection<java.lang.String> ipRanges)
One or more IP ranges.

Parameters:
ipRanges - One or more IP ranges.

withIpRanges

public IpPermission withIpRanges(java.lang.String... ipRanges)
One or more IP ranges.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ipRanges - One or more IP ranges.
Returns:
A reference to this updated object so that method calls can be chained together.

withIpRanges

public IpPermission withIpRanges(java.util.Collection<java.lang.String> ipRanges)
One or more IP ranges.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ipRanges - One or more IP ranges.
Returns:
A reference to this updated object so that method calls can be chained together.

toString

public java.lang.String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.