Class: ControlResponse

ControlResponse

new ControlResponse()

A ControlResponse holds a status code, status text and other fields for a ControlResponse which is used, for example, in the response from sending a register prefix control command to a forwarder.
Source:
See:

Methods

getBodyAsControlParameters() → {ControlParameters}

Get the control response body as a ControlParameters.
Source:
Returns:
The ControlParameters, or null if the body is not specified or if it is not a ControlParameters.
Type
ControlParameters

getStatusCode() → {number}

Get the status code.
Source:
Returns:
The status code. If not specified, return null.
Type
number

getStatusText() → {string}

Get the status text.
Source:
Returns:
The status text. If not specified, return "".
Type
string

setBodyAsControlParameters(controlParameters) → {ControlResponse}

Set the control response body as a ControlParameters.
Parameters:
Name Type Description
controlParameters ControlParameters The ControlParameters for the body. This makes a copy of the ControlParameters. If not specified or if the body is not a ControlParameters, set to null.
Source:
Returns:
This ControlResponse so that you can chain calls to update values.
Type
ControlResponse

setStatusCode(statusCode) → {ControlResponse}

Set the status code.
Parameters:
Name Type Description
statusCode number The status code. If not specified, set to null.
Source:
Returns:
This ControlResponse so that you can chain calls to update values.
Type
ControlResponse

setStatusText(statusText) → {ControlResponse}

Set the status text.
Parameters:
Name Type Description
statusText string The status text. If not specified, set to "".
Source:
Returns:
This ControlResponse so that you can chain calls to update values.
Type
ControlResponse

wireDecode(input, wireFormat)

Decode the input using a particular wire format and update this ControlResponse.
Parameters:
Name Type Description
input Blob | Buffer The buffer with the bytes to decode.
wireFormat WireFormat (optional) A WireFormat object used to decode this object. If omitted, use WireFormat.getDefaultWireFormat().
Source:

wireEncode(wireFormat) → {Blob}

Encode this ControlResponse for a particular wire format.
Parameters:
Name Type Description
wireFormat WireFormat (optional) A WireFormat object used to encode this object. If omitted, use WireFormat.getDefaultWireFormat().
Source:
Returns:
The encoded buffer in a Blob object.
Type
Blob