Package org.gudy.azureus2.plugins

Examples of org.gudy.azureus2.plugins.PluginConfig


    /**
     * Returns the user set status of whether or not the plugin should autoOpen
     * @return boolean autoOpen
     */
    public static boolean isPluginAutoOpen(){
        PluginConfig config_getter = getPluginInterface().getPluginconfig();
        return config_getter.getPluginBooleanParameter("azcatdest_auto_open",false);
    }
View Full Code Here


        apply.setText(" OK ");
        apply.addListener(SWT.Selection, new Listener(){
            public void handleEvent(Event e)
            {
                try {
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_T1_Numbers",number.getSelection());
                    config.setPluginParameter("Stuffer_T1_Time",time.getSelection());
                    config.setPluginParameter("Stuffer_T1_Client",client.getSelection());
                    config.setPluginParameter("Stuffer_T1_Client_id",client_id.getSelection());
                    config.setPluginParameter("Stuffer_T1_Torrent",torrent.getSelection());
                    config.save();
                   
                    //redraw the table
                    if(Plugin.getTab1() != null)
                        Plugin.getTab1().draw_table1();
                   
View Full Code Here

        apply.setText(" OK ");
        apply.addListener(SWT.Selection, new Listener(){
            public void handleEvent(Event e)
            {
                try {
                    PluginConfig config = Plugin.getPluginInterface().getPluginconfig();
                    config.setPluginParameter("Stuffer_T2_Numbers",number.getSelection());
                    config.setPluginParameter("Stuffer_T2_Time",time.getSelection());               
                    config.setPluginParameter("Stuffer_T2_Client_ip",client_ip.getSelection());
                    config.setPluginParameter("Stuffer_T2_Manual",manual.getSelection());
                    config.save();
                } catch (PluginException e1) {
                    e1.printStackTrace();
                }
                if(Plugin.getTab1() != null)
                    Plugin.getTab1().draw_peer_remove_table();
View Full Code Here

    try{
      byte[]  search_key = ((DDBaseKeyImpl)key).getBytes();
     
      Download   download = null;
       
      PluginInterface pi = PluginInitializer.getDefaultInterface();
                 
      String  search_sha1 = pi.getUtilities().getFormatters().encodeBytesToString( search_key );
     
      if ( ta_sha1 == null ){
       
        ta_sha1 = pi.getTorrentManager().getPluginAttribute( "DDBaseTTTorrent::sha1");
      }
       
        // gotta look for the sha1(hash)
     
      Download[]  downloads = pi.getDownloadManager().getDownloads();
     
      for (int i=0;i<downloads.length;i++){
       
        Download  dl = downloads[i];
       
        if ( dl.getTorrent() == null ){
         
          continue;
        }
       
        String  sha1 = dl.getAttribute( ta_sha1 );
       
        if ( sha1 == null ){
         
          sha1 = pi.getUtilities().getFormatters().encodeBytesToString(
                new SHA1Simple().calculateHash( dl.getTorrent().getHash()));
         
          dl.setAttribute( ta_sha1, sha1 );
        }
       
        if ( sha1.equals( search_sha1 )){
         
          download  = dl;
                   
          break;
        }
      }
       
      if ( download == null ){
       
        synchronized( this ){
         
          if ( external_downloads != null ){
           
            for (int i=0;i<external_downloads.size();i++){
             
              Download  dl = (Download)external_downloads.get(i);
             
              if ( dl.getTorrent() == null ){
               
                continue;
              }
             
              String  sha1 = dl.getAttribute( ta_sha1 );
             
              if ( sha1 == null ){
               
                sha1 = pi.getUtilities().getFormatters().encodeBytesToString(
                      new SHA1Simple().calculateHash( dl.getTorrent().getHash()));
               
                dl.setAttribute( ta_sha1, sha1 );
              }
             
              if ( sha1.equals( search_sha1 )){
               
                download  = dl;
                         
                break;
              }
            }
          }
        }
      }
     
      String  originator = contact.getName();
     
      if ( download == null ){
       
        String msg = "TorrentDownload: request from " + originator + " for '" + pi.getUtilities().getFormatters().encodeBytesToString( search_key ) + "' not found";
       
        if ( TRACE ){
         
          System.out.println( msg );
        }
View Full Code Here

  private long last_recheck_time;
 
  protected UpdateMonitor(AzureusCore _azureus_core) {
    azCore = _azureus_core;

    PluginInterface defPI = PluginInitializer.getDefaultInterface();
    UpdateManager um = defPI.getUpdateManager();

    um.addListener(new UpdateManagerListener() {
      public void checkInstanceCreated(UpdateCheckInstance instance) {
        instance.addListener(UpdateMonitor.this);
       
View Full Code Here

        {
          public void
          handleEvent(Event event)
          {
            try{
              PluginInterface pi = AzureusCoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface();
             
              UpdateInstaller installer = pi.getUpdateManager().createInstaller();
           
              installer.addMoveAction(
                "C:\\temp\\file1", "C:\\temp\\file2" );
           
              installer.installNow(
View Full Code Here

      ci.out.println();
      return;
    }
   
    String plugin_id = (String)args.get(1);
    PluginInterface plugin = ci.getCore().getPluginManager().getPluginInterfaceByID(plugin_id, false);
    if (plugin == null) {
      ci.out.println("Invalid plugin ID: " + plugin_id);
      ci.out.println();
      return;
    }
   
    if (subcmd.equals("status")) {
      ci.out.println("ID     : " + plugin.getPluginID());
      ci.out.println("Name   : " + plugin.getPluginName());
      ci.out.println("Version: " + plugin.getPluginVersion());
      ci.out.println("Running: " + plugin.getPluginState().isOperational());
      ci.out.println("Runs at startup: " + plugin.getPluginState().isLoadedAtStartup());
      if (!plugin.getPluginState().isBuiltIn()) {
        ci.out.println("Location: " + plugin.getPluginDirectoryName());
      }
      ci.out.println();
      return;
    }
   
    if (subcmd.equals("startup")) {
      if (args.size() == 2) {
        ci.out.println("Need to pass either \"on\" or \"off\"");
        ci.out.println();
        return;
      }
      String enabled_mode = (String)args.get(2);
      if (enabled_mode.equals("on")) {
        plugin.getPluginState().setLoadedAtStartup(true);
      }
      else if (enabled_mode.equals("off")) {
        plugin.getPluginState().setLoadedAtStartup(false);
      }
      else {
        ci.out.println("Need to pass either \"on\" or \"off\"");
        ci.out.println();
        return;
View Full Code Here

   
  List  items = getSelectedItems();
 
    if (items.size() > 0) {
   
      PluginInterface pi = PluginInitializer.getDefaultInterface();

      org.gudy.azureus2.plugins.download.DownloadManager  dm     = pi.getDownloadManager();

      remove = true;
     
      for (int i=0; i < items.size(); i++){       
      
View Full Code Here

    List  items = getSelectedItems();
    if (items.size() == 0) {
      return;
    }
 
    PluginInterface pi = PluginInitializer.getDefaultInterface();
     
    org.gudy.azureus2.plugins.download.DownloadManager  dm     = pi.getDownloadManager();
     
    Tracker      tracker = pi.getTracker();
     

      for (int i=0;i<items.size();i++){
       
        ShareItem  item = (ShareItem)items.get(i);
View Full Code Here

  protected void
  showDHTStats(
    ConsoleInput  ci )
  {
    try{
      PluginInterface  def = ci.azureus_core.getPluginManager().getDefaultPluginInterface();
     
      PluginInterface dht_pi =
        def.getPluginManager().getPluginInterfaceByClass(DHTPlugin.class );
     
      if ( dht_pi == null ){
     
        ci.out.println( "\tDHT isn't present" );
       
        return;
      }
     
      DHTPlugin  dht_plugin = (DHTPlugin)dht_pi.getPlugin();
     
      if ( dht_plugin.getStatus() != DHTPlugin.STATUS_RUNNING ){
       
        ci.out.println( "\tDHT isn't running yet (disabled or initialising)" );
       
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.PluginConfig

Copyright © 2018 www.massapicom. 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.