public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
currentDevice.getVersion(), currentDevice.getType(), currentDevice.getDetails(), iconDupes, currentDevice.toServiceArray(describedServices),
new DeviceItem( device, device.getDetails().getFriendlyName(), device.getDisplayString(), "(REMOTE) " + device.getType().getDisplayString()
public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
currentDevice.getVersion(), currentDevice.getType(), currentDevice.getDetails(), iconDupes, currentDevice.toServiceArray(describedServices),
public URL normalizeURI(URI relativeOrAbsoluteURI) { // TODO: I have one device (Netgear 834DG DSL Router) that sends a <URLBase>, and even that is wrong (port)! // This can be fixed by "re-enabling" UPnP in the upnpService after a reboot, it will then use the right port... // return URIUtil.createAbsoluteURL(getDescriptorURL(), relativeOrAbsoluteURI); if (getDetails() != null && getDetails().getBaseURL() != null) { // If we have an <URLBase>, all URIs are relative to it return URIUtil.createAbsoluteURL(getDetails().getBaseURL(), relativeOrAbsoluteURI); } else { // Otherwise, they are relative to the descriptor location return URIUtil.createAbsoluteURL(getIdentity().getDescriptorURL(), relativeOrAbsoluteURI); } }
@Override public void logRouterInfo() throws RouterException { final RemoteDevice device = service.getDevice(); final UDAVersion version = device.getVersion(); final DeviceDetails deviceDetails = device.getDetails(); logger.info("Service id: {}", service.getServiceId()); logger.info("Reference: {}", service.getReference()); logger.info("Display name: {}", device.getDisplayString()); logger.info("Version: {}.{}", version.getMajor(), version.getMinor()); logger.info("Control uri: {}", service.getControlURI()); logger.info("Descriptor uri: {}", service.getDescriptorURI()); logger.info("Event subscription uri: {}", service.getEventSubscriptionURI()); logger.info("Device base url: {}", deviceDetails.getBaseURL()); logger.info("Device presentation uri: {}", deviceDetails.getPresentationURI()); }
private URI getUri() { if (service.getDevice().getDetails().getPresentationURI() != null) { return service.getDevice().getDetails().getPresentationURI(); } if (service.getControlURI() != null) { return service.getControlURI(); } if (service.getDescriptorURI() != null) { return service.getDescriptorURI(); } if (service.getEventSubscriptionURI() != null) { return service.getEventSubscriptionURI(); } return null; }
/******************************************************************************************************************* * ******************************************************************************************************************/ @BeforeClass public final void setup() throws Exception { upnpClient = new UpnpClient("ContentDirectory", device -> "underTest".equals(device.getDetails().getSerialNumber())); Executors.newSingleThreadExecutor().submit(upnpClient); final Map<Key<?>, Object> properties = new HashMap<>(); final Path repositoryPath = Paths.get("target/test-classes/test-sets/model-iTunes-fg-20160504-2.n3"); properties.put(ROOT_PATH, TestSetLocator.getMusicTestSetsPath().resolve("iTunes-fg-20160504-2")); final PowerOnNotification powerOnNotification = new PowerOnNotification(properties); final DefaultMediaFileSystem fileSystem = context.getBean(DefaultMediaFileSystem.class); resourceServer = context.getBean(DefaultResourceServer.class); fileSystem.onPowerOnNotification(powerOnNotification); resourceServer.onPowerOnNotification(powerOnNotification); final Repository repository = context.getBean(Repository.class); loadRepository(repository, repositoryPath); cacheManager = context.getBean(DefaultCacheManager.class); }
currentDevice.getVersion(), currentDevice.getType(), currentDevice.getDetails(), iconDupes, currentDevice.toServiceArray(describedServices),