CreateImageResponse EC2response = EC2SoapServiceImpl.toCreateImageResponse(ServiceProvider.getInstance().getEC2Engine().createImage(EC2request));
serializeResponse(response, EC2response);
}
private void registerImage(HttpServletRequest request, HttpServletResponse response) throws ADBException, XMLStreamException, IOException {
EC2RegisterImage EC2request = new EC2RegisterImage();
String[] location = request.getParameterValues("ImageLocation");
if (null != location && 0 < location.length)
EC2request.setLocation(location[0]);
else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing parameter - ImageLocation");
}
String[] cloudRedfined = request.getParameterValues("Architecture");
if (null != cloudRedfined && 0 < cloudRedfined.length)
EC2request.setArchitecture(cloudRedfined[0]);
else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - Architecture");
}
String[] name = request.getParameterValues("Name");
if (null != name && 0 < name.length)
EC2request.setName(name[0]);
else {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - Name");
}
String[] description = request.getParameterValues("Description");
if (null != description && 0 < description.length)
EC2request.setDescription(description[0]);
// -> execute the request
RegisterImageResponse EC2response = EC2SoapServiceImpl.toRegisterImageResponse(ServiceProvider.getInstance().getEC2Engine().registerImage(EC2request));
serializeResponse(response, EC2response);
}