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.
Afficher le fichier Open project: krlito/StompNet Class Usage Examples

Méthodes publiques

Свойство Type Description
EmptyBody byte[]
HeartbeatFrame Frame

Private Properties

Свойство Type Description

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
ThrowMandatoryHeaderException ( string headerName ) : void

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

Method Details

Frame() public méthode

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.
Résultat System

GetAllHeaderValues() public méthode

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

GetBodyAsString() public méthode

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

GetBodyAsString() public méthode

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.
Résultat string

GetHeader() public méthode

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

ThrowMandatoryHeaderException() protected static méthode

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.
Résultat void

ToString() public méthode

String representation of the Frame.
public ToString ( ) : string
Résultat string

Property Details

EmptyBody public_oe static_oe property

Value used when the body is empty.
public static byte[] EmptyBody
Résultat byte[]

HeartbeatFrame public_oe static_oe property

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