Packagecom.mi.rs
Classpublic class Response
InheritanceResponse Inheritance Object
Implements IResponse

The object passed to command response handlers. See the IResponse interface for more information.

See also

com.mi.rs.IResponse


Public Properties
 PropertyDefined By
  command : ICommand
[read-only] Returns the command this is the response to.
Response
  error : IResponseError
[read-only] Contains information about the error, or null if no error occured.
Response
  hasSubErrorResponse : Boolean
[read-only] True if any of the sub-responses is an error response.
Response
  isBatchResponse : Boolean
[read-only] True if this is the response to a batch command.
Response
  isErrorResponse : Boolean
[read-only] Convenience property that is true if this is an error response.
Response
  result : *
[read-only] The result data structure that was returned by the RealityServer command.
Response
  subResponses : Array
[read-only] if isBatchResponse is true, then this array contains objects of type IResponse for all the sub-commands.
Response
Public Methods
 MethodDefined By
  
Response(cmd:ICommand, jsonReply:Object)
Creates a response object.
Response
  
toString():String
Returns a string description for debugging purposes.
Response
Property Detail
commandproperty
command:ICommand  [read-only]

Returns the command this is the response to.


Implementation
    public function get command():ICommand
errorproperty 
error:IResponseError  [read-only]

Contains information about the error, or null if no error occured.


Implementation
    public function get error():IResponseError
hasSubErrorResponseproperty 
hasSubErrorResponse:Boolean  [read-only]

True if any of the sub-responses is an error response. This also takes sub-responses of nested batch commands into account. Note that the IResponse.error property only say if the batch command itself succedded or not, it does not say anything about the individual sub-commands. Each sub-command needs to be inspected, and this is a convenience method to determine if error handling is needed or not for the sub-responses.


Implementation
    public function get hasSubErrorResponse():Boolean
isBatchResponseproperty 
isBatchResponse:Boolean  [read-only]

True if this is the response to a batch command. If true then the batch specific methods can be used to easier parse the sub-responses of the batch command.


Implementation
    public function get isBatchResponse():Boolean
isErrorResponseproperty 
isErrorResponse:Boolean  [read-only]

Convenience property that is true if this is an error response. In this case IResponse.result will be null and IResponse.error be set to an IResponseError object containing more information about the error.


Implementation
    public function get isErrorResponse():Boolean
resultproperty 
result:*  [read-only]

The result data structure that was returned by the RealityServer command. The result will be null if the command experienced an error.


Implementation
    public function get result():*
subResponsesproperty 
subResponses:Array  [read-only]

if isBatchResponse is true, then this array contains objects of type IResponse for all the sub-commands. sub-responses are in the same order as the sub-commands were added to the original batch request.


Implementation
    public function get subResponses():Array
Constructor Detail
Response()Constructor
public function Response(cmd:ICommand, jsonReply:Object)

Creates a response object. Response objects are created automatically by the service and passed to command response handlers.

Parameters
cmd:ICommand — The command this is the response to.
 
jsonReply:Object — The "raw" jsonReply from the server.
Method Detail
toString()method
public function toString():String

Returns a string description for debugging purposes.

Returns
String