serializeResponse(response, EC2Response);
}
private void associateAddress(HttpServletRequest request, HttpServletResponse response) throws ADBException, XMLStreamException, IOException {
EC2Engine engine = ServiceProvider.getInstance().getEC2Engine();
String publicIp = request.getParameter("PublicIp");
if (null == publicIp) {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - PublicIp");
}
String instanceId = request.getParameter("InstanceId");
if (null == instanceId) {
throw new EC2ServiceException(ClientError.MissingParamter, "Missing required parameter - InstanceId");
}
EC2AssociateAddress ec2Request = new EC2AssociateAddress();
if (ec2Request != null) {
ec2Request.setInstanceId(instanceId);
ec2Request.setPublicIp(publicIp);
}
AssociateAddressResponse ec2Response = EC2SoapServiceImpl.toAssociateAddressResponse(engine.associateAddress(ec2Request));
serializeResponse(response, ec2Response);
}