AMPS C# Client  5.3.3.4
AMPS C# Client for .NET
AMPS.Client.CompositeMessageParser Class Reference

Used to retrieve individual message parts from AMPS composite messages, which are messages where the data contains a number of parts and each part is a complete message of a specific message type. For example, a composite message type of "composite-json-binary" may be declared on the server that combines a set of JSON headers with an opaque binary payload. CompositeMessageParser makes it easy to retrieve the parts of a composite message from the composite message payload. More...

Public Member Functions

 CompositeMessageParser ()
 Creates a new CompositeMessageParser, with 0 valid parts. More...
 
 CompositeMessageParser (Field body_)
 Creates a new CompositeMessageParser and parses the provided message body. More...
 
 CompositeMessageParser (Message message_)
 Creates a new CompositeMessageParser and parses a message's body. More...
 
int parse (Message message_)
 Parses a composite message. More...
 
int parse (Field body_)
 Parses a composite message body. More...
 
String getString (int index_)
 Returns a part from a composite message body. More...
 
String getString (int index_, Encoding encoding_)
 Returns a part from a composite message body. More...
 
Field getPart (int index_, Field field_)
 Returns a part from a composite message body. More...
 

Detailed Description

Used to retrieve individual message parts from AMPS composite messages, which are messages where the data contains a number of parts and each part is a complete message of a specific message type. For example, a composite message type of "composite-json-binary" may be declared on the server that combines a set of JSON headers with an opaque binary payload. CompositeMessageParser makes it easy to retrieve the parts of a composite message from the composite message payload.

Constructor & Destructor Documentation

◆ CompositeMessageParser() [1/3]

AMPS.Client.CompositeMessageParser.CompositeMessageParser ( )
inline

Creates a new CompositeMessageParser, with 0 valid parts.

◆ CompositeMessageParser() [2/3]

AMPS.Client.CompositeMessageParser.CompositeMessageParser ( Field  body_)
inline

Creates a new CompositeMessageParser and parses the provided message body.

Parameters
body_The composite body (returned from Message.getDataRaw()).

◆ CompositeMessageParser() [3/3]

AMPS.Client.CompositeMessageParser.CompositeMessageParser ( Message  message_)
inline

Creates a new CompositeMessageParser and parses a message's body.

Parameters
message_The message containing a composite body.

Member Function Documentation

◆ getPart()

Field AMPS.Client.CompositeMessageParser.getPart ( int  index_,
Field  field_ 
)
inline

Returns a part from a composite message body.

Parameters
index_The part index to retrieve (0-based index)
field_The Field to update with the buffer, index, and length of this part.
Returns
The field passed as field_.

◆ getString() [1/2]

String AMPS.Client.CompositeMessageParser.getString ( int  index_)
inline

Returns a part from a composite message body.

Parameters
index_The part index to retrieve (0-based index)
Returns
The data of this body part, decoded as UTF-8.

◆ getString() [2/2]

String AMPS.Client.CompositeMessageParser.getString ( int  index_,
Encoding  encoding_ 
)
inline

Returns a part from a composite message body.

Parameters
index_The part index to retrieve (0-based index)
encoding_The Encoding to decode this body with.
Returns
The data of this body part.

◆ parse() [1/2]

int AMPS.Client.CompositeMessageParser.parse ( Field  body_)
inline

Parses a composite message body.

Parameters
body_The composite body (returned from Message.getDataRaw()).
Returns
The number of message parts found in body_

◆ parse() [2/2]

int AMPS.Client.CompositeMessageParser.parse ( Message  message_)
inline

Parses a composite message.

Parameters
message_The message with a composite body.
Returns
The number of message parts found in message_

The documentation for this class was generated from the following file: