public static JwList<String> getNumbersFromWebKeys(JwList<String> webKeys) {
    JwList<String> v = new JwList<String>();
    if (webKeys == null) return v;
    if (webKeys.isEmpty()) return v;

    for (String e : webKeys) v.add(getNumberFromWebKey(e));
    return v;
  }
  public static JwList<Integer> getIdsFromWebKeys(JwList<String> webKeys) {
    JwList<Integer> v = new JwList<Integer>();
    if (webKeys == null) return v;
    if (webKeys.isEmpty()) return v;

    for (String e : webKeys) v.add(getIdFromWebKey(e));
    return v;
  }
 public JwList<AcUploadDownloadFile> getAllById(Collection<Integer> ids) {
   JwList<AcUploadDownloadFile> v = new JwList<AcUploadDownloadFile>();
   for (Integer id : ids) {
     JwSqlSelect st = getSelect();
     st.where().isEqual(ALIAS, ID, id);
     v.addAll(composeList(st));
   }
   return v;
 }
 private void addToAllByGlobalCoTerminusIdMap(AcGlobalCoTerminusAirport e) {
   Integer key = e.getGlobalCoTerminusId();
   JwList<AcGlobalCoTerminusAirport> v = _allByGlobalCoTerminusIdMap.get(key);
   if (v == null) {
     v = new JwList<AcGlobalCoTerminusAirport>();
     _allByGlobalCoTerminusIdMap.put(key, v);
   }
   v.add(e);
 }
 public JwList<AcGlobalAuditLog> getAllById(Collection<Integer> ids) {
   JwList<AcGlobalAuditLog> v = new JwList<AcGlobalAuditLog>();
   for (Integer id : ids) {
     JwSqlSelect st = getSelect();
     st.where().isEqual(ALIAS, ID, id);
     v.addAll(composeList(st));
   }
   return v;
 }
 private void initializeRemoteTargetDirectory() {
   JwFtpClient logFtpClient = null;
   try {
     logFtpClient = AcFtpClient.getLogFtpClient();
     JwList<String> v = logFtpClient.getDirectoryNames(getTargetRootPath());
     if (!v.contains(getLocalHostname())) logFtpClient.createDir(getTargetLogPath());
   } finally {
     if (logFtpClient != null) logFtpClient.close();
   }
 }
  private JwList<String> getLocalFilenames(String path) {
    File f = new File(path);
    if (!f.exists()) return new JwList<String>();

    JwList<String> v = new JwList<String>();
    for (File e : f.listFiles()) {
      if (e.isFile()) v.add(e.getName());
    }
    return v;
  }
  private AcEdiUpuResdit11ReceptacleList _createReceptacleList() {
    if (_receptacleLists.size() >= MAX_RECEPTACLE_LISTS)
      JwUtility.error(
          "Attempted to create %s when already at capacity.  Max capacity %s",
          JwUtility.formatShortClassName(AcEdiUpuResdit11ReceptacleList.class),
          MAX_RECEPTACLE_LISTS);

    AcEdiUpuResdit11ReceptacleList x = new AcEdiUpuResdit11ReceptacleList();
    _receptacleLists.add(x);
    return x;
  }
  public void run() {
    if (_currentLog == null) return;
    if (!isLogCopyEnabled()) return;

    initializeTargetDirectory();
    JwList<String> sourceFilenames = getSourceLogFilenames();
    if (sourceFilenames.isEmpty()) return;
    sourceFilenames.remove(_currentLog.getFilename());

    JwList<String> targetFilenames = getTargetLogFilenames();
    JwList<String> missingFilenames = getMissingFilenames(sourceFilenames, targetFilenames);
    copyMissingSourceLogsToTargetLogs(missingFilenames);
  }
 private JwList<AcScheduledFlightUploadErrorVo> fillErrors(JwList<AcScheduledFlightUpload> v) {
   JwList<AcScheduledFlightUploadErrorVo> r = new JwList<AcScheduledFlightUploadErrorVo>(v.size());
   // we need some sort of starting "date" - we don't care what it is or what timezone it uses
   JwDate date = AcGlobals.nowUtc().getDate().getCopy();
   JwMap<String, AcAirport> airportCache = new JwMap<String, AcAirport>();
   for (AcScheduledFlightUpload o : v) {
     AcScheduledFlightUploadErrorVo e = new AcScheduledFlightUploadErrorVo();
     e.setScheduledFlightUpload(o);
     validateDates(e);
     validateTimes(date, airportCache, e);
     r.add(e);
   }
   return r;
 }
 public void format(JwIndentWriter w) throws IOException {
   w.write(
       JwUtility.format(
           "       Receptacle Scan Type: %s\n", _scanType != null ? _scanType.toString() : null));
   w.write(JwUtility.format("Receptacle Container Number: %s\n", _containerNumber));
   w.write(JwUtility.format("      Receptacle List Count: %s\n", _receptacleLists.size()));
   formatReceptacleLists(w);
 }
  private void copyMissingSourceLogsToTargetLogs(JwList<String> missingFilenames) {
    if (missingFilenames.isEmpty()) return;

    String targetPath = getTargetLogPath();
    String sourcePath = getSourceLogPath();
    if (isFtpEnabled()) ftpMissingLogs(missingFilenames, targetPath, sourcePath);
    else copyMissingLogs(missingFilenames, targetPath, sourcePath);
  }
 public void insertAll(
     JwList<AcScheduledFlightUpload> v,
     boolean insertIds,
     boolean generateIds,
     String onDupColumn) {
   JwList<JwList<AcScheduledFlightUpload>> groups = v.splitByGroupSize(getBatchInsertGroupSize());
   for (JwList<AcScheduledFlightUpload> g : groups)
     _insertAll(g, insertIds, generateIds, onDupColumn);
 }
 public JwList<AcGlobalCoTerminusAirport> getAllByGlobalCoTerminusId(Integer globalCoTerminusId) {
   lock();
   try {
     Integer key = globalCoTerminusId;
     JwList<AcGlobalCoTerminusAirport> v = getAllByGlobalCoTerminusIdMap().get(key);
     if (v == null) return JwList.createEmpty();
     return v;
   } finally {
     unlock();
   }
 }
  public boolean validate(ScServletData data) {
    if (hasDegreesError(data)
        || hasMinutesError(data)
        || hasSecondsError(data)
        || hasDirectionError(data)) {
      String msg = "Cannot parse value.";
      String sample = getSampleFormat();
      if (sample != null) msg += "  Sample: " + sample;
      getState(data).addError(msg);
      return false;
    }

    if (_validator == null) return true;

    JwList<JwErrorIF> errors = new JwList<JwErrorIF>();
    _validator.validate(getValue(data), errors);
    if (errors.isEmpty()) return true;

    getState(data).setErrors(errors);
    return false;
  }
 public JwSqlInsert _checkAndComposeInsert(AcDomesticCandidateRouteTmp e) {
   JwList<AcDomesticCandidateRouteTmp> v;
   v = new JwList<AcDomesticCandidateRouteTmp>();
   v.add(e);
   return _checkAndComposeInsert(v);
 }
 public void add(AcEdiUpuResdit11ReceptacleList x) {
   _receptacleLists.add(x);
 }
 public void insertAll(JwList<AcDomesticCandidateRouteTmp> v) {
   JwList<JwList<AcDomesticCandidateRouteTmp>> groups =
       v.splitByGroupSize(getBatchInsertGroupSize());
   String onDupColumn = null;
   for (JwList<AcDomesticCandidateRouteTmp> g : groups) _insertAll(g, onDupColumn);
 }
 public void insertAllOnDuplicateKeyUpdateColumnNoChange(
     JwList<AcDomesticCandidateRouteTmp> v, String onDupColumn) {
   JwList<JwList<AcDomesticCandidateRouteTmp>> groups =
       v.splitByGroupSize(getBatchInsertGroupSize());
   for (JwList<AcDomesticCandidateRouteTmp> g : groups) _insertAll(g, onDupColumn);
 }
 // collect ids in order given
 public static JwList<Integer> collectScheduledFlightCalendarIds(
     JwList<AcMultiSectorScheduledFlightLeg> v) {
   JwList<Integer> ids = new JwList<Integer>();
   for (AcMultiSectorScheduledFlightLeg e : v) ids.add(e.getScheduledFlightCalendarId());
   return ids;
 }
 public void insertAll(
     JwList<AcUploadDownloadFile> v, boolean insertIds, boolean generateIds, String onDupColumn) {
   JwList<JwList<AcUploadDownloadFile>> groups = v.splitByGroupSize(getBatchInsertGroupSize());
   for (JwList<AcUploadDownloadFile> g : groups)
     _insertAll(g, insertIds, generateIds, onDupColumn);
 }
Esempio n. 22
0
 public JwSqlInsert _checkAndComposeInsert(AcMobileProfile e) {
   JwList<AcMobileProfile> v;
   v = new JwList<AcMobileProfile>();
   v.add(e);
   return _checkAndComposeInsert(v);
 }
 private void loadAllAvailableList() {
   Collection<AcGlobalTimeZone> v = getMap().values();
   _allAvailableList = new JwList<AcGlobalTimeZone>();
   for (AcGlobalTimeZone e : v) if (e.isAvailable()) _allAvailableList.add(e);
   _allAvailableList.setReadOnly();
 }
Esempio n. 24
0
 public void insertAllOnDuplicateKeyUpdateColumnNoChange(
     JwList<AcMobileProfile> v, String onDupColumn) {
   JwList<JwList<AcMobileProfile>> groups = v.splitByGroupSize(getBatchInsertGroupSize());
   for (JwList<AcMobileProfile> g : groups) _insertAll(g, onDupColumn);
 }
Esempio n. 25
0
 public void insertAll(JwList<AcMobileProfile> v) {
   JwList<JwList<AcMobileProfile>> groups = v.splitByGroupSize(getBatchInsertGroupSize());
   String onDupColumn = null;
   for (JwList<AcMobileProfile> g : groups) _insertAll(g, onDupColumn);
 }
 public JwSqlInsert _checkAndComposeInsert(AcUploadDownloadFile e) {
   JwList<AcUploadDownloadFile> v;
   v = new JwList<AcUploadDownloadFile>();
   v.add(e);
   return _checkAndComposeInsert(v, false);
 }
 public boolean hasCapacityForTag() {
   if (_receptacleLists.size() < MAX_RECEPTACLE_LISTS) return true;
   else if (_receptacleLists.size() == MAX_RECEPTACLE_LISTS) return _activeListHasCapacity();
   return false;
 }
 public int getEstimatedSegmentCount() {
   return SEGMENT_COUNT + _receptacleLists.size();
 }
 public boolean composeSg5(AcEdiSegmentAbstract segment, JwList<AcEdiSegmentAbstract> segments) {
   AcEdiUpuResdit10Sg5Model sg5Model = new AcEdiUpuResdit10Sg5Model();
   sg5Model.compose(segment, segments);
   _sg5Models.add(sg5Model);
   return true;
 }
 public AcEdiUpuResdit11ReceptacleList get(int arg0) {
   return _receptacleLists.get(arg0);
 }