/** * Returns all devices (root or embedded) which have at least one matching service. * * @param serviceType The type of service to search for. * @return Any registered root or embedded device with at least one matching service. */ Collection<D> get(ServiceType serviceType) { Collection<D> devices = new HashSet<>(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(serviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
/** * Returns all devices (root or embedded) with a compatible type. * <p> * This routine will check compatible versions, as described by the UDA. * </p> * * @param deviceType The minimum device type required. * @return Any registered root or embedded device with a compatible type. */ Collection<D> get(DeviceType deviceType) { Collection<D> devices = new HashSet<>(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(deviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
protected Service discoverConnectionService(Device device) { if (!device.getType().equals(IGD_DEVICE_TYPE)) { return null; } Device[] connectionDevices = device.findDevices(CONNECTION_DEVICE_TYPE); if (connectionDevices.length == 0) { log.fine("IGD doesn't support '" + CONNECTION_DEVICE_TYPE + "': " + device); return null; } Device connectionDevice = connectionDevices[0]; log.fine("Using first discovered WAN connection device: " + connectionDevice); Service ipConnectionService = connectionDevice.findService(IP_SERVICE_TYPE); Service pppConnectionService = connectionDevice.findService(PPP_SERVICE_TYPE); if (ipConnectionService == null && pppConnectionService == null) { log.fine("IGD doesn't support IP or PPP WAN connection service: " + device); } return ipConnectionService != null ? ipConnectionService : pppConnectionService; }
/** * Returns all devices (root or embedded) which have at least one matching service. * * @param serviceType The type of service to search for. * @return Any registered root or embedded device with at least one matching service. */ Collection<D> get(ServiceType serviceType) { Collection<D> devices = new HashSet(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(serviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
/** * Returns all devices (root or embedded) with a compatible type. * <p> * This routine will check compatible versions, as described by the UDA. * </p> * * @param deviceType The minimum device type required. * @return Any registered root or embedded device with a compatible type. */ Collection<D> get(DeviceType deviceType) { Collection<D> devices = new HashSet(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(deviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
protected Service discoverConnectionService(Device device) { if (!device.getType().equals(IGD_DEVICE_TYPE)) { return null; } Device[] connectionDevices = device.findDevices(CONNECTION_DEVICE_TYPE); if (connectionDevices.length == 0) { log.fine("IGD doesn't support '" + CONNECTION_DEVICE_TYPE + "': " + device); return null; } Device connectionDevice = connectionDevices[0]; log.fine("Using first discovered WAN connection device: " + connectionDevice); Service ipConnectionService = connectionDevice.findService(IP_SERVICE_TYPE); Service pppConnectionService = connectionDevice.findService(PPP_SERVICE_TYPE); if (ipConnectionService == null && pppConnectionService == null) { log.fine("IGD doesn't support IP or PPP WAN connection service: " + device); } return ipConnectionService != null ? ipConnectionService : pppConnectionService; }
/** * Returns all devices (root or embedded) which have at least one matching service. * * @param serviceType The type of service to search for. * @return Any registered root or embedded device with at least one matching service. */ Collection<D> get(ServiceType serviceType) { Collection<D> devices = new HashSet<>(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(serviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
/** * Returns all devices (root or embedded) with a compatible type. * <p> * This routine will check compatible versions, as described by the UDA. * </p> * * @param deviceType The minimum device type required. * @return Any registered root or embedded device with a compatible type. */ Collection<D> get(DeviceType deviceType) { Collection<D> devices = new HashSet<>(); for (RegistryItem<UDN, D> item : deviceItems) { D[] d = (D[])item.getItem().findDevices(deviceType); if (d != null) { devices.addAll(Arrays.asList(d)); } } return devices; }
protected Service<?, ?> discoverConnectionService(@SuppressWarnings("rawtypes") final Device<?, Device, ?> device) { if (!device.getType().equals(IGD_DEVICE_TYPE)) { logger.debug("Found service of wrong type {}, expected {}.", device.getType(), IGD_DEVICE_TYPE); return null; } @SuppressWarnings("rawtypes") final Device[] connectionDevices = device.findDevices(CONNECTION_DEVICE_TYPE); if (connectionDevices.length == 0) { logger.debug("IGD doesn't support '{}': {}", CONNECTION_DEVICE_TYPE, device); return null; } logger.debug("Found {} devices", connectionDevices.length); return findConnectionService(connectionDevices); }
protected Service discoverConnectionService(Device device) { if (!device.getType().equals(IGD_DEVICE_TYPE)) { return null; } Device[] connectionDevices = device.findDevices(CONNECTION_DEVICE_TYPE); if (connectionDevices.length == 0) { log.fine("IGD doesn't support '" + CONNECTION_DEVICE_TYPE + "': " + device); return null; } Device connectionDevice = connectionDevices[0]; log.fine("Using first discovered WAN connection device: " + connectionDevice); Service ipConnectionService = connectionDevice.findService(IP_SERVICE_TYPE); Service pppConnectionService = connectionDevice.findService(PPP_SERVICE_TYPE); if (ipConnectionService == null && pppConnectionService == null) { log.fine("IGD doesn't support IP or PPP WAN connection service: " + device); } return ipConnectionService != null ? ipConnectionService : pppConnectionService; }