setDBSecurityGroupName(dBSecurityGroupName); setDBSecurityGroupDescription(dBSecurityGroupDescription);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBSecurityGroupName() == null) ? 0 : getDBSecurityGroupName().hashCode()); hashCode = prime * hashCode + ((getDBSecurityGroupDescription() == null) ? 0 : getDBSecurityGroupDescription().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
/** * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; }
/** * Not used yet! * * @param dbInstanceIdentifier * @param group * @param owner */ public void setSecuretGroup(String dbInstanceIdentifier, String group, String owner) { String groupName = dbInstanceIdentifier + "-security-group"; CreateDBSecurityGroupRequest csg = new CreateDBSecurityGroupRequest(); csg.setDBSecurityGroupName(groupName); csg.setDBSecurityGroupDescription(groupName); rdsClient.createDBSecurityGroup(csg); RevokeDBSecurityGroupIngressRequest rsgi = new RevokeDBSecurityGroupIngressRequest(); rsgi.setDBSecurityGroupName(groupName); rsgi.setEC2SecurityGroupId(group); rsgi.setEC2SecurityGroupOwnerId(owner); rsgi.setRequestCredentials(awsCredentials); //rsgi.set rdsClient.revokeDBSecurityGroupIngress(rsgi); ModifyDBInstanceRequest request = new ModifyDBInstanceRequest(); Collection<String> groups = new ArrayList(); groups.add(groupName); request.setDBSecurityGroups(groups); request.setDBInstanceIdentifier(dbInstanceIdentifier); rdsClient.modifyDBInstance(request); }
CreateDBSecurityGroupRequest csg = new CreateDBSecurityGroupRequest() .withDBSecurityGroupName(groupName) .withDBSecurityGroupDescription(groupName);
/** * <p> * The description for the DB security group. * </p> * * @param dBSecurityGroupDescription * The description for the DB security group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withDBSecurityGroupDescription(String dBSecurityGroupDescription) { setDBSecurityGroupDescription(dBSecurityGroupDescription); return this; }
setDBSecurityGroupName(dBSecurityGroupName); return this;
/** * <p> * The description for the DB security group. * </p> * * @param dBSecurityGroupDescription * The description for the DB security group. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withDBSecurityGroupDescription(String dBSecurityGroupDescription) { setDBSecurityGroupDescription(dBSecurityGroupDescription); return this; }
setDBSecurityGroupName(dBSecurityGroupName); return this;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDBSecurityGroupRequest == false) return false; CreateDBSecurityGroupRequest other = (CreateDBSecurityGroupRequest) obj; if (other.getDBSecurityGroupName() == null ^ this.getDBSecurityGroupName() == null) return false; if (other.getDBSecurityGroupName() != null && other.getDBSecurityGroupName().equals(this.getDBSecurityGroupName()) == false) return false; if (other.getDBSecurityGroupDescription() == null ^ this.getDBSecurityGroupDescription() == null) return false; if (other.getDBSecurityGroupDescription() != null && other.getDBSecurityGroupDescription().equals(this.getDBSecurityGroupDescription()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
setDBSecurityGroupName(dBSecurityGroupName); setDBSecurityGroupDescription(dBSecurityGroupDescription);
/** * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBSecurityGroupName() != null) sb.append("DBSecurityGroupName: ").append(getDBSecurityGroupName()).append(","); if (getDBSecurityGroupDescription() != null) sb.append("DBSecurityGroupDescription: ").append(getDBSecurityGroupDescription()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
/** * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withTags(java.util.Collection<Tag> tags) { setTags(tags); return this; }
public Request<CreateDBSecurityGroupRequest> marshall(CreateDBSecurityGroupRequest createDBSecurityGroupRequest) { if (createDBSecurityGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<CreateDBSecurityGroupRequest> request = new DefaultRequest<CreateDBSecurityGroupRequest>(createDBSecurityGroupRequest, "AmazonRDS"); request.addParameter("Action", "CreateDBSecurityGroup"); request.addParameter("Version", "2014-10-31"); request.setHttpMethod(HttpMethodName.POST); if (createDBSecurityGroupRequest.getDBSecurityGroupName() != null) { request.addParameter("DBSecurityGroupName", StringUtils.fromString(createDBSecurityGroupRequest.getDBSecurityGroupName())); } if (createDBSecurityGroupRequest.getDBSecurityGroupDescription() != null) { request.addParameter("DBSecurityGroupDescription", StringUtils.fromString(createDBSecurityGroupRequest.getDBSecurityGroupDescription())); } if (!createDBSecurityGroupRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createDBSecurityGroupRequest.getTags()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createDBSecurityGroupRequest.getTags(); int tagsListIndex = 1; for (Tag tagsListValue : tagsList) { if (tagsListValue.getKey() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey())); } if (tagsListValue.getValue() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue())); } tagsListIndex++; } } return request; }
/** * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. * </p> * * @param tags * @return Returns a reference to this object so that method calls can be chained together. */ public CreateDBSecurityGroupRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length)); } for (Tag ele : tags) { this.tags.add(ele); } return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBSecurityGroupName() == null) ? 0 : getDBSecurityGroupName().hashCode()); hashCode = prime * hashCode + ((getDBSecurityGroupDescription() == null) ? 0 : getDBSecurityGroupDescription().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateDBSecurityGroupRequest == false) return false; CreateDBSecurityGroupRequest other = (CreateDBSecurityGroupRequest) obj; if (other.getDBSecurityGroupName() == null ^ this.getDBSecurityGroupName() == null) return false; if (other.getDBSecurityGroupName() != null && other.getDBSecurityGroupName().equals(this.getDBSecurityGroupName()) == false) return false; if (other.getDBSecurityGroupDescription() == null ^ this.getDBSecurityGroupDescription() == null) return false; if (other.getDBSecurityGroupDescription() != null && other.getDBSecurityGroupDescription().equals(this.getDBSecurityGroupDescription()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBSecurityGroupName() != null) sb.append("DBSecurityGroupName: ").append(getDBSecurityGroupName()).append(","); if (getDBSecurityGroupDescription() != null) sb.append("DBSecurityGroupDescription: ").append(getDBSecurityGroupDescription()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); }
public Request<CreateDBSecurityGroupRequest> marshall(CreateDBSecurityGroupRequest createDBSecurityGroupRequest) { if (createDBSecurityGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<CreateDBSecurityGroupRequest> request = new DefaultRequest<CreateDBSecurityGroupRequest>(createDBSecurityGroupRequest, "AmazonRDS"); request.addParameter("Action", "CreateDBSecurityGroup"); request.addParameter("Version", "2014-10-31"); request.setHttpMethod(HttpMethodName.POST); if (createDBSecurityGroupRequest.getDBSecurityGroupName() != null) { request.addParameter("DBSecurityGroupName", StringUtils.fromString(createDBSecurityGroupRequest.getDBSecurityGroupName())); } if (createDBSecurityGroupRequest.getDBSecurityGroupDescription() != null) { request.addParameter("DBSecurityGroupDescription", StringUtils.fromString(createDBSecurityGroupRequest.getDBSecurityGroupDescription())); } if (!createDBSecurityGroupRequest.getTags().isEmpty() || !((com.amazonaws.internal.SdkInternalList<Tag>) createDBSecurityGroupRequest.getTags()).isAutoConstruct()) { com.amazonaws.internal.SdkInternalList<Tag> tagsList = (com.amazonaws.internal.SdkInternalList<Tag>) createDBSecurityGroupRequest.getTags(); int tagsListIndex = 1; for (Tag tagsListValue : tagsList) { if (tagsListValue.getKey() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Key", StringUtils.fromString(tagsListValue.getKey())); } if (tagsListValue.getValue() != null) { request.addParameter("Tags.Tag." + tagsListIndex + ".Value", StringUtils.fromString(tagsListValue.getValue())); } tagsListIndex++; } } return request; }