@Override public String toString() { // Performance optimization, so we don't have to wrap all log("foo " + device) calls with isLoggable if(ModelUtil.ANDROID_RUNTIME) { return "(RemoteDeviceIdentity) UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } return "(" + getClass().getSimpleName() + ") UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } }
public RemoteDeviceIdentity(UDN udn, RemoteDeviceIdentity template) { this(udn, template.getMaxAgeSeconds(), template.getDescriptorURL(), template.getInterfaceMacAddress(), template.getDiscoveredOnLocalAddress()); }
public void run() { URL deviceURL = rd.getIdentity().getDescriptorURL(); // Performance optimization, try to avoid concurrent GET requests for device descriptor, // if we retrieve it once, we have the hydrated device. There is no different outcome // processing this several times concurrently. if (activeRetrievals.contains(deviceURL)) { log.finer("Exiting early, active retrieval for URL already in progress: " + deviceURL); return; } // Exit if it has been discovered already, could be we have been waiting in the executor queue too long if (getUpnpService().getRegistry().getRemoteDevice(rd.getIdentity().getUdn(), true) != null) { log.finer("Exiting early, already discovered: " + deviceURL); return; } try { activeRetrievals.add(deviceURL); describe(); } catch (RouterException ex) { log.log(Level.WARNING, "Descriptor retrieval failed: " + deviceURL, ex ); } finally { activeRetrievals.remove(deviceURL); } }
new StreamRequestMessage(UpnpRequest.Method.GET, rd.getIdentity().getDescriptorURL()); + rd.getIdentity().getDescriptorURL() + ", possibly invalid URL: " + ex); return ; "Device descriptor retrieval failed, no response: " + rd.getIdentity().getDescriptorURL() ); return; log.warning( "Device descriptor retrieval failed: " + rd.getIdentity().getDescriptorURL() + ", " + deviceDescMsg.getOperation().getResponseDetails() log.fine( "Received device descriptor without or with invalid Content-Type: " + rd.getIdentity().getDescriptorURL()); log.warning("Received empty device descriptor:" + rd.getIdentity().getDescriptorURL()); return;
log.fine("Received device ALIVE advertisement, descriptor location is: " + rdIdentity.getDescriptorURL()); if (rdIdentity.getDescriptorURL() == null) { log.finer("Ignoring message without location URL header: " + getInputMessage()); return;
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); } }
if (rdIdentity.getDescriptorURL() == null) { log.finer("Ignoring message without location URL header: " + getInputMessage()); return;
@Override public String toString() { // Performance optimization, so we don't have to wrap all log("foo " + device) calls with isLoggable if(ModelUtil.ANDROID_RUNTIME) { return "(RemoteDeviceIdentity) UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } return "(" + getClass().getSimpleName() + ") UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } }
addIfNotNull(deviceNode, "Descriptor URL: ", ((RemoteDevice) device).getIdentity().getDescriptorURL(), true); } else if (device instanceof LocalDevice) { addIfNotNull(deviceNode, "Descriptor URI: ", namespace.getDescriptorPath(device));
public RemoteDeviceIdentity(UDN udn, RemoteDeviceIdentity template) { this(udn, template.getMaxAgeSeconds(), template.getDescriptorURL(), template.getInterfaceMacAddress(), template.getDiscoveredOnLocalAddress()); }
public void run() { URL deviceURL = rd.getIdentity().getDescriptorURL(); // Performance optimization, try to avoid concurrent GET requests for device descriptor, // if we retrieve it once, we have the hydrated device. There is no different outcome // processing this several times concurrently. if (activeRetrievals.contains(deviceURL)) { log.finer("Exiting early, active retrieval for URL already in progress: " + deviceURL); return; } // Exit if it has been discovered already, could be we have been waiting in the executor queue too long if (getUpnpService().getRegistry().getRemoteDevice(rd.getIdentity().getUdn(), true) != null) { log.finer("Exiting early, already discovered: " + deviceURL); return; } try { activeRetrievals.add(deviceURL); describe(); } catch (RouterException ex) { log.log(Level.WARNING, "Descriptor retrieval failed: " + deviceURL, ex ); } finally { activeRetrievals.remove(deviceURL); } }
new StreamRequestMessage(UpnpRequest.Method.GET, rd.getIdentity().getDescriptorURL()); + rd.getIdentity().getDescriptorURL() + ", possibly invalid URL: " + ex); return ; "Device descriptor retrieval failed, no response: " + rd.getIdentity().getDescriptorURL() ); return; log.warning( "Device descriptor retrieval failed: " + rd.getIdentity().getDescriptorURL() + ", " + deviceDescMsg.getOperation().getResponseDetails() log.fine( "Received device descriptor without or with invalid Content-Type: " + rd.getIdentity().getDescriptorURL()); log.warning("Received empty device descriptor:" + rd.getIdentity().getDescriptorURL()); return;
log.fine("Received device ALIVE advertisement, descriptor location is: " + rdIdentity.getDescriptorURL()); if (rdIdentity.getDescriptorURL() == null) { log.finer("Ignoring message without location URL header: " + getInputMessage()); return;
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); } }
if (rdIdentity.getDescriptorURL() == null) { log.finer("Ignoring message without location URL header: " + getInputMessage()); return;
@Override public String toString() { // Performance optimization, so we don't have to wrap all log("foo " + device) calls with isLoggable if(ModelUtil.ANDROID_RUNTIME) { return "(RemoteDeviceIdentity) UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } return "(" + getClass().getSimpleName() + ") UDN: " + getUdn() + ", Descriptor: " + getDescriptorURL(); } }
public RemoteDeviceIdentity(UDN udn, RemoteDeviceIdentity template) { this(udn, template.getMaxAgeSeconds(), template.getDescriptorURL(), template.getInterfaceMacAddress(), template.getDiscoveredOnLocalAddress()); }
public void run() { URL deviceURL = rd.getIdentity().getDescriptorURL(); // Performance optimization, try to avoid concurrent GET requests for device descriptor, // if we retrieve it once, we have the hydrated device. There is no different outcome // processing this several times concurrently. if (activeRetrievals.contains(deviceURL)) { log.finer("Exiting early, active retrieval for URL already in progress: " + deviceURL); return; } // Exit if it has been discovered already, could be we have been waiting in the executor queue too long if (getUpnpService().getRegistry().getRemoteDevice(rd.getIdentity().getUdn(), true) != null) { log.finer("Exiting early, already discovered: " + deviceURL); return; } try { activeRetrievals.add(deviceURL); describe(); } catch (RouterException ex) { log.log(Level.WARNING, "Descriptor retrieval failed: " + deviceURL, ex ); } finally { activeRetrievals.remove(deviceURL); } }
if (rdIdentity.getDescriptorURL() == null) { log.finer("Ignoring message without location URL header: " + getInputMessage()); return;
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); } }