Example #1
0
  public UPnPPluginService[] getServices(UPnPDevice device) {
    String target_usn = device.getRootDevice().getUSN();

    List<UPnPPluginService> res = new ArrayList<UPnPPluginService>();

    try {
      this_mon.enter();

      for (UPnPPluginService service : services) {

        String this_usn =
            service.getService().getGenericService().getDevice().getRootDevice().getUSN();

        if (this_usn.equals(target_usn)) {

          res.add(service);
        }
      }
    } finally {

      this_mon.exit();
    }

    return (res.toArray(new UPnPPluginService[res.size()]));
  }
Example #2
0
  public String[] getExternalIPAddresses() {
    List res = new ArrayList();

    try {
      this_mon.enter();

      for (int j = 0; j < services.size(); j++) {

        UPnPPluginService service = (UPnPPluginService) services.get(j);

        try {
          String address = service.getService().getExternalIPAddress();

          if (address != null) {

            res.add(address);
          }
        } catch (Throwable e) {

          Debug.printStackTrace(e);
        }
      }
    } finally {

      this_mon.exit();
    }

    return ((String[]) res.toArray(new String[res.size()]));
  }
Example #3
0
  public UPnPPluginService[] getServices() {
    try {
      this_mon.enter();

      return ((UPnPPluginService[]) services.toArray(new UPnPPluginService[services.size()]));

    } finally {

      this_mon.exit();
    }
  }
Example #4
0
  protected String[] getSelectedAddresses() {
    String si = selected_addresses_param.getValue().trim();

    StringTokenizer tok = new StringTokenizer(si, ";");

    List res = new ArrayList();

    while (tok.hasMoreTokens()) {

      String s = tok.nextToken().trim();

      if (s.length() > 0) {

        res.add(s);
      }
    }

    return ((String[]) res.toArray(new String[res.size()]));
  }