// Path: acmeair-common/src/main/java/com/acmeair/entities/Flight.java
// public interface Flight{
// 
// 	
// 	String getFlightId();
// 	
// 	void setFlightId(String id);
// 	
// 	String getFlightSegmentId();
// 	
// 	FlightSegment getFlightSegment();
// 
// 	void setFlightSegment(FlightSegment flightSegment);
// 		
// 	Date getScheduledDepartureTime();
// 
// 	Date getScheduledArrivalTime();
// 
// 	BigDecimal getFirstClassBaseCost();
// 
// 
// 	BigDecimal getEconomyClassBaseCost();
// 
// 
// 	int getNumFirstClassSeats();
// 
// 
// 	int getNumEconomyClassSeats();
// 
// 
// 	String getAirplaneTypeId();
// 
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/entities/FlightSegment.java
// public interface FlightSegment {
// 	
// 	String getFlightName();
// 
// 	String getOriginPort();
// 
// 	String getDestPort();
// 
// 	int getMiles();
// 		
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/entities/AirportCodeMapping.java
// public interface AirportCodeMapping{
// 	
// 	
// 	String getAirportCode();
// 	
// 	void setAirportCode(String airportCode);
// 	
// 	String getAirportName();
// 	
// 	void setAirportName(String airportName);
// 
// }


import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.acmeair.entities.Flight;
import com.acmeair.entities.FlightSegment;
import com.acmeair.entities.AirportCodeMapping;

        return results;
    }

    @SuppressWarnings("deprecation")
    protected boolean inOneDay(Date date1, Date date2) {
        return (date1.getYear() == date2.getYear()) && (date1.getMonth() == date2.getMonth())
                && (date1.getDate() == date2.getDate());
    }
    
    // NOTE:  This is not cached
    public List<Flight> getFlightByAirports(String fromAirport, String toAirport) {
        FlightSegment segment = getFlightSegment(fromAirport, toAirport);
        if (segment == null) {
            return new ArrayList<Flight>();
        }
        return getFlightBySegment(segment, null);
    }

    protected abstract FlightSegment getFlightSegment(String fromAirport, String toAirport);

    protected abstract List<Flight> getFlightBySegment(FlightSegment segment, Date deptDate);

    public abstract void storeAirportMapping(AirportCodeMapping mapping);

    public abstract AirportCodeMapping createAirportCodeMapping(String airportCode, String airportName);

    public abstract Flight createNewFlight(String flightSegmentId,
            Date scheduledDepartureTime, Date scheduledArrivalTime,
            BigDecimal firstClassBaseCost, BigDecimal economyClassBaseCost,
// Path: acmeair-common/src/main/java/com/acmeair/entities/Flight.java
// public interface Flight{
// 
// 	
// 	String getFlightId();
// 	
// 	void setFlightId(String id);
// 	
// 	String getFlightSegmentId();
// 	
// 	FlightSegment getFlightSegment();
// 
// 	void setFlightSegment(FlightSegment flightSegment);
// 		
// 	Date getScheduledDepartureTime();
// 
// 	Date getScheduledArrivalTime();
// 
// 	BigDecimal getFirstClassBaseCost();
// 
// 
// 	BigDecimal getEconomyClassBaseCost();
// 
// 
// 	int getNumFirstClassSeats();
// 
// 
// 	int getNumEconomyClassSeats();
// 
// 
// 	String getAirplaneTypeId();
// 
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/entities/FlightSegment.java
// public interface FlightSegment {
// 	
// 	String getFlightName();
// 
// 	String getOriginPort();
// 
// 	String getDestPort();
// 
// 	int getMiles();
// 		
// }
// 
// Path: acmeair-common/src/main/java/com/acmeair/entities/AirportCodeMapping.java
// public interface AirportCodeMapping{
// 	
// 	
// 	String getAirportCode();
// 	
// 	void setAirportCode(String airportCode);
// 	
// 	String getAirportName();
// 	
// 	void setAirportName(String airportName);
// 
// }


// Path: acmeair-services/src/main/java/com/acmeair/service/FlightService.java
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.acmeair.entities.Flight;
import com.acmeair.entities.FlightSegment;
import com.acmeair.entities.AirportCodeMapping;


        return results;
    }

    @SuppressWarnings("deprecation")
    protected boolean inOneDay(Date date1, Date date2) {
        return (date1.getYear() == date2.getYear()) && (date1.getMonth() == date2.getMonth())
                && (date1.getDate() == date2.getDate());
    }
    
    // NOTE:  This is not cached
    public List<Flight> getFlightByAirports(String fromAirport, String toAirport) {
        FlightSegment segment = getFlightSegment(fromAirport, toAirport);
        if (segment == null) {
            return new ArrayList<Flight>();
        }
        return getFlightBySegment(segment, null);
    }

    protected abstract FlightSegment getFlightSegment(String fromAirport, String toAirport);

    protected abstract List<Flight> getFlightBySegment(FlightSegment segment, Date deptDate);

    public abstract void storeAirportMapping(AirportCodeMapping mapping);

    public abstract AirportCodeMapping createAirportCodeMapping(String airportCode, String airportName);

    public abstract Flight createNewFlight(String flightSegmentId,
            Date scheduledDepartureTime, Date scheduledArrivalTime,
            BigDecimal firstClassBaseCost, BigDecimal economyClassBaseCost,
            int numFirstClassSeats, int numEconomyClassSeats,