public interface ResponseCallback
CommunicationManager.send(Message, ProtocolInfo, DataStructure, ResponseCallback) . Incoming
response messages are delivered to an appropriate handle method, e.g. handle(ProbeMessage, ProbeMatchesMessage, ConnectionInfo, AttributedURI) for responses to a
sent ProbeMessage.| Modifier and Type | Method and Description |
|---|---|
EventSource |
getEvent() |
OperationDescription |
getOperation() |
XAddressInfo |
getTargetAddress() |
void |
handle(GetMessage get,
GetResponseMessage getResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
GetResponseMessage. |
void |
handle(GetMetadataMessage getMetadata,
GetMetadataResponseMessage getMetadataResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
GetMetadataResponseMessage. |
void |
handle(GetStatusMessage getStatus,
GetStatusResponseMessage getStatusResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
GetStatusResponseMessage. |
void |
handle(InvokeMessage invokeRequest,
InvokeMessage invokeResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
InvokeMessage as a response to another request InvokeMessage that has previously been sent by passing this ResponseCallback
instance as the third argument to the send method. |
void |
handle(Message request,
FaultMessage fault,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
FaultMessage in response to a previously sent request
message. |
void |
handle(ProbeMessage probe,
ProbeMatchesMessage probeMatches,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
|
void |
handle(RenewMessage renew,
RenewResponseMessage renewResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
RenewResponseMessage. |
void |
handle(ResolveMessage resolve,
ResolveMatchesMessage resolveMatches,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
|
void |
handle(SubscribeMessage subscribe,
SubscribeResponseMessage subscribeResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives a
SubscribeResponseMessage. |
void |
handle(UnsubscribeMessage unsubscribe,
UnsubscribeResponseMessage unsubscribeResponse,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Receives an
UnsubscribeResponseMessage. |
void |
handleMalformedResponseException(Message request,
java.lang.Exception exception,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Called when an exception occurs while receiving, decoding or processing the response message to
a previously sent
request. |
void |
handleNoContent(Message request,
java.lang.String reason,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId) |
void |
handleTimeout(Message request,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Called when an attempt to receive responses to a previously sent request message passed to
CommunicationManager.send(Message, ProtocolInfo, DataStructure, ResponseCallback)
timeouted. |
void |
handleTransmissionException(Message request,
java.lang.Exception exception,
ConnectionInfo connectionInfo,
AttributedURI optionalMessageId)
Called when an exception arises while sending the
request message. |
void |
requestStartedWithTimeout(long duration,
Message message,
java.lang.String communicationInterfaceDescription) |
void |
setTargetAddress(XAddressInfo targetXAddressInfo) |
void handle(ProbeMessage probe, ProbeMatchesMessage probeMatches, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
ProbeMatchesMessage in response to a previously sent ProbeMessage. This receiving ResponseCallback instance is the one passed as
fourth argument to the send method.CommunicationManager in use) to receive none, exactly one or
multiple ProbeMatchesMessages in response to a single sent ProbeMessage. This method would therefore accordingly either not get called at all, or get
called once or multiple times..
If no responses to the sent resolve message are received within a protocol-specific time
period, the method handleTimeout(Message, ConnectionInfo, AttributedURI) will be
called.
probe - the original request messageprobeMatches - a message containing a response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received message; this is
especially useful when sending probe request messages over multiple
different technologies like DPWS, UPNP, Bluetooth, etc. (which can be done by specifying respective
DiscoveryDomains); the supplied connectionInfo enables in such cases the requester
to distinguish which technology the search results were obtained overoptionalMessageId - void handle(ResolveMessage resolve, ResolveMatchesMessage resolveMatches, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
ResolveMatchesMessage in response to a previously sent ResolveMessage. This receiving ResponseCallback instance is the one passed as
fourth argument to the send method.CommunicationManager in use) to receive none or exactly one ResolveMatchesMessage in response to a single sent ResolveMessage. This method would
thus accordingly either not get called at all, or get called once.
If no responses to the sent resolve message are received within a protocol-specific time
period, method handleTimeout(Message, ConnectionInfo, AttributedURI) will be called.
resolve - the original request messageresolveMatches - a message containing a response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received message; this is
especially useful when sending resolve request messages over multiple different technologies like DPWS,UPNP,
Bluetooth, etc. (which can be done by specifying respective DiscoveryDomains); the supplied
connectionInfo enables in such cases the requester to distinguish which technology the
result was obtained overoptionalMessageId - void handle(GetMessage get, GetResponseMessage getResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
GetResponseMessage. The corresponding GetMessage has previously been
sent by passing this ResponseCallback instance as the fourth argument to the
send
method.
Each GetMessage may result in a call to either this method (in case of successful
two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
get - the original request messagegetResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(GetMetadataMessage getMetadata, GetMetadataResponseMessage getMetadataResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
GetMetadataResponseMessage. The corresponding GetMetadataMessage has
previously been sent by passing this ResponseCallback instance as the fourth
argument to the send method.
Each GetMetadataMessage may result in a call to either this method (in case of
successful two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
getMetadata - the original request messagegetMetadataResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(SubscribeMessage subscribe, SubscribeResponseMessage subscribeResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
SubscribeResponseMessage. The corresponding SubscribeMessage has
been sent previously by passing this ResponseCallback instance as the fourth
argument to the send method.
Each SubscribeMessage may result in a call to either this method (in case of
successful two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
subscribe - the original request messagesubscribeResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(GetStatusMessage getStatus, GetStatusResponseMessage getStatusResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
GetStatusResponseMessage. The corresponding GetStatusMessage has
been sent previously by passing this ResponseCallback instance as the fourth
argument to the send method.
Each GetStatusMessage may result in a call to either this method (in case of
successful two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
getStatus - the original request messagegetStatusResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(RenewMessage renew, RenewResponseMessage renewResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
RenewResponseMessage. The corresponding RenewMessage has been sent
previously by passing this ResponseCallback instance as the fourth argument to the
send
method.
Each RenewMessage may result in a call to either this method (in case of successful
two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
renew - the original request messagerenewResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(UnsubscribeMessage unsubscribe, UnsubscribeResponseMessage unsubscribeResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
UnsubscribeResponseMessage. The corresponding UnsubscribeMessage
has been sent previously by passing this ResponseCallback instance as the third
argument to the send method.
Each UnsubscribeMessage may result in a call to either this method (in case of
successful two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
unsubscribe - the original request messageunsubscribeResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(InvokeMessage invokeRequest, InvokeMessage invokeResponse, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
InvokeMessage as a response to another request InvokeMessage that has previously been sent by passing this ResponseCallback
instance as the third argument to the send method.
Each request InvokeMessage may result in a call to either this method (in case of
successful two-way communication), or to methods:
handleTransmissionException(Message, Exception, ConnectionInfo, AttributedURI)
in case of a failure while sending the request message
handle(Message, FaultMessage, ConnectionInfo, AttributedURI) in case of a
failure during request processing on the server side
handleMalformedResponseException(Message, Exception, ConnectionInfo,
AttributedURI) in case of a failure during response processing on this side
handleTimeout(Message, ConnectionInfo, AttributedURI) in case of a timeout while
waiting for responses to the sent request.
In case of successful one-way communication, no method of this interface is called.
invokeRequest - the original request messageinvokeResponse - a message containing the response to the previously sent requestconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handle(Message request, FaultMessage fault, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
FaultMessage in response to a previously sent request
message.
A fault is raised on the responding side while processing the request message and then sent
back to the requester (aka. this side). It is explicitly NOT created on this
side while processing the received response (see method handleMalformedResponseException(Message, Exception, ConnectionInfo, AttributedURI) for the
latter case).
request - the original request messagefault - the fault generated by the responding sideconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handleTimeout(Message request, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
CommunicationManager.send(Message, ProtocolInfo, DataStructure, ResponseCallback)
timeouted. This can only happen when using an unreliable connectionless transport layer for
message transmission, such as UDP. Note that any other error related to sending the original
request message is notified by the callback method handleTransmissionException(Message,
Exception, ConnectionInfo, AttributedURI) . The original (request) message that was meant to
be sent is passed as argument request.request - the message meant to be sent, which resulted in a timeoutconnectionInfo - protocol (aka. technology) specific addressing information attached to the received messageoptionalMessageId - void handleTransmissionException(Message request, java.lang.Exception exception, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
request message. This could be
e.g. due to network reachability reasons, an IO problem within the transport connection, an
invalid message construct, etc.request - the request message which was meant to be sent when the exception occurredexception - the exception cause while sending the request messageconnectionInfo - protocol (aka. technology) specific addressing information related to the transmission exceptionoptionalMessageId - void requestStartedWithTimeout(long duration,
Message message,
java.lang.String communicationInterfaceDescription)
void handleMalformedResponseException(Message request, java.lang.Exception exception, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)
request. The exception is passed to argument exception
request - the original request messageexception - the exception caused during processing the responseconnectionInfo - protocol (aka. technology) specific addressing information related to the malformed responseoptionalMessageId - OperationDescription getOperation()
EventSource getEvent()
XAddressInfo getTargetAddress()
void setTargetAddress(XAddressInfo targetXAddressInfo)
void handleNoContent(Message request, java.lang.String reason, ConnectionInfo connectionInfo, AttributedURI optionalMessageId)