private void checkInputChannel(AcInputChannel channel) {
    JwTimestamp end = _now.getCopy();
    JwTimestamp start = end.getCopy();
    start.subtractMinutes(channel.getMonitorMinutes());

    JwList<AcReceivedFileRollup> v = getRollupData(channel, start, end);

    if (noCarditReceived(v) && noActiveAlertFor(channel)) {
      createAlert(channel);
      reportNoCarditProcessed(channel, start, end);
    }
  }
  protected JwList<AcUspsInternationalNominatedRoute> getInternationalNominatedRoutes(
      JwDate startUtcDt,
      JwDate endUtcDt,
      String contract,
      String originAirport,
      String destinationAirport,
      String flightNumber) {
    AcPageSession ps = getPageSession();
    Integer i = ps.getInternationalNominatedRouteSummaryDuration();
    JwTimestamp ts = AcGlobals.nowUtc().getCopy();
    ts.subtractHours(i);

    return getUspsInternationalNominatedRouteService()
        .getNewByBlockBeginEndCreatedUtcTsOnOrAfter(
            startUtcDt, endUtcDt, contract, originAirport, destinationAirport, flightNumber, ts);
  }
 public int hashCode() {
   return (_originalInvoiceNumber != null ? _originalInvoiceNumber.hashCode() : 0)
       ^ (_carrierCode != null ? _carrierCode.hashCode() : 0)
       ^ (_carrierName != null ? _carrierName.hashCode() : 0)
       ^ (_scheduledInvoiceTs != null ? _scheduledInvoiceTs.hashCode() : 0)
       ^ (_contractNumber != null ? _contractNumber.hashCode() : 0)
       ^ (_region != null ? _region.hashCode() : 0);
 }
  private boolean activeAlerts(JwList<AcReceivedFileAlert> v) {
    for (AcReceivedFileAlert alert : v)
      if (_now.isBefore(alert.getExpirationUtcTs())) {
        debug("Received file alert is already active.");
        return true;
      }

    debug("No received file alerts are active.");
    return false;
  }
Exemple #5
0
 public void emitGenerated(JwCsvBuffer b) {
   if (getState().getExportTimestamp()) {
     b.addField("Report Generated (UTC)");
     ScServletData data = ScServletData.getLocal();
     JwTimestampPolicy tp = data.getPreferredTimestampPolicy();
     b.addField(JwTimestamp.createNowUtc(), tp);
     b.endRecord();
     b.endRecord();
   }
 }
  public void preRender() {
    AcPageSession ps = getPageSession();
    JwDate startUtcDt = ps.getInternationalRouteBlockStartUtcDt();
    JwDate endUtcDt = ps.getInternationalRouteBlockEndUtcDt();
    AcGlobalUspsInternationalSubmissionBlock block = getBlock(startUtcDt, endUtcDt);

    Integer sourceId = ps.getInternationalRequestedRouteSourceId();
    String originAirport = ps.getInternationalRequestedRouteDetailsOriginAirportCode();
    String destinationAirport = ps.getInternationalRequestedRouteDetailsDestinationAirportCode();
    JwTime departureLocalTm = ps.getInternationalRequestedRouteDetailsDepartureLocalTm();
    JwTimestamp departureLocalTs = new JwTimestamp();
    departureLocalTs.setTime(departureLocalTm);
    JwTime arrivalLocalTm = ps.getInternationalRequestedRouteDetailsArrivalLocalTm();
    JwTimestamp arrivalLocalTs = new JwTimestamp();
    arrivalLocalTs.setTime(arrivalLocalTm);
    JwList<AcUspsInternationalRequestedRoute> v =
        getInternationalRequestedRoutes(
            sourceId,
            startUtcDt,
            endUtcDt,
            originAirport,
            destinationAirport,
            departureLocalTm,
            arrivalLocalTm);

    boolean hasBlock = block != null;
    _blockTitle.setVisible(hasBlock);
    _blockTitle.applyModel(block);
    _dateTitle.setVisible(!hasBlock);
    _dateStart.setValue(startUtcDt);
    _dateEnd.setValue(endUtcDt);

    _originAirport.setValue(originAirport);
    _destinationAirport.setValue(destinationAirport);
    _departureLocalTm.setValue(departureLocalTs);
    _arrivalLocalTm.setValue(arrivalLocalTs);

    _grid.setList(v);
  }
  private void validateTimes(
      JwDate date, JwMap<String, AcAirport> airportCache, AcScheduledFlightUploadErrorVo e) {
    JwDate date2 = date.getCopy();
    date2.addDays(e.getScheduledFlightUploadDayOffset());

    JwTimestamp departLocalTs =
        JwTimestamp.createTimestamp(date, e.getScheduledFlightUploadDepartureLocalTm());
    JwTimestamp arriveLocalTs =
        JwTimestamp.createTimestamp(date2, e.getScheduledFlightUploadArrivalLocalTm());

    AcAirport originAirport =
        getAirport(airportCache, e.getScheduledFlightUploadOriginAirportCode());
    AcAirport destAirport =
        getAirport(airportCache, e.getScheduledFlightUploadDestinationAirportCode());

    JwTimestamp departUtcTs = originAirport.toUtc(departLocalTs);
    if (departUtcTs == null) departUtcTs = departLocalTs;
    JwTimestamp arriveUtcTs = destAirport.toUtc(arriveLocalTs);
    if (arriveUtcTs == null) arriveUtcTs = arriveLocalTs;

    if (departUtcTs.isAfter(arriveUtcTs)) e.addError("Invalid Depart/Arrive time combination");
  }
 private JwTimestamp getAlertExpiration() {
   JwTimestamp expires = _now.getCopy();
   expires.addMinutes(_alertExpirationMinutes);
   return expires;
 }
 public void setReadOnly(boolean b) {
   super.setReadOnly(b);
   if (_lastModifiedUtcTs != null) _lastModifiedUtcTs.setReadOnly(b);
   if (_frequency != null) _frequency.setReadOnly(b);
   if (_capacity != null) _capacity.setReadOnly(b);
 }
 public void setReadOnly(boolean b) {
   super.setReadOnly(b);
   if (_completionTs != null) _completionTs.setReadOnly(b);
 }