Examples of FreenetPriority


Examples of frost.fileTransfer.FreenetPriority

            return;
        }
        final boolean itemIsEnabled = (ulItem.isEnabled() == null ? true : ulItem.isEnabled().booleanValue());
        List<FrostUploadItem> frostUploadItems = new ArrayList<FrostUploadItem>();
        frostUploadItems.add(ulItem);
        FreenetPriority prio = FreenetPriority.PAUSE;
        if( itemIsEnabled ) {
            prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_FILE_UPLOAD));
        }
        panel.changeItemPriorites(frostUploadItems, prio);
    }
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

    private void assignHotkeys() {

      // assign keys 1-6 - set priority of selected items
      final Action setPriorityAction = new AbstractAction() {
        public void actionPerformed(final ActionEvent event) {
          final FreenetPriority prio = FreenetPriority.getPriority( new Integer(event.getActionCommand()));
          final List<FrostUploadItem> selectedItems = modelTable.getSelectedItems();
          changeItemPriorites(selectedItems, prio);
        }
      };
      getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_1, 0), "SETPRIO");
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

            // use the shared socket
            if (doLogging) {
                System.out.println("GET_START(S)("+cnt+"):"+key);
            }
            final String id = "get-" + FcpSocket.getNextFcpId();
            final FreenetPriority prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD));
            final MessageTransferTask task = new MessageTransferTask(id, key, targetFile, prio, maxSize, maxRetries);

            // enqueue task
            msgTransferConnection.enqueueTask(task);
            // wait for task to finish
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

            // use the shared socket
            if (doLogging) {
                System.out.println("PUT_START(S)("+cnt+"):"+key);
            }
            final String id = "get-" + FcpSocket.getNextFcpId();
            final FreenetPriority prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD));
            final MessageTransferTask task = new MessageTransferTask(id, key, sourceFile, prio);

            // enqueue task
            msgTransferConnection.enqueueTask(task);
            // wait for task to finish
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

  private void assignHotkeys() {

    // assign keys 1-6 - set priority of selected items
    final Action setPriorityAction = new AbstractAction() {
      public void actionPerformed(final ActionEvent event) {
        final FreenetPriority prio = FreenetPriority.getPriority(new Integer(event.getActionCommand()).intValue());
        final List<FrostDownloadItem> selectedItems = modelTable.getSelectedItems();
        changeItemPriorites(selectedItems, prio);
       
      }
    };
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

        }
    }
    protected void onPersistentRequestModified(final String id, final NodeMessage nm) {
        // check if the priorityClass changed, ignore other changes
        if( nm.isValueSet("PriorityClass") ) {
            final FreenetPriority newPriorityClass = FreenetPriority.getPriority(nm.getIntValue("PriorityClass"));
            if( downloadRequests.containsKey(id) ) {
                final FcpPersistentGet pg = downloadRequests.get(id);
                pg.setPriority(newPriorityClass);
                persistenceHandler.persistentRequestModified(pg);
            } else if( uploadRequests.containsKey(id) ) {
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

      return;
    }
   
    final boolean itemIsEnabled = (dlItem.isEnabled() == null ? true
        : dlItem.isEnabled().booleanValue());
    FreenetPriority prio = FreenetPriority.PAUSE;
    if (itemIsEnabled) {
      prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_FILE_DOWNLOAD));
    }
   
    List<FrostDownloadItem> frostDownloadItems = new ArrayList<FrostDownloadItem>();
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

            msg.add("TempFilename=" + ddaTempFile.getAbsolutePath());
         } else {
             msg.add("ReturnType=direct");
        }

        final FreenetPriority prio;
        if( type == FcpHandler.TYPE_FILE ) {
          if( dlItem != null) {
            prio = dlItem.getPriority();
          } else {
            prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_FILE_DOWNLOAD));
          }
       
        } else if( type == FcpHandler.TYPE_MESSAGE ) {
            prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_DOWNLOAD));

        } else {
          if( dlItem != null) {
            prio = dlItem.getPriority();
          } else {
            prio = FreenetPriority.MEDIUM; // fallback
          }
        }
        msg.add("PriorityClass=" + prio.getNumber());

        if( maxSize > 0 ) {
            msg.add("MaxSize=" + Integer.toString(maxSize));
        }
View Full Code Here

Examples of frost.fileTransfer.FreenetPriority

        }
    if( getChkOnly ) {
        msg.add("GetCHKOnly=true");
        msg.add("PriorityClass=3");
    } else {
            final FreenetPriority prio;
            if( type == FcpHandler.TYPE_FILE ) {
              if (doMime) {
                  msg.add("Metadata.ContentType=" + DefaultMIMETypes.guessMIMEType(sourceFile.getAbsolutePath()));
              } else {
                  msg.add("Metadata.ContentType=application/octet-stream"); // force this to prevent the node from filename guessing due dda!
              }
              if( ulItem != null) {
                prio = ulItem.getPriority();
              } else {
                prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_FILE_UPLOAD));
              }
            } else if( type == FcpHandler.TYPE_MESSAGE ) {
                prio = FreenetPriority.getPriority(Core.frostSettings.getIntValue(SettingsClass.FCP2_DEFAULT_PRIO_MESSAGE_UPLOAD));
            } else {
              if( ulItem != null) {
                prio = ulItem.getPriority();
              } else {
                prio = FreenetPriority.MEDIUM;
              }
            }
            msg.add("PriorityClass=" + prio.getNumber());
        }

    msg.add("Persistence=connection");

        if (useDDA) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.