Ejemplo n.º 1
0
  /**
   * Send the plugin list to a client. The list depends of the client's groups
   *
   * @param source the user that asked this command
   */
  private void sendPluginList(ObjectConnection oc, String source) {
    Vector plist = new Vector();
    Iterator plugins;
    String line = "";

    try {
      UserConcept user = store.getUserStore().getUser(source);
      plugins = store.getPluginStore().getAuthorizedPlugins(user);

      while (plugins.hasNext()) {
        PluginConcept plugin = (PluginConcept) plugins.next();
        line = plugin.getName();
        line += " " + plugin.getVersion();
        plist.add(line);
      }
      oc.write(plist);
    } catch (Exception e) {
      Logging.getLogger().warning("Unable to send the plugin list.");
      e.printStackTrace();
    }
  }