Java 类com.amazonaws.services.ec2.model.RevokeSecurityGroupEgressRequest 实例源码

项目:photon-model    文件:AWSSecurityGroupClient.java   
public DeferredResult<Void> removeEgressRules(String groupId, List<IpPermission> rules) {
    if (CollectionUtils.isNotEmpty(rules)) {
        RevokeSecurityGroupEgressRequest req = new RevokeSecurityGroupEgressRequest()
                .withGroupId(groupId).withIpPermissions(rules);

        String message = "Remove Egress Rules from AWS Security Group with id [" + groupId +
                "].";

        AWSDeferredResultAsyncHandler<RevokeSecurityGroupEgressRequest,
                RevokeSecurityGroupEgressResult>
                handler = new AWSDeferredResultAsyncHandler<RevokeSecurityGroupEgressRequest,
                RevokeSecurityGroupEgressResult>(this.service, message) {

                    @Override
                    protected Exception consumeError(Exception e) {
                        if (e instanceof AmazonEC2Exception &&
                                ((AmazonEC2Exception)e).getErrorCode().equals
                                        (SECURITY_GROUP_RULE_NOT_FOUND)) {
                            Utils.log(AWSUtils.class, AWSUtils.class.getSimpleName(),
                                    Level.WARNING, () -> String
                                            .format("Egress rules cannot be removed because "
                                                    + "they do not exist: %s",
                                                    Utils.toString(e)));
                            return null;
                        } else {
                            return e;
                        }
                    }
                };
        this.client.revokeSecurityGroupEgressAsync(req, handler);
        return handler.toDeferredResult()
                .thenApply(r -> (Void)null);
    } else {
        return DeferredResult.completed(null);
    }
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public void revokeSecurityGroupEgress(RevokeSecurityGroupEgressRequest revokeSecurityGroupEgressRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:aws-sdk-java-resources    文件:SecurityGroupImpl.java   
@Override
public void revokeEgress(RevokeSecurityGroupEgressRequest request) {
    revokeEgress(request, null);
}
项目:aws-sdk-java-resources    文件:SecurityGroupImpl.java   
@Override
public void revokeEgress(RevokeSecurityGroupEgressRequest request,
        ResultCapture<Void> extractor) {

    resource.performAction("RevokeEgress", request, extractor);
}
项目:aws-sdk-java-resources    文件:SecurityGroup.java   
/**
 * Performs the <code>RevokeEgress</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>SecurityGroup</code> resource, and any conflicting parameter value
 * set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>GroupId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @see RevokeSecurityGroupEgressRequest
 */
void revokeEgress(RevokeSecurityGroupEgressRequest request);
项目:aws-sdk-java-resources    文件:SecurityGroup.java   
/**
 * Performs the <code>RevokeEgress</code> action and use a ResultCapture to
 * retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>SecurityGroup</code> resource, and any conflicting parameter value
 * set in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>GroupId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @see RevokeSecurityGroupEgressRequest
 */
void revokeEgress(RevokeSecurityGroupEgressRequest request,
        ResultCapture<Void> extractor);