/** Send the connected users list */ private void getUserList(ObjectConnection oc) { Vector v = new Vector(); for (int i = 0; i < this.connections.size(); i++) { if (((ConnectInfo) this.connections.get(i)).type.equalsIgnoreCase("Client")) v.addElement(this.connections.get(i)); } try { oc.write(v); } catch (Exception e) { } }
/** * 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(); } }