Examples of PluginInterface


Examples of interfaces.PluginInterface

   * @param l     List<PluginInterface>
   * @return PluginInterface or null
   */
  public static PluginInterface getRightPlugin(String extension , List<PluginInterface> l)
  {
    PluginInterface pRes = null;
    for(PluginInterface p : l)
    {
      String[] ext = p.getExtension();
      for(String e : ext)
      if(extension.equals(e))
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginInterface

    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

Examples of org.gudy.azureus2.plugins.PluginInterface

  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

Examples of org.gudy.azureus2.plugins.PluginInterface

        {
          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

Examples of org.gudy.azureus2.plugins.PluginInterface

      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

Examples of org.gudy.azureus2.plugins.PluginInterface

   
  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

Examples of org.gudy.azureus2.plugins.PluginInterface

    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

Examples of org.gudy.azureus2.plugins.PluginInterface

  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

Examples of org.gudy.azureus2.plugins.PluginInterface

    // Proably need to wait for core to be running to make sure dht plugin is fully avail
    AzureusCoreFactory.addCoreRunningListener(new AzureusCoreRunningListener() {
      public void azureusCoreRunning(AzureusCore core) {
        PluginManager pm = core.getPluginManager();
        connection_manager = PluginInitializer.getDefaultInterface().getConnectionManager();
        PluginInterface dht_pi = pm.getPluginInterfaceByClass(DHTPlugin.class);
        if (dht_pi != null) {
          dhtPlugin = (DHTPlugin) dht_pi.getPlugin();
        }
      }
    });
  }
View Full Code Here

Examples of org.gudy.azureus2.plugins.PluginInterface

                  }else{
                   
                    torrent.setAdditionalListProperty( "httpseeds", webseeds );
                  }
     
                  PluginInterface pi = AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaceByClass(ExternalSeedPlugin.class);
                 
                  if ( pi != null ){
                   
                    ExternalSeedPlugin ext_seed_plugin = (ExternalSeedPlugin)pi.getPlugin();
                   
                    ext_seed_plugin.downloadChanged( PluginCoreUtils.wrap( dms[0] ));
                  }
           
                }catch (Throwable e){
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.