C# Class StompNet.Models.Frames.Frame

Class representing a STOMP FRAME. No validation is done here except a command string is required. All validations must be done in inheritors. This object is not immutable, BUT should be used as if it were.
Exibir arquivo Open project: krlito/StompNet Class Usage Examples

Public Properties

Property Type Description
EmptyBody byte[]
HeartbeatFrame Frame

Private Properties

Property Type Description

Public Methods

Method Description
Frame ( string command, string>.IEnumerable headers, byte body = null ) : System

Constructor.

GetAllHeaderValues ( string name ) : IEnumerable

Gets all the values of the specified header.

GetBodyAsString ( ) : string

Get body as a string using UTF-8 encoding.

GetBodyAsString ( Encoding encoding ) : string

Get body as a string using the specified encoding.

GetHeader ( string name ) : string

Gets the value of the first ocurrence of the specified header.

ToString ( ) : string

String representation of the Frame.

Protected Methods

Method Description
ThrowMandatoryHeaderException ( string headerName ) : void

Create and throws the exception used when a mandatory header is not included.

Method Details

Frame() public method

Constructor.
public Frame ( string command, string>.IEnumerable headers, byte body = null ) : System
command string Frame command.
headers string>.IEnumerable Frame headers.
body byte Frame body.
return System

GetAllHeaderValues() public method

Gets all the values of the specified header.
public GetAllHeaderValues ( string name ) : IEnumerable
name string Name of the header.
return IEnumerable

GetBodyAsString() public method

Get body as a string using UTF-8 encoding.
public GetBodyAsString ( ) : string
return string

GetBodyAsString() public method

Get body as a string using the specified encoding.
public GetBodyAsString ( Encoding encoding ) : string
encoding System.Text.Encoding Encoding to be used to decode the message body.
return string

GetHeader() public method

Gets the value of the first ocurrence of the specified header.
public GetHeader ( string name ) : string
name string Name of the header.
return string

ThrowMandatoryHeaderException() protected static method

Create and throws the exception used when a mandatory header is not included.
protected static ThrowMandatoryHeaderException ( string headerName ) : void
headerName string Name of the mandatory header.
return void

ToString() public method

String representation of the Frame.
public ToString ( ) : string
return string

Property Details

EmptyBody public_oe static_oe property

Value used when the body is empty.
public static byte[] EmptyBody
return byte[]

HeartbeatFrame public_oe static_oe property

Value to be used when a heartbeat is received.
public static Frame,StompNet.Models.Frames HeartbeatFrame
return Frame