示例#1
0
  public void mappingResult(UPnPWANConnection connection, boolean ok) {
    UPnPRootDevice root = connection.getGenericService().getDevice().getRootDevice();

    incrementDeviceStats(root.getUSN(), ok ? STATS_MAP_OK : STATS_MAP_BAD);

    checkDeviceStats(root);
  }
示例#2
0
  public void rootDeviceFound(UPnPRootDevice device) {
    incrementDeviceStats(device.getUSN(), "found");

    checkDeviceStats(device);

    try {
      int interesting = processDevice(device.getDevice());

      if (interesting > 0) {

        try {
          this_mon.enter();

          root_info_map.put(device.getLocation(), device.getInfo());

          Iterator<String> it = root_info_map.values().iterator();

          String all_info = "";

          List reported_info = new ArrayList();

          while (it.hasNext()) {

            String info = (String) it.next();

            if (info != null && !reported_info.contains(info)) {

              reported_info.add(info);

              all_info += (all_info.length() == 0 ? "" : ",") + info;
            }
          }

          if (all_info.length() > 0) {

            plugin_interface.getPluginconfig().setPluginParameter("plugin.info", all_info);
          }

        } finally {

          this_mon.exit();
        }
      }
    } catch (Throwable e) {

      log.log("Root device processing fails", e);
    }
  }
示例#3
0
 protected boolean checkDeviceStats(UPnPRootDevice root) {
   return (checkDeviceStats(root.getUSN(), root.getLocation()));
 }