serializeResponse(response, ec2Response);
}
private void describeSecurityGroups(HttpServletRequest request, HttpServletResponse response) throws ADBException, XMLStreamException, IOException {
EC2DescribeSecurityGroups EC2request = new EC2DescribeSecurityGroups();
// -> load in all the "GroupName.n" parameters if any
Enumeration<?> names = request.getParameterNames();
while (names.hasMoreElements()) {
String key = (String)names.nextElement();
if (key.startsWith("GroupName")) {
String[] value = request.getParameterValues(key);
if (null != value && 0 < value.length)
EC2request.addGroupName(value[0]);
}
}
// -> are there any filters with this request?
EC2Filter[] filterSet = extractFilters(request);
if (null != filterSet) {
EC2GroupFilterSet gfs = new EC2GroupFilterSet();
for (EC2Filter filter : filterSet)
gfs.addFilter(filter);
EC2request.setFilterSet(gfs);
}
// -> execute the request
EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();