package com.ferienclub.leisure.esb;

import org.apache.log4j.Logger;

import com.ferienclub.leisure.esb.messages.BookingRequest;

public class CarRentalGateway {

	Logger log = Logger.getLogger(CarRentalGateway.class);
	
	public void rentCar(BookingRequest req){
		try {
			if (req.isWantCar()) {
				log.info("Renting a car for user: " + req.getUserId());
				req.setCarSuccessful(true);
			} else {
				log.info("User: " + req.getUserId() + " doesn't want a car.");
			}
		} catch (Exception e){
			log.info("Exception during car rental!");
			e.printStackTrace();
		}
		
	}
	
}
