Table of Contents

Class AbstractMessageBuilder

Namespace
Steeltoe.Integration.Support
Assembly
Steeltoe.Integration.IntegrationBase.dll
public abstract class AbstractMessageBuilder : IMessageBuilder
Inheritance
AbstractMessageBuilder
Implements
Derived
Inherited Members

Constructors

AbstractMessageBuilder()

protected AbstractMessageBuilder()

AbstractMessageBuilder(object, IMessage)

protected AbstractMessageBuilder(object payload, IMessage originalMessage)

Parameters

payload object
originalMessage IMessage

Fields

_headerAccessor

protected readonly IntegrationMessageHeaderAccessor _headerAccessor

Field Value

IntegrationMessageHeaderAccessor

_modified

protected volatile bool _modified

Field Value

bool

_originalMessage

protected readonly IMessage _originalMessage

Field Value

IMessage

_payload

protected readonly object _payload

Field Value

object

_readOnlyHeaders

protected IList<string> _readOnlyHeaders

Field Value

IList<string>

Properties

CorrelationId

protected abstract object CorrelationId { get; }

Property Value

object

Headers

Gets the current headers of the message

public abstract IDictionary<string, object> Headers { get; }

Property Value

IDictionary<string, object>

Payload

Gets the payload of the message

public abstract object Payload { get; }

Property Value

object

SequenceDetails

protected abstract List<List<object>> SequenceDetails { get; }

Property Value

List<List<object>>

SequenceNumber

protected abstract object SequenceNumber { get; }

Property Value

object

SequenceSize

protected abstract object SequenceSize { get; }

Property Value

object

Methods

Build()

Build the message

public abstract IMessage Build()

Returns

IMessage

the message

ContainsReadOnly(IMessageHeaders)

protected bool ContainsReadOnly(IMessageHeaders headers)

Parameters

headers IMessageHeaders

Returns

bool

CopyHeaders(IDictionary<string, object>)

Adds the headers to the message overwriting any existing values.

public abstract IMessageBuilder CopyHeaders(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder

the builder

CopyHeadersIfAbsent(IDictionary<string, object>)

Adds the headers to the message but will not overwrite any existing values.

public abstract IMessageBuilder CopyHeadersIfAbsent(IDictionary<string, object> headersToCopy)

Parameters

headersToCopy IDictionary<string, object>

the headers to add

Returns

IMessageBuilder

the builder

FilterAndCopyHeadersIfAbsent(IDictionary<string, object>, params string[])

Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.

public virtual IMessageBuilder FilterAndCopyHeadersIfAbsent(IDictionary<string, object> headersToCopy, params string[] headerPatternsToFilter)

Parameters

headersToCopy IDictionary<string, object>

the set of headers to copy

headerPatternsToFilter string[]

header patterns to filter before copy

Returns

IMessageBuilder

the builder

PopSequenceDetails()

Removes a sequence details header from the message

public virtual IMessageBuilder PopSequenceDetails()

Returns

IMessageBuilder

the builder

PushSequenceDetails(object, int, int)

Adds a sequence details header to the message

public virtual IMessageBuilder PushSequenceDetails(object correlationId, int sequenceNumber, int sequenceSize)

Parameters

correlationId object

correlation id to use in sequence

sequenceNumber int

the sequence number

sequenceSize int

the size of the sequence number

Returns

IMessageBuilder

the builder

RemoveHeader(string)

Remove the header if present

public abstract IMessageBuilder RemoveHeader(string headerName)

Parameters

headerName string

the name of the header to remove

Returns

IMessageBuilder

the builder

RemoveHeaders(params string[])

Remove the headers matched by the header patterns from the message

public abstract IMessageBuilder RemoveHeaders(params string[] headerPatterns)

Parameters

headerPatterns string[]

header patterns to match

Returns

IMessageBuilder

the builder

SetCorrelationId(object)

Adds the correlationId to the headers

public virtual IMessageBuilder SetCorrelationId(object correlationId)

Parameters

correlationId object

the id to add

Returns

IMessageBuilder

the builder

SetErrorChannel(IMessageChannel)

Adds an error channel to the messsage

public virtual IMessageBuilder SetErrorChannel(IMessageChannel errorChannel)

Parameters

errorChannel IMessageChannel

the error channel

Returns

IMessageBuilder

the builder

SetErrorChannelName(string)

Adds an error channel name to the message

public virtual IMessageBuilder SetErrorChannelName(string errorChannelName)

Parameters

errorChannelName string

the name of the error channel

Returns

IMessageBuilder

the builder

SetExpirationDate(long)

Adds an expiration date in the headers

public virtual IMessageBuilder SetExpirationDate(long expirationDate)

Parameters

expirationDate long

expiration date added to header

Returns

IMessageBuilder

the builder

SetExpirationDate(DateTime?)

Adds an expiration date in the headers

public virtual IMessageBuilder SetExpirationDate(DateTime? expirationDate)

Parameters

expirationDate DateTime?

expiration date added to header

Returns

IMessageBuilder

the builder

SetHeader(string, object)

Add a header and value to the message

public abstract IMessageBuilder SetHeader(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder

the builder

SetHeaderIfAbsent(string, object)

Add a header and value to the message if not present

public abstract IMessageBuilder SetHeaderIfAbsent(string headerName, object headerValue)

Parameters

headerName string

name of the header

headerValue object

value of the header item

Returns

IMessageBuilder

the builder

SetPriority(int)

Adds a priority header to the message

public virtual IMessageBuilder SetPriority(int priority)

Parameters

priority int

the priority to add

Returns

IMessageBuilder

the builder

SetReplyChannel(IMessageChannel)

Adds a reply channel to the message

public virtual IMessageBuilder SetReplyChannel(IMessageChannel replyChannel)

Parameters

replyChannel IMessageChannel

the reply channel

Returns

IMessageBuilder

the builder

SetReplyChannelName(string)

Adds a reply channel name to the message

public virtual IMessageBuilder SetReplyChannelName(string replyChannelName)

Parameters

replyChannelName string

the reply channel name

Returns

IMessageBuilder

the builder

SetSequenceNumber(int)

Adds sequence details header to the message

public virtual IMessageBuilder SetSequenceNumber(int sequenceNumber)

Parameters

sequenceNumber int

the sequence number

Returns

IMessageBuilder

the builder

SetSequenceSize(int)

Sets the size of the sequence number

public virtual IMessageBuilder SetSequenceSize(int sequenceSize)

Parameters

sequenceSize int

the size

Returns

IMessageBuilder

the builder