@Override public Set<ThingTypeUID> getSupportedThingTypes() { Set<ThingTypeUID> supportedThingTypes = new HashSet<>(); for (UpnpDiscoveryParticipant participant : participants) { supportedThingTypes.addAll(participant.getSupportedThingTypeUIDs()); } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { supportedThingTypes.addAll(participant.getSupportedThingTypeUIDs()); } return supportedThingTypes; }
@Deprecated @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) protected void addUpnpDiscoveryParticipant_old( org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant) { this.oldParticipants.add(participant); if (upnpService != null) { Collection<RemoteDevice> devices = upnpService.getRegistry().getRemoteDevices(); for (RemoteDevice device : devices) { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } } }
@Override public void remoteDeviceRemoved(Registry registry, RemoteDevice device) { for (UpnpDiscoveryParticipant participant : participants) { try { ThingUID thingUID = participant.getThingUID(device); if (thingUID != null) { thingRemoved(thingUID); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { try { ThingUID thingUID = participant.getThingUID(device); if (thingUID != null) { thingRemoved(thingUID); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } }
@Override public void remoteDeviceAdded(Registry registry, RemoteDevice device) { for (UpnpDiscoveryParticipant participant : participants) { try { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { try { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } }
@Override public void remoteDeviceRemoved(Registry registry, RemoteDevice device) { for (UpnpDiscoveryParticipant participant : participants) { try { ThingUID thingUID = participant.getThingUID(device); if (thingUID != null) { thingRemoved(thingUID); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { try { ThingUID thingUID = participant.getThingUID(device); if (thingUID != null) { thingRemoved(thingUID); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } }
@Deprecated @Reference(cardinality = ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC) protected void addUpnpDiscoveryParticipant_old( org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant) { this.oldParticipants.add(participant); if (upnpService != null) { Collection<RemoteDevice> devices = upnpService.getRegistry().getRemoteDevices(); for (RemoteDevice device : devices) { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } } }
@Override public Set<ThingTypeUID> getSupportedThingTypes() { Set<ThingTypeUID> supportedThingTypes = new HashSet<>(); for (UpnpDiscoveryParticipant participant : participants) { supportedThingTypes.addAll(participant.getSupportedThingTypeUIDs()); } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { supportedThingTypes.addAll(participant.getSupportedThingTypeUIDs()); } return supportedThingTypes; }
@Override public void remoteDeviceAdded(Registry registry, RemoteDevice device) { for (UpnpDiscoveryParticipant participant : participants) { try { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } for (org.eclipse.smarthome.config.discovery.UpnpDiscoveryParticipant participant : oldParticipants) { try { DiscoveryResult result = participant.createResult(device); if (result != null) { thingDiscovered(result); } } catch (Exception e) { logger.error("Participant '{}' threw an exception", participant.getClass().getName(), e); } } }