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. by adding headers.
|
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, toStringprotected final Random randomGenerator
public ReceivingSearch(UpnpService upnpService, IncomingDatagramMessage<UpnpRequest> inputMessage)
protected void execute()
throws RouterException
execute in class ReceivingAsync<IncomingSearchRequest>RouterExceptionprotected boolean waitBeforeExecution()
throws InterruptedException
ReceivingAsyncwaitBeforeExecution 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
RouterExceptionprotected void sendSearchResponseAll(NetworkAddress activeStreamServer) throws RouterException
RouterExceptionprotected List<OutgoingSearchResponse> createDeviceMessages(LocalDevice device, NetworkAddress activeStreamServer)
protected List<OutgoingSearchResponse> createServiceTypeMessages(LocalDevice device, NetworkAddress activeStreamServer)
protected void sendSearchResponseRootDevices(NetworkAddress activeStreamServer) throws RouterException
RouterExceptionprotected void sendSearchResponseUDN(UDN udn, NetworkAddress activeStreamServer) throws RouterException
RouterExceptionprotected void sendSearchResponseDeviceType(DeviceType deviceType, NetworkAddress activeStreamServer) throws RouterException
RouterExceptionprotected void sendSearchResponseServiceType(ServiceType serviceType, NetworkAddress activeStreamServer) throws RouterException
RouterExceptionprotected Location getDescriptorLocation(NetworkAddress activeStreamServer, LocalDevice device)
protected boolean isAdvertisementDisabled(LocalDevice device)
protected void prepareOutgoingSearchResponse(OutgoingSearchResponse message)
Copyright © 2023 jUPnP.org. All rights reserved.