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()])); }
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()])); }
public UPnPPluginService[] getServices() { try { this_mon.enter(); return ((UPnPPluginService[]) services.toArray(new UPnPPluginService[services.size()])); } finally { this_mon.exit(); } }
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()])); }