Package freenet.pluginmanager

Examples of freenet.pluginmanager.PluginInfoWrapper


    }

    node.executor.execute(new Runnable() {
      @Override
      public void run() {
        PluginInfoWrapper pi = node.pluginManager.getPluginInfo(plugname);
        if (pi == null) {
          handler.outputHandler.queue(new ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_PLUGIN, false, "Plugin '"+ plugname + "' does not exist or is not a FCP plugin", identifier, false));
        } else {
          String source = pi.getFilename();
          pi.stopPlugin(node.pluginManager, maxWaitTime, true);
          if (purge) {
            node.pluginManager.removeCachedCopy(pi.getFilename());
          }
          pi = node.pluginManager.startPluginAuto(source, store);
          if (pi == null) {
            handler.outputHandler.queue(new ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_PLUGIN, false, "Plugin '"+ plugname + "' does not exist or is not a FCP plugin", identifier, false));
          } else {
View Full Code Here


            return;
          }
        } else {
          type = urlType.toLowerCase();
        }
        PluginInfoWrapper pi;
        if (TYPENAME_OFFICIAL.equals(type)) {
          pi = node.pluginManager.startPluginOfficial(pluginURL, store, force, forceHTTPS);
        } else if (TYPENAME_FILE.equals(type)) {
          pi = node.pluginManager.startPluginFile(pluginURL, store);
        } else if (TYPENAME_FREENET.equals(type)) {
View Full Code Here

    }

    node.executor.execute(new Runnable() {
      @Override
      public void run() {
        PluginInfoWrapper pi = node.pluginManager.getPluginInfo(plugname);
        if (pi == null) {
          handler.outputHandler.queue(new ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_PLUGIN, false, "Plugin '"+ plugname + "' does not exist or is not a FCP plugin", identifier, false));
        } else {
          pi.stopPlugin(node.pluginManager, maxWaitTime, false);
          if (purge) {
            node.pluginManager.removeCachedCopy(pi.getFilename());
          }
          handler.outputHandler.queue(new PluginRemovedMessage(plugname, identifier));
        }
      }
    }, "Remove Plugin");
View Full Code Here

      throws MessageInvalidException {
    if(detailed && !handler.hasFullAccess()) {
      throw new MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "GetPluginInfo detailed requires full access", identifier, false);
    }

    PluginInfoWrapper pi = node.pluginManager.getPluginInfo(plugname);
    if (pi == null) {
      handler.outputHandler.queue(new ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_PLUGIN, false, "Plugin '"+ plugname + "' does not exist or is not a FCP plugin", identifier, false));
    } else {
      handler.outputHandler.queue(new PluginInfoMessage(pi, identifier, detailed));
    }
View Full Code Here

        oldResult = this.result.asBucket();
      this.result = result;
    }
    if(oldResult != null) oldResult.free();
   
    PluginInfoWrapper loaded = pluginManager.getPluginInfo(pluginName);
   
    if(loaded == null) {
      if(!node.pluginManager.isPluginLoadedOrLoadingOrWantLoad(pluginName)) {
        System.err.println("Don't want plugin: "+pluginName);
        Logger.error(this, "Don't want plugin: "+pluginName);
        tempBlobFile.delete();
        return;
      }
    }
   
    if(loaded.getPluginLongVersion() >= fetchedVersion) {
      tempBlobFile.delete();
      return;
    }
    // Create a useralert to ask the user to deploy the new version.
   
View Full Code Here

        infobox.addChild("div", "class", "infobox-header", l10n("options"));
        infoboxContent = infobox.addChild("div", "class", "infobox-content");

        HTMLNode optionList = infoboxContent.addChild("ul");

        PluginInfoWrapper keyUtil;
        if((e.mode == FetchExceptionMode.NOT_IN_ARCHIVE || e.mode == FetchExceptionMode.NOT_ENOUGH_PATH_COMPONENTS)) {
          // first look for the newest version
          if ((keyUtil = core.node.pluginManager.getPluginInfo("plugins.KeyUtils.KeyUtilsPlugin")) != null) {
            option = optionList.addChild("li");
            if (keyUtil.getPluginLongVersion() < 5010)
              NodeL10n.getBase().addL10nSubstitution(option, "FProxyToadlet.openWithKeyExplorer", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/KeyUtils/?automf=true&key=" + key.toString()) });
            else {
              NodeL10n.getBase().addL10nSubstitution(option, "FProxyToadlet.openWithKeyExplorer", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/KeyUtils/?key=" + key.toString()) });
              option = optionList.addChild("li");
              NodeL10n.getBase().addL10nSubstitution(option, "FProxyToadlet.openWithSiteExplorer", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/KeyUtils/Site?key=" + key.toString()) });
            }
          } else if ((keyUtil = core.node.pluginManager.getPluginInfo("plugins.KeyExplorer.KeyExplorer")) != null) {
            option = optionList.addChild("li");
            if (keyUtil.getPluginLongVersion() > 4999)
              NodeL10n.getBase().addL10nSubstitution(option, "FProxyToadlet.openWithKeyExplorer", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/KeyExplorer/?automf=true&key=" + key.toString())});
            else
              NodeL10n.getBase().addL10nSubstitution(option, "FProxyToadlet.openWithKeyExplorer", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/plugins/plugins.KeyExplorer.KeyExplorer/?key=" + key.toString())});
          }
        }
View Full Code Here

      headerRow.addChild("th");
      headerRow.addChild("th");
      headerRow.addChild("th");
      Iterator<PluginInfoWrapper> it = pm.getPlugins().iterator();
      while (it.hasNext()) {
        PluginInfoWrapper pi = it.next();
        HTMLNode pluginRow = pluginTable.addChild("tr");
        pluginRow.addChild("td", pi.getLocalisedPluginName());
        if(advancedMode)
          pluginRow.addChild("td", pi.getPluginClassName());
        long ver = pi.getPluginLongVersion();
        if(ver != -1)
          pluginRow.addChild("td", pi.getPluginVersion()+" ("+ver+")");
        else
          pluginRow.addChild("td", pi.getPluginVersion());
        if(advancedMode) {
          pluginRow.addChild("td", pi.getThreadName());
          pluginRow.addChild("td", new Date(pi.getStarted()).toString());
        }
        if (pi.isStopping()) {
          pluginRow.addChild("td", l10n("pluginStopping"));
          /* add two empty cells. */
          pluginRow.addChild("td");
          pluginRow.addChild("td");
        } else {
          if (pi.isPproxyPlugin()) {
            HTMLNode visitForm = pluginRow.addChild("td").addChild("form", new String[] { "method", "action", "target" }, new String[] { "get", pi.getPluginClassName(), "_blank" });
            visitForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "formPassword", ctx.getFormPassword() });
            visitForm.addChild("input", new String[] { "type", "value" }, new String[] { "submit", NodeL10n.getBase().getString("PluginToadlet.visit") });
          } else
            pluginRow.addChild("td");
          HTMLNode unloadForm = ctx.addFormChild(pluginRow.addChild("td"), ".", "unloadPluginForm");
          unloadForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "unload", pi.getThreadName() });
          unloadForm.addChild("input", new String[] { "type", "value" }, new String[] { "submit", l10n("unload") });
          HTMLNode reloadForm = ctx.addFormChild(pluginRow.addChild("td"), ".", "reloadPluginForm");
          reloadForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "hidden", "reload", pi.getThreadName() });
          reloadForm.addChild("input", new String[] { "type", "value" }, new String[] { "submit", l10n("reload") });
        }
      }
    }
  }
View Full Code Here

  void startPluginUpdater(OfficialPluginDescription plugin) {
    String name = plugin.name;
    long minVer = plugin.minimumVersion;
    // But it might already be past that ...
    PluginInfoWrapper info = node.pluginManager.getPluginInfo(name);
    if (info == null) {
      if (!(node.pluginManager.isPluginLoadedOrLoadingOrWantLoad(name))) {
        if (logMINOR)
          Logger.minor(this, "Plugin not loaded");
        return;
      }
    }
    if (info != null)
      minVer = Math.max(minVer, info.getPluginLongVersion());
    FreenetURI uri = updateURI.setDocName(name).setSuggestedEdition(minVer);
    PluginJarUpdater updater = new PluginJarUpdater(this, uri,
        (int) minVer, -1, Integer.MAX_VALUE, name + "-", name,
        node.pluginManager, autoDeployPluginsOnRestart);
    synchronized (this) {
View Full Code Here

TOP

Related Classes of freenet.pluginmanager.PluginInfoWrapper

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.