Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.ec2.model;
 
 
Container for the parameters to the RevokeSecurityGroupIngress operation.

Removes one or more ingress rules from a security group. The values that you specify in the revoke request (for example, ports) must match the existing rule's values for the rule to be removed.

Each rule consists of the protocol and the CIDR range or source security group. For the TCP and UDP protocols, you must also specify the destination port or range of ports. For the ICMP protocol, you must also specify the ICMP type and code.

Rule changes are propagated to instances within the security group as quickly as possible. However, a small delay might occur.

 
[EC2-Classic, default VPC] The name of the security group.
 
     private String groupName;

    
The ID of the security group.
 
     private String groupId;

    
[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
 
     private String sourceSecurityGroupName;

    
The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
 
     private String sourceSecurityGroupOwnerId;

    
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.
 
     private String ipProtocol;

    
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all ICMP types.
 
     private Integer fromPort;

    
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.
 
     private Integer toPort;

    
The CIDR IP address range. You can't specify this parameter when specifying a source security group.
 
     private String cidrIp;

    
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
Default constructor for a new RevokeSecurityGroupIngressRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
    public RevokeSecurityGroupIngressRequest() {}
    
    
Constructs a new RevokeSecurityGroupIngressRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
groupName [EC2-Classic, default VPC] The name of the security group.
ipPermissions A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
    public RevokeSecurityGroupIngressRequest(String groupNamejava.util.List<IpPermissionipPermissions) {
        setGroupName(groupName);
        setIpPermissions(ipPermissions);
    }

    
[EC2-Classic, default VPC] The name of the security group.

Returns:
[EC2-Classic, default VPC] The name of the security group.
    public String getGroupName() {
        return ;
    }
    
    
[EC2-Classic, default VPC] The name of the security group.

Parameters:
groupName [EC2-Classic, default VPC] The name of the security group.
    public void setGroupName(String groupName) {
        this. = groupName;
    }
    
    
[EC2-Classic, default VPC] The name of the security group.

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

Parameters:
groupName [EC2-Classic, default VPC] The name of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = groupName;
        return this;
    }

    
The ID of the security group.

Returns:
The ID of the security group.
    public String getGroupId() {
        return ;
    }
    
    
The ID of the security group.

Parameters:
groupId The ID of the security group.
    public void setGroupId(String groupId) {
        this. = groupId;
    }
    
    
The ID of the security group.

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

Parameters:
groupId The ID of the security group.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = groupId;
        return this;
    }

    
[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

Returns:
[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
        return ;
    }
    
    
[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

Parameters:
sourceSecurityGroupName [EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
    public void setSourceSecurityGroupName(String sourceSecurityGroupName) {
        this. = sourceSecurityGroupName;
    }
    
    
[EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

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

Parameters:
sourceSecurityGroupName [EC2-Classic, default VPC] The name of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RevokeSecurityGroupIngressRequest withSourceSecurityGroupName(String sourceSecurityGroupName) {
        this. = sourceSecurityGroupName;
        return this;
    }

    
The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

Returns:
The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
        return ;
    }
    
    
The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

Parameters:
sourceSecurityGroupOwnerId The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
    public void setSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) {
        this. = sourceSecurityGroupOwnerId;
    }
    
    
The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.

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

Parameters:
sourceSecurityGroupOwnerId The ID of the source security group. You can't specify this parameter in combination with the following parameters: the CIDR IP address range, the start of the port range, and the end of the port range.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RevokeSecurityGroupIngressRequest withSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) {
        this. = sourceSecurityGroupOwnerId;
        return this;
    }

    
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

Returns:
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.
    public String getIpProtocol() {
        return ;
    }
    
    
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

Parameters:
ipProtocol The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.
    public void setIpProtocol(String ipProtocol) {
        this. = ipProtocol;
    }
    
    
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.

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

Parameters:
ipProtocol The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). Use -1 to specify all.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = ipProtocol;
        return this;
    }

    
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all ICMP types.

Returns:
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all ICMP types.
    public Integer getFromPort() {
        return ;
    }
    
    
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all ICMP types.

Parameters:
fromPort The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify all ICMP types.
    public void setFromPort(Integer fromPort) {
        this. = fromPort;
    }
    
    
The start of port range for the TCP and UDP protocols, or an ICMP type number. For the ICMP type number, use -1 to specify 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. For the ICMP type number, use -1 to specify all ICMP types.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = fromPort;
        return this;
    }

    
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.

Returns:
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.
    public Integer getToPort() {
        return ;
    }
    
    
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.

Parameters:
toPort The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.
    public void setToPort(Integer toPort) {
        this. = toPort;
    }
    
    
The end of port range for the TCP and UDP protocols, or an ICMP code number. For the ICMP code number, use -1 to specify all ICMP codes for the 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 number. For the ICMP code number, use -1 to specify all ICMP codes for the ICMP type.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = toPort;
        return this;
    }

    
The CIDR IP address range. You can't specify this parameter when specifying a source security group.

Returns:
The CIDR IP address range. You can't specify this parameter when specifying a source security group.
    public String getCidrIp() {
        return ;
    }
    
    
The CIDR IP address range. You can't specify this parameter when specifying a source security group.

Parameters:
cidrIp The CIDR IP address range. You can't specify this parameter when specifying a source security group.
    public void setCidrIp(String cidrIp) {
        this. = cidrIp;
    }
    
    
The CIDR IP address range. You can't specify this parameter when specifying a source security group.

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

Parameters:
cidrIp The CIDR IP address range. You can't specify this parameter when specifying a source security group.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = cidrIp;
        return this;
    }

    
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.

Returns:
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.

Parameters:
ipPermissions A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
    public void setIpPermissions(java.util.Collection<IpPermissionipPermissions) {
        if (ipPermissions == null) {
            this. = null;
            return;
        }
        ipPermissionsCopy.addAll(ipPermissions);
        this. = ipPermissionsCopy;
    }
    
    
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.

NOTE: This method appends the values to the existing list (if any). Use setIpPermissions(java.util.Collection) or withIpPermissions(java.util.Collection) if you want to override the existing values.

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

Parameters:
ipPermissions A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getIpPermissions() == nullsetIpPermissions(new java.util.ArrayList<IpPermission>(ipPermissions.length));
        for (IpPermission value : ipPermissions) {
            getIpPermissions().add(value);
        }
        return this;
    }
    
    
A set of IP permissions. You can't specify a source security group and a CIDR IP address range.

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

Parameters:
ipPermissions A set of IP permissions. You can't specify a source security group and a CIDR IP address range.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (ipPermissions == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<IpPermissionipPermissionsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<IpPermission>(ipPermissions.size());
            ipPermissionsCopy.addAll(ipPermissions);
            this. = ipPermissionsCopy;
        }
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGroupName() != nullsb.append("GroupName: " + getGroupName() + ",");
        if (getGroupId() != nullsb.append("GroupId: " + getGroupId() + ",");
        if (getSourceSecurityGroupName() != nullsb.append("SourceSecurityGroupName: " + getSourceSecurityGroupName() + ",");
        if (getSourceSecurityGroupOwnerId() != nullsb.append("SourceSecurityGroupOwnerId: " + getSourceSecurityGroupOwnerId() + ",");
        if (getIpProtocol() != nullsb.append("IpProtocol: " + getIpProtocol() + ",");
        if (getFromPort() != nullsb.append("FromPort: " + getFromPort() + ",");
        if (getToPort() != nullsb.append("ToPort: " + getToPort() + ",");
        if (getCidrIp() != nullsb.append("CidrIp: " + getCidrIp() + ",");
        if (getIpPermissions() != nullsb.append("IpPermissions: " + getIpPermissions() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getGroupName() == null) ? 0 : getGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getGroupId() == null) ? 0 : getGroupId().hashCode()); 
        hashCode = prime * hashCode + ((getSourceSecurityGroupName() == null) ? 0 : getSourceSecurityGroupName().hashCode()); 
        hashCode = prime * hashCode + ((getSourceSecurityGroupOwnerId() == null) ? 0 : getSourceSecurityGroupOwnerId().hashCode()); 
        hashCode = prime * hashCode + ((getIpProtocol() == null) ? 0 : getIpProtocol().hashCode()); 
        hashCode = prime * hashCode + ((getFromPort() == null) ? 0 : getFromPort().hashCode()); 
        hashCode = prime * hashCode + ((getToPort() == null) ? 0 : getToPort().hashCode()); 
        hashCode = prime * hashCode + ((getCidrIp() == null) ? 0 : getCidrIp().hashCode()); 
        hashCode = prime * hashCode + ((getIpPermissions() == null) ? 0 : getIpPermissions().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RevokeSecurityGroupIngressRequest == falsereturn false;
        
        if (other.getGroupName() == null ^ this.getGroupName() == nullreturn false;
        if (other.getGroupName() != null && other.getGroupName().equals(this.getGroupName()) == falsereturn false
        if (other.getGroupId() == null ^ this.getGroupId() == nullreturn false;
        if (other.getGroupId() != null && other.getGroupId().equals(this.getGroupId()) == falsereturn false
        if (other.getSourceSecurityGroupName() == null ^ this.getSourceSecurityGroupName() == nullreturn false;
        if (other.getSourceSecurityGroupName() != null && other.getSourceSecurityGroupName().equals(this.getSourceSecurityGroupName()) == falsereturn false
        if (other.getSourceSecurityGroupOwnerId() == null ^ this.getSourceSecurityGroupOwnerId() == nullreturn false;
        if (other.getSourceSecurityGroupOwnerId() != null && other.getSourceSecurityGroupOwnerId().equals(this.getSourceSecurityGroupOwnerId()) == falsereturn false
        if (other.getIpProtocol() == null ^ this.getIpProtocol() == nullreturn false;
        if (other.getIpProtocol() != null && other.getIpProtocol().equals(this.getIpProtocol()) == falsereturn false
        if (other.getFromPort() == null ^ this.getFromPort() == nullreturn false;
        if (other.getFromPort() != null && other.getFromPort().equals(this.getFromPort()) == falsereturn false
        if (other.getToPort() == null ^ this.getToPort() == nullreturn false;
        if (other.getToPort() != null && other.getToPort().equals(this.getToPort()) == falsereturn false
        if (other.getCidrIp() == null ^ this.getCidrIp() == nullreturn false;
        if (other.getCidrIp() != null && other.getCidrIp().equals(this.getCidrIp()) == falsereturn false
        if (other.getIpPermissions() == null ^ this.getIpPermissions() == nullreturn false;
        if (other.getIpPermissions() != null && other.getIpPermissions().equals(this.getIpPermissions()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (RevokeSecurityGroupIngressRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X