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); } }
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); }
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); }
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); } } }
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); } } }
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"); } } } }
public void persistentRequestModified(final FcpPersistentGet downloadRequest) { if (downloadModelItems.containsKey(downloadRequest.getIdentifier())) { final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier()); applyPriority(dlItem, downloadRequest); } }
public void persistentRequestModified(final FcpPersistentPut uploadRequest) { if (uploadModelItems.containsKey(uploadRequest.getIdentifier())) { final FrostUploadItem ulItem = uploadModelItems.get(uploadRequest.getIdentifier()); ulItem.setPriority(uploadRequest.getPriority()); } }