Class SCPResponse
java.lang.Object
uk.ac.manchester.spinnaker.messages.scp.SCPResponse
- Direct Known Subclasses:
BMPRequest.BMPResponse
,CheckOKResponse
,NoResponse
public abstract class SCPResponse extends Object
Represents an abstract SCP response.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
SCPResponse(ByteBuffer buffer)
Reads a packet from a bytestring of data. -
Method Summary
Modifier and Type Method Description protected void
throwIfNotOK(String operation, Enum<?> command)
Throw an exception if the response is not an OK.
-
Field Details
-
Constructor Details
-
SCPResponse
Reads a packet from a bytestring of data. Subclasses must also deserialize any payload after calling this constructor.- Parameters:
buffer
- the buffer to deserialise from
-
-
Method Details
-
throwIfNotOK
protected final void throwIfNotOK(String operation, Enum<?> command) throws UnexpectedResponseCodeExceptionThrow an exception if the response is not an OK.- Parameters:
operation
- The overall operation that was being done.command
- The particular command that this is a response to.- Throws:
UnexpectedResponseCodeException
- If the response was a failure.UnroutableMessageException
- If the response was specifically that the message couldn't be routed.
-