Ejemplo 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);
   }
 }
Ejemplo n.º 2
0
 private void showExternalDownloadItems() {
   final Map<String, FcpPersistentGet> items = persistentQueue.getDownloadRequests();
   for (final FcpPersistentGet downloadRequest : items.values()) {
     if (!downloadModelItems.containsKey(downloadRequest.getIdentifier())) {
       addExternalItem(downloadRequest);
     }
   }
 }
Ejemplo n.º 3
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");
       }
     }
   }
 }
Ejemplo n.º 4
0
 public void persistentRequestModified(final FcpPersistentGet downloadRequest) {
   if (downloadModelItems.containsKey(downloadRequest.getIdentifier())) {
     final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier());
     applyPriority(dlItem, downloadRequest);
   }
 }
Ejemplo n.º 5
0
 public void persistentRequestModified(final FcpPersistentPut uploadRequest) {
   if (uploadModelItems.containsKey(uploadRequest.getIdentifier())) {
     final FrostUploadItem ulItem = uploadModelItems.get(uploadRequest.getIdentifier());
     ulItem.setPriority(uploadRequest.getPriority());
   }
 }