Пример #1
0
 public void persistentRequestError(final String id, final NodeMessage nm) {
   if (uploadModelItems.containsKey(id)) {
     final FrostUploadItem item = uploadModelItems.get(id);
     item.setEnabled(false);
     item.setState(FrostUploadItem.STATE_FAILED);
     item.setErrorCodeDescription(nm.getStringValue("CodeDescription"));
   } else if (downloadModelItems.containsKey(id)) {
     final FrostDownloadItem item = downloadModelItems.get(id);
     item.setEnabled(false);
     item.setState(FrostDownloadItem.STATE_FAILED);
     item.setErrorCodeDescription(nm.getStringValue("CodeDescription"));
   } else {
     System.out.println("persistentRequestError: ID not in any model: " + id);
   }
 }
Пример #2
0
 public void persistentRequestRemoved(final FcpPersistentPut uploadRequest) {
   if (uploadModelItems.containsKey(uploadRequest.getIdentifier())) {
     final FrostUploadItem ulItem = uploadModelItems.get(uploadRequest.getIdentifier());
     if (ulItem.isExternal()) {
       SwingUtilities.invokeLater(
           new Runnable() {
             public void run() {
               List<FrostUploadItem> itemList = new ArrayList<FrostUploadItem>();
               itemList.add(ulItem);
               uploadModel.removeItems(itemList);
             }
           });
     } else {
       if (ulItem.isInternalRemoveExpected()) {
         ulItem.setInternalRemoveExpected(false); // clear flag
       } else if (ulItem.getState() != FrostUploadItem.STATE_DONE) {
         ulItem.setEnabled(false);
         ulItem.setState(FrostUploadItem.STATE_FAILED);
         ulItem.setErrorCodeDescription("Disappeared from global queue");
       }
     }
   }
 }