// Path: acmeair-customer-common/src/main/java/com/acmeair/entities/CustomerSession.java
// public interface CustomerSession {
// 
// 	String SESSIONID_COOKIE_NAME = "sessionid";
// 
// 	String getId();
// 
// 
// 	String getCustomerid();
// 
// 
// 	Date getLastAccessedTime();
// 	
// 
// 	Date getTimeoutTime();
// 
// 	
// }


import java.util.Calendar;
import java.util.Date;
import javax.inject.Inject;
import com.acmeair.entities.Customer;
import com.acmeair.entities.CustomerSession;
	@Override
	public Customer getCustomerByUsername(String username) {
		Customer c = getCustomer(username);
		if (c != null) {
			c.setPassword(null);
		}
		return c;
	}

	@Override
	public boolean validateCustomer(String username, String password) {
		boolean validatedCustomer = false;
		Customer customerToValidate = getCustomer(username);
		if (customerToValidate != null) {
			validatedCustomer = password.equals(customerToValidate.getPassword());
		}
		return validatedCustomer;
	}
	
	@Override
	public Customer getCustomerByUsernameAndPassword(String username, String password) {
		Customer c = getCustomer(username);
		if (c != null && !c.getPassword().equals(password)) {
			return null;
		}
		// Should we also set the password to null?
		return c;
	}
		
	@Override
// Path: acmeair-customer-common/src/main/java/com/acmeair/entities/CustomerSession.java
// public interface CustomerSession {
// 
// 	String SESSIONID_COOKIE_NAME = "sessionid";
// 
// 	String getId();
// 
// 
// 	String getCustomerid();
// 
// 
// 	Date getLastAccessedTime();
// 	
// 
// 	Date getTimeoutTime();
// 
// 	
// }


// Path: acmeair-customer-service/src/main/java/com/acmeair/service/CustomerServiceSupport.java
import java.util.Calendar;
import java.util.Date;
import javax.inject.Inject;
import com.acmeair.entities.Customer;
import com.acmeair.entities.CustomerSession;

	@Override
	public Customer getCustomerByUsername(String username) {
		Customer c = getCustomer(username);
		if (c != null) {
			c.setPassword(null);
		}
		return c;
	}

	@Override
	public boolean validateCustomer(String username, String password) {
		boolean validatedCustomer = false;
		Customer customerToValidate = getCustomer(username);
		if (customerToValidate != null) {
			validatedCustomer = password.equals(customerToValidate.getPassword());
		}
		return validatedCustomer;
	}
	
	@Override
	public Customer getCustomerByUsernameAndPassword(String username, String password) {
		Customer c = getCustomer(username);
		if (c != null && !c.getPassword().equals(password)) {
			return null;
		}
		// Should we also set the password to null?
		return c;
	}
		
	@Override
	public CustomerSession validateSession(String sessionid) {