Package ek.core.flightevent.FlightEvent

Examples of ek.core.flightevent.FlightEvent.FlightId


    public void removeFlight(FlightId flightId) {
      if (_globalFlightEvent != null) {
        Iterator<FlightEvent> cacheIter = _globalFlightEvent.iterator();
        while (cacheIter.hasNext()) {
          FlightEvent event = cacheIter.next();
          FlightId id = event.getFlightId();
          if (id.getCxCd().equals(flightId.getCxCd())
              && id.getFltNum().equals(flightId.getFltNum())
              && id.getFltDate().getValue().equals(flightId.getFltDate().getValue())
              && id.getDepStn().equals(flightId.getDepStn())
              && id.getArrStn().equals(flightId.getArrStn())) {
            if (flightId.getFltSuffix() != null
                  && flightId.getFltSuffix().equals(id.getFltSuffix())) {
              cacheIter.remove();
            } else if (flightId.getFltSuffix() == id.getFltSuffix()) {
              cacheIter.remove();
            }
          }
        }
        // FlightEvent need to override the hashcode and equal method using flightId
View Full Code Here


      LOG.info("Loading EK flights into cahce from afttab...");
      List<EntDbAfttab> result = query.getResultList();
      if (result != null && result.size() > 0) {
        LOG.info("{} EK flight record found", result.size());
        FlightEvent flight = null;
        FlightId flightId = null;
        FltDate fltDate = null;
        HpUfisCalendar ufisCalendar = new HpUfisCalendar();
        ufisCalendar.setCustomFormat("yyyyMMdd");
        for (EntDbAfttab entity : result) {
          flight = new FlightEvent();
          flightId = new FlightId();
          fltDate = new FltDate();
          // carrier, boardpoint, destination, flight date, suffix
          flightId.setCxCd(entity.getAlc2() == null ? entity.getAlc3() : entity.getAlc2());
          flightId.setDepStn(entity.getOrg3());
          flightId.setArrStn(entity.getDes3());
          if (HpUfisUtils.isNotEmptyStr(entity.getFlda())) {
            ufisCalendar.setTime(entity.getFlda(), ufisCalendar.getCustomFormat());
            fltDate.setValue(HpUfisUtils.chgDateToXMLGregorianCalendar(ufisCalendar.getTime()));
            flightId.setFltDate(fltDate);
          }
          flightId.setFltNum(entity.getFltn());
          if (entity.getFlns() != null
              && !"".equals(String.valueOf(entity.getFlns()).trim())) {
            flightId.setFltSuffix(String.valueOf(entity.getFlns()));
          }
          flight.setFlightId(flightId);
          globalFlightEvent.add(flight);
        }
      }
View Full Code Here

TOP

Related Classes of ek.core.flightevent.FlightEvent.FlightId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.