org.teleal.cling.protocol.async
Class ReceivingSearch
java.lang.Object
org.teleal.cling.protocol.ReceivingAsync<IncomingSearchRequest>
org.teleal.cling.protocol.async.ReceivingSearch
- All Implemented Interfaces:
- Runnable
public class ReceivingSearch
- extends ReceivingAsync<IncomingSearchRequest>
Handles reception of search requests, responds for local registered devices.
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
.
- Author:
- Christian Bauer
randomGenerator
protected final Random randomGenerator
ReceivingSearch
public ReceivingSearch(UpnpService upnpService,
IncomingDatagramMessage<UpnpRequest> inputMessage)
execute
protected void execute()
- Specified by:
execute
in class ReceivingAsync<IncomingSearchRequest>
waitBeforeExecution
protected boolean waitBeforeExecution()
throws InterruptedException
- Description copied from class:
ReceivingAsync
- Provides an opportunity to pause before executing the protocol.
- Overrides:
waitBeforeExecution
in class ReceivingAsync<IncomingSearchRequest>
- Returns:
true
(default) if execution should continue after waiting.
- Throws:
InterruptedException
- If waiting has been interrupted, which also stops execution.
sendResponses
protected void sendResponses(UpnpHeader searchTarget)
sendSearchResponseAll
protected void sendSearchResponseAll()
createDeviceMessages
protected List<OutgoingSearchResponse> createDeviceMessages(LocalDevice device)
createServiceTypeMessages
protected List<OutgoingSearchResponse> createServiceTypeMessages(LocalDevice device)
sendSearchResponseRootDevices
protected void sendSearchResponseRootDevices()
sendSearchResponseUDN
protected void sendSearchResponseUDN(UDN udn)
sendSearchResponseDeviceType
protected void sendSearchResponseDeviceType(DeviceType deviceType)
sendSearchResponseServiceType
protected void sendSearchResponseServiceType(ServiceType serviceType)
getDescriptorLocator
protected Locator getDescriptorLocator(InetAddress bindingAddress,
LocalDevice device)
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.