IN
- The type of incoming UPnP message handled by this protocol.OUT
- The type of response UPnP message created by this protocol.public abstract class ReceivingSync<IN extends StreamRequestMessage,OUT extends StreamResponseMessage> extends ReceivingAsync<IN>
After instantiation by the ProtocolFactory
, this protocol run()
s and
calls its own ReceivingAsync.waitBeforeExecution()
method. By default, the protocol does not wait
before then proceeding with executeSync()
.
The returned response will be available to the client of this protocol. The
client will then call either responseSent(org.fourthline.cling.model.message.StreamResponseMessage)
or responseException(Throwable)
, depending on whether the response was successfully
delivered. The protocol can override these methods to decide if the whole procedure it is
implementing was successful or not, including not only creation but also delivery of the response.
Modifier and Type | Field and Description |
---|---|
protected OUT |
outputMessage |
protected RemoteClientInfo |
remoteClientInfo |
Modifier | Constructor and Description |
---|---|
protected |
ReceivingSync(UpnpService upnpService,
IN inputMessage) |
Modifier and Type | Method and Description |
---|---|
protected void |
execute() |
protected abstract OUT |
executeSync() |
OUT |
getOutputMessage() |
RemoteClientInfo |
getRemoteClientInfo() |
void |
responseException(Throwable t)
Called by the client of this protocol if the returned response was not delivered.
|
void |
responseSent(StreamResponseMessage responseMessage)
Called by the client of this protocol after the returned response has been successfully delivered.
|
String |
toString() |
getFirstHeader, getInputMessage, getUpnpService, run, waitBeforeExecution
protected final RemoteClientInfo remoteClientInfo
protected OUT extends StreamResponseMessage outputMessage
protected ReceivingSync(UpnpService upnpService, IN inputMessage)
public OUT getOutputMessage()
protected final void execute() throws RouterException
execute
in class ReceivingAsync<IN extends StreamRequestMessage>
RouterException
protected abstract OUT executeSync() throws RouterException
RouterException
public void responseSent(StreamResponseMessage responseMessage)
NOOP by default.
public void responseException(Throwable t)
NOOP by default.
t
- The reason why the response wasn't delivered.public RemoteClientInfo getRemoteClientInfo()
public String toString()
toString
in class ReceivingAsync<IN extends StreamRequestMessage>
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.