// 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;
/*******************************************************************************
* Copyright (c) 2013-2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.acmeair.service;



public abstract class FlightService {
    protected Logger logger = Logger.getLogger(FlightService.class.getName());

    //TODO:need to find a way to invalidate these maps
    protected static ConcurrentHashMap<String, FlightSegment> originAndDestPortToSegmentCache =
        new ConcurrentHashMap<String, FlightSegment>();

// 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;

/*******************************************************************************
* Copyright (c) 2013-2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package com.acmeair.service;



public abstract class FlightService {
    protected Logger logger = Logger.getLogger(FlightService.class.getName());

    //TODO:need to find a way to invalidate these maps
    protected static ConcurrentHashMap<String, FlightSegment> originAndDestPortToSegmentCache =
        new ConcurrentHashMap<String, FlightSegment>();

    protected static ConcurrentHashMap<String, List<Flight>> flightSegmentAndDataToFlightCache =