Java 类com.amazonaws.services.rds.model.VpcSecurityGroupMembership 实例源码

项目:bluegreen-manager    文件:RdsAnalyzerTest.java   
/**
 * Test helper - makes a DBInstance having the specified security group names.
 */
private DBInstance makeDBInstanceWithSecurityGroups(String... securityGroupIds)
{
  DBInstance dbInstance = new DBInstance();
  dbInstance.setDBInstanceIdentifier(INSTANCE_NAME);
  if (ArrayUtils.isNotEmpty(securityGroupIds))
  {
    List<VpcSecurityGroupMembership> securityGroups = new ArrayList<VpcSecurityGroupMembership>();
    for (String securityGroupId : securityGroupIds)
    {
      securityGroups.add(makeVpcSecurityGroupMembership(securityGroupId));
    }
    dbInstance.setVpcSecurityGroups(securityGroups);
  }
  return dbInstance;
}
项目:bluegreen-manager    文件:RdsAnalyzer.java   
/**
 * Extracts the VPC security group ids from the instance.
 */
public Collection<String> extractVpcSecurityGroupIds(DBInstance dbInstance)
{
  if (dbInstance != null && CollectionUtils.isNotEmpty(dbInstance.getVpcSecurityGroups()))
  {
    List<String> ids = new ArrayList<String>();
    for (VpcSecurityGroupMembership group : dbInstance.getVpcSecurityGroups())
    {
      ids.add(group.getVpcSecurityGroupId());
    }
    return ids;
  }
  return null;
}
项目:bluegreen-manager    文件:RdsAnalyzerTest.java   
private VpcSecurityGroupMembership makeVpcSecurityGroupMembership(String securityGroupId)
{
  VpcSecurityGroupMembership securityGroup = new VpcSecurityGroupMembership();
  securityGroup.setVpcSecurityGroupId(securityGroupId);
  return securityGroup;
}