public class ReceivingSearch extends ReceivingAsync<IncomingSearchRequest>
Waits a random time between 0 and the requested MX (maximum 120 seconds) before executing. Only waits if there are actually any registered local devices.
Extracts the search target, builds and sends the dozens of messages
required by the UPnP specification, depending on the search target and what
local devices and services are found in the Registry
.
Modifier and Type | Field and Description |
---|---|
protected Random |
randomGenerator |
Constructor and Description |
---|
ReceivingSearch(UpnpService upnpService,
IncomingDatagramMessage<UpnpRequest> inputMessage) |
Modifier and Type | Method and Description |
---|---|
protected List<OutgoingSearchResponse> |
createDeviceMessages(LocalDevice device,
NetworkAddress activeStreamServer) |
protected List<OutgoingSearchResponse> |
createServiceTypeMessages(LocalDevice device,
NetworkAddress activeStreamServer) |
protected void |
execute() |
protected Location |
getDescriptorLocation(NetworkAddress activeStreamServer,
LocalDevice device) |
protected boolean |
isAdvertisementDisabled(LocalDevice device) |
protected void |
prepareOutgoingSearchResponse(OutgoingSearchResponse message)
Override this to edit the outgoing message, e.g.
|
protected void |
sendResponses(UpnpHeader searchTarget,
NetworkAddress activeStreamServer) |
protected void |
sendSearchResponseAll(NetworkAddress activeStreamServer) |
protected void |
sendSearchResponseDeviceType(DeviceType deviceType,
NetworkAddress activeStreamServer) |
protected void |
sendSearchResponseRootDevices(NetworkAddress activeStreamServer) |
protected void |
sendSearchResponseServiceType(ServiceType serviceType,
NetworkAddress activeStreamServer) |
protected void |
sendSearchResponseUDN(UDN udn,
NetworkAddress activeStreamServer) |
protected boolean |
waitBeforeExecution()
Provides an opportunity to pause before executing the protocol.
|
getFirstHeader, getInputMessage, getUpnpService, run, toString
protected final Random randomGenerator
public ReceivingSearch(UpnpService upnpService, IncomingDatagramMessage<UpnpRequest> inputMessage)
protected void execute() throws RouterException
execute
in class ReceivingAsync<IncomingSearchRequest>
RouterException
protected boolean waitBeforeExecution() throws InterruptedException
ReceivingAsync
waitBeforeExecution
in class ReceivingAsync<IncomingSearchRequest>
true
(default) if execution should continue after waiting.InterruptedException
- If waiting has been interrupted, which also stops execution.protected void sendResponses(UpnpHeader searchTarget, NetworkAddress activeStreamServer) throws RouterException
RouterException
protected void sendSearchResponseAll(NetworkAddress activeStreamServer) throws RouterException
RouterException
protected List<OutgoingSearchResponse> createDeviceMessages(LocalDevice device, NetworkAddress activeStreamServer)
protected List<OutgoingSearchResponse> createServiceTypeMessages(LocalDevice device, NetworkAddress activeStreamServer)
protected void sendSearchResponseRootDevices(NetworkAddress activeStreamServer) throws RouterException
RouterException
protected void sendSearchResponseUDN(UDN udn, NetworkAddress activeStreamServer) throws RouterException
RouterException
protected void sendSearchResponseDeviceType(DeviceType deviceType, NetworkAddress activeStreamServer) throws RouterException
RouterException
protected void sendSearchResponseServiceType(ServiceType serviceType, NetworkAddress activeStreamServer) throws RouterException
RouterException
protected Location getDescriptorLocation(NetworkAddress activeStreamServer, LocalDevice device)
protected boolean isAdvertisementDisabled(LocalDevice device)
protected void prepareOutgoingSearchResponse(OutgoingSearchResponse message)
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.