Table of Contents

Class CompositeMessageUpgradeStrategy

Namespace
Excalibur.Dispatch.Delivery
Assembly
Excalibur.Dispatch.dll

Composite message upgrade strategy that delegates to multiple underlying strategies.

public sealed class CompositeMessageUpgradeStrategy : IMessageUpgradeStrategy
Inheritance
CompositeMessageUpgradeStrategy
Implements
Inherited Members
Extension Methods

Constructors

CompositeMessageUpgradeStrategy(IEnumerable<IMessageUpgradeStrategy>)

Initializes a new instance of the CompositeMessageUpgradeStrategy class.

public CompositeMessageUpgradeStrategy(IEnumerable<IMessageUpgradeStrategy> strategies)

Parameters

strategies IEnumerable<IMessageUpgradeStrategy>

The collection of upgrade strategies to use.

Methods

CanUpgrade(Type, string)

Determines whether any of the underlying strategies can upgrade the specified message type and version.

public bool CanUpgrade(Type messageType, string version)

Parameters

messageType Type

The type of message to upgrade.

version string

The current version of the message.

Returns

bool

True if any strategy can upgrade the message; otherwise, false.

Upgrade(string, Type, string, string)

Upgrades a message using the first available strategy that can handle the upgrade.

public object Upgrade(string payload, Type messageType, string fromVersion, string toVersion)

Parameters

payload string

The serialized message payload.

messageType Type

The type of message to upgrade.

fromVersion string

The current version of the message.

toVersion string

The target version to upgrade to.

Returns

object

The upgraded message object.

Exceptions

NotSupportedException

Thrown when no strategy can handle the upgrade.