Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 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.

The RevokeSecurityGroupIngress operation revokes permissions from a security group. The permissions used to revoke must be specified using the same values used to grant the permissions.

Permissions are specified by IP protocol (TCP, UDP, or ICMP), the source of the request (by IP range or an Amazon EC2 user-group pair), the source and destination port ranges (for TCP and UDP), and the ICMP codes and types (for ICMP).

Permission changes are quickly propagated to instances within the security group. However, depending on the number of instances in the group, a small delay might occur.

 
 public class RevokeSecurityGroupIngressRequest extends AmazonWebServiceRequest {

    
The name of the security group from which to remove permissions.
 
     private String groupName;

    
Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

 
     private String sourceSecurityGroupName;

    
Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

 
     private String sourceSecurityGroupOwnerId;

    
Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

 
     private String ipProtocol;

    
Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

 
     private Integer fromPort;

    
Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

 
     private Integer toPort;

    
Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

 
     private String cidrIp;

    
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
 
     private java.util.List<IpPermissionipPermissions;

    
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 The name of the security group from which to remove permissions.
ipPermissions List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
    public RevokeSecurityGroupIngressRequest(String groupNamejava.util.List<IpPermissionipPermissions) {
        this. = groupName;
        this. = ipPermissions;
    }
    
    
The name of the security group from which to remove permissions.

Returns:
The name of the security group from which to remove permissions.
    public String getGroupName() {
        return ;
    }
    
    
The name of the security group from which to remove permissions.

Parameters:
groupName The name of the security group from which to remove permissions.
    public void setGroupName(String groupName) {
        this. = groupName;
    }
    
    
The name of the security group from which to remove permissions.

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

Parameters:
groupName The name of the security group from which to remove permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = groupName;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

Parameters:
sourceSecurityGroupName Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

    public void setSourceSecurityGroupName(String sourceSecurityGroupName) {
        this. = sourceSecurityGroupName;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

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

Parameters:
sourceSecurityGroupName Deprecated - use the list of IP permissions to specify this information instead.

Name of the source security group. Cannot be used when specifying a CIDR IP address.

Returns:
A reference to this updated object so that method calls can be chained together.
    public RevokeSecurityGroupIngressRequest withSourceSecurityGroupName(String sourceSecurityGroupName) {
        this. = sourceSecurityGroupName;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

Parameters:
sourceSecurityGroupOwnerId Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

    public void setSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) {
        this. = sourceSecurityGroupOwnerId;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

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

Parameters:
sourceSecurityGroupOwnerId Deprecated - use the list of IP permissions to specify this information instead.

AWS user ID of an account. Cannot be used when specifying a CIDR IP address.

Returns:
A reference to this updated object so that method calls can be chained together.
    public RevokeSecurityGroupIngressRequest withSourceSecurityGroupOwnerId(String sourceSecurityGroupOwnerId) {
        this. = sourceSecurityGroupOwnerId;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

    public String getIpProtocol() {
        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

Parameters:
ipProtocol Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

    public void setIpProtocol(String ipProtocol) {
        this. = ipProtocol;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

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

Parameters:
ipProtocol Deprecated - use the list of IP permissions to specify this information instead.

IP protocol.

Valid values: tcp, udp, icmp

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = ipProtocol;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

    public Integer getFromPort() {
        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

Parameters:
fromPort Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

    public void setFromPort(Integer fromPort) {
        this. = fromPort;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

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

Parameters:
fromPort Deprecated - use the list of IP permissions to specify this information instead.

Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard (i.e., any ICMP type number).

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = fromPort;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

    public Integer getToPort() {
        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

Parameters:
toPort Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

    public void setToPort(Integer toPort) {
        this. = toPort;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

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

Parameters:
toPort Deprecated - use the list of IP permissions to specify this information instead.

End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard (i.e., any ICMP code).

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = toPort;
        return this;
    }
    
    
    
Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

Returns:
Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

    public String getCidrIp() {
        return ;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

Parameters:
cidrIp Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

    public void setCidrIp(String cidrIp) {
        this. = cidrIp;
    }
    
    
Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

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

Parameters:
cidrIp Deprecated - use the list of IP permissions to specify this information instead.

CIDR range.

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = cidrIp;
        return this;
    }
    
    
    
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.

Returns:
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
        if ( == null) {
             = new java.util.ArrayList<IpPermission>();
        }
        return ;
    }
    
    
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.

Parameters:
ipPermissions List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
    public void setIpPermissions(java.util.Collection<IpPermissionipPermissions) {
        java.util.List<IpPermissionipPermissionsCopy = new java.util.ArrayList<IpPermission>();
        if (ipPermissions != null) {
            ipPermissionsCopy.addAll(ipPermissions);
        }
        this. = ipPermissionsCopy;
    }
    
    
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.

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

Parameters:
ipPermissions List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
Returns:
A reference to this updated object so that method calls can be chained together.
        for (IpPermission value : ipPermissions) {
            getIpPermissions().add(value);
        }
        return this;
    }
    
    
List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.

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

Parameters:
ipPermissions List of IP permissions to revoke on the specified security group. For an IP permission to be removed, it must exactly match one of the IP permissions you specify in this list. Specifying permissions through IP permissions is the preferred way of revoking permissions since it offers more flexibility and control.
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<IpPermissionipPermissionsCopy = new java.util.ArrayList<IpPermission>();
        if (ipPermissions != null) {
            ipPermissionsCopy.addAll(ipPermissions);
        }
        this. = ipPermissionsCopy;
        return this;
    }
    
    
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("{");
        sb.append("GroupName: " +  + ", ");
        sb.append("SourceSecurityGroupName: " +  + ", ");
        sb.append("SourceSecurityGroupOwnerId: " +  + ", ");
        sb.append("IpProtocol: " +  + ", ");
        sb.append("FromPort: " +  + ", ");
        sb.append("ToPort: " +  + ", ");
        sb.append("CidrIp: " +  + ", ");
        sb.append("IpPermissions: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X