@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof NamedDeviceType)) return false; NamedDeviceType that = (NamedDeviceType) o; if (!deviceType.equals(that.deviceType)) return false; if (!udn.equals(that.udn)) return false; return true; }
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; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof NamedDeviceType)) return false; NamedDeviceType that = (NamedDeviceType) o; if (!deviceType.equals(that.deviceType)) return false; if (!udn.equals(that.udn)) return false; return true; }
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; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof NamedDeviceType)) return false; NamedDeviceType that = (NamedDeviceType) o; if (!deviceType.equals(that.deviceType)) return false; if (!udn.equals(that.udn)) return false; return true; }
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; }