public interface ZCLCommandResponseStream
close()
method is called.
The ZCLCommandResponseStream
is used to process a stream of responses
from a ZigBee network. Responses are consumed by registering a handler with
forEach(Predicate)
. Responses received before a handler is
registered are buffered until a handler is registered, or until the close
method is called.
A handler consumes events returning true
to continue delivery.
At some point the ZigBee service invocation will terminate event delivery by
sending a close event (a ZCLCommandResponse
which returns
true
from ZCLCommandResponse.isEnd()
. After a close
event the handler function will be dereferenced.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this response, indicating that no further responses are needed.
|
void |
forEach(Predicate<? super ZCLCommandResponse> handler)
Registers a handler that will be called for each of the received
responses.
|
void close()
void forEach(Predicate<? super ZCLCommandResponse> handler)
false
from its accept method then the
handler will be released and no further events will be delivered. Any
remaining buffered events will be discarded, and this object marked as
closed.
If the handler does not close the stream early then the ZigBee service
implementation will eventually send a close event.handler
- A handler to process ZCLCommandResponse objectsIllegalStateException
- if a handler has already been registered,
or if this object has been closed (a ZCLCommandResponse
which returns true
from
ZCLCommandResponse.isEnd()
. After a close event the
handler function will be dereferenced.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0