Package org.openwebnet4j.communication
Class Response
- java.lang.Object
-
- org.openwebnet4j.communication.Response
-
public class Response extends Object
This class represents a response to a OpenWebNet request sent to the gateway. Can contain multiple messages (frames), last message should be an ACK/NACK.- Author:
- M. Valla - Initial contribution
-
-
Constructor Summary
Constructors Constructor Description Response(OpenMessage request)
Creates aResponse
object associated to the request message
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addResponse(OpenMessage msg)
Add a new message received as responseOpenMessage
getFinalResponse()
Returns the last OpenMessage that has finalised this responseOpenMessage
getRequest()
Returns the initial request messageList<OpenMessage>
getResponseMessages()
Returns a list ofOpenMessage
received as responseprotected boolean
hasFinalResponse()
Returns true if an ACK/NACK has been receivedboolean
isSuccess()
Returns true if the request was successful (the last OpenMessages in the response is an ACK)protected void
responseReady()
String
toString()
protected void
waitResponse()
-
-
-
Constructor Detail
-
Response
public Response(OpenMessage request)
Creates aResponse
object associated to the request message- Parameters:
request
- theOpenMessage
request message
-
-
Method Detail
-
getRequest
public OpenMessage getRequest()
Returns the initial request message- Returns:
- the initial request message
-
isSuccess
public boolean isSuccess()
Returns true if the request was successful (the last OpenMessages in the response is an ACK)- Returns:
- true if the request was successful
-
getResponseMessages
public List<OpenMessage> getResponseMessages()
Returns a list ofOpenMessage
received as response- Returns:
- a list of
OpenMessage
-
getFinalResponse
public OpenMessage getFinalResponse()
Returns the last OpenMessage that has finalised this response- Returns:
- the last
OpenMessage
-
addResponse
protected void addResponse(OpenMessage msg)
Add a new message received as response- Parameters:
msg
- the new message to add
-
hasFinalResponse
protected boolean hasFinalResponse()
Returns true if an ACK/NACK has been received- Returns:
- true if an ACK/NACK has been received
-
waitResponse
protected void waitResponse()
-
responseReady
protected void responseReady()
-
-