Exemplo n.º 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);
   }
 }
Exemplo n.º 2
0
 public void persistentRequestUpdated(final FcpPersistentGet downloadRequest) {
   final FrostDownloadItem dl = downloadModelItems.get(downloadRequest.getIdentifier());
   if (dl == null) {
     // not (yet) in our model
     return;
   }
   applyState(dl, downloadRequest);
 }
Exemplo n.º 3
0
 public void persistentRequestUpdated(final FcpPersistentPut uploadRequest) {
   final FrostUploadItem ui = uploadModelItems.get(uploadRequest.getIdentifier());
   if (ui == null) {
     // not (yet) in our model
     return;
   }
   applyState(ui, uploadRequest);
 }
Exemplo n.º 4
0
 public void persistentRequestAdded(final FcpPersistentGet downloadRequest) {
   final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier());
   if (dlItem != null) {
     // own item added to global queue, or existing external item
     applyState(dlItem, downloadRequest);
   } else {
     if (showExternalItemsDownload) {
       addExternalItem(downloadRequest);
     }
   }
 }
Exemplo n.º 5
0
 public void persistentRequestAdded(final FcpPersistentPut uploadRequest) {
   final FrostUploadItem ulItem = uploadModelItems.get(uploadRequest.getIdentifier());
   if (ulItem != null) {
     // own item added to global queue, or existing external item
     applyState(ulItem, uploadRequest);
   } else {
     if (showExternalItemsUpload) {
       addExternalItem(uploadRequest);
     }
   }
 }
Exemplo n.º 6
0
 public void persistentRequestRemoved(final FcpPersistentGet downloadRequest) {
   if (downloadModelItems.containsKey(downloadRequest.getIdentifier())) {
     final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier());
     if (dlItem.isExternal()) {
       SwingUtilities.invokeLater(
           new Runnable() {
             public void run() {
               List<FrostDownloadItem> itemList = new ArrayList<FrostDownloadItem>();
               itemList.add(dlItem);
               downloadModel.removeItems(itemList);
             }
           });
     } else {
       if (dlItem.isInternalRemoveExpected()) {
         dlItem.setInternalRemoveExpected(false); // clear flag
       } else if (dlItem.getState() != FrostDownloadItem.STATE_DONE) {
         dlItem.setEnabled(false);
         dlItem.setState(FrostDownloadItem.STATE_FAILED);
         dlItem.setErrorCodeDescription("Disappeared from global queue");
       }
     }
   }
 }
Exemplo n.º 7
0
 public void persistentRequestModified(final FcpPersistentGet downloadRequest) {
   if (downloadModelItems.containsKey(downloadRequest.getIdentifier())) {
     final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier());
     applyPriority(dlItem, downloadRequest);
   }
 }
Exemplo n.º 8
0
 public void persistentRequestModified(final FcpPersistentPut uploadRequest) {
   if (uploadModelItems.containsKey(uploadRequest.getIdentifier())) {
     final FrostUploadItem ulItem = uploadModelItems.get(uploadRequest.getIdentifier());
     ulItem.setPriority(uploadRequest.getPriority());
   }
 }