EC2SoapServiceImpl.toDescribeAvailabilityZonesResponse(ServiceProvider.getInstance().getEC2Engine().describeAvailabilityZones(EC2request));
serializeResponse(response, EC2response);
}
private void describeImages(HttpServletRequest request, HttpServletResponse response) throws ADBException, XMLStreamException, IOException {
EC2DescribeImages EC2request = new EC2DescribeImages();
// -> load in all the "ImageId.n" parameters if any, and ignore all other parameters
Enumeration<?> names = request.getParameterNames();
while (names.hasMoreElements()) {
String key = (String)names.nextElement();
if (key.startsWith("ImageId")) {
String[] value = request.getParameterValues(key);
if (null != value && 0 < value.length)
EC2request.addImageSet(value[0]);
}
}
// add filters
EC2Filter[] filterSet = extractFilters(request);
if (filterSet != null) {
EC2ImageFilterSet ifs = new EC2ImageFilterSet();
for (int i = 0; i < filterSet.length; i++) {
ifs.addFilter(filterSet[i]);
}
EC2request.setFilterSet(ifs);
}
// -> execute the request
EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
DescribeImagesResponse EC2response = EC2SoapServiceImpl.toDescribeImagesResponse(engine.describeImages(EC2request));
serializeResponse(response, EC2response);