Table of Contents

Class SolaceTopicArtifactMapping

Namespace
Solace.SchemaRegistry.Serdes.Core.Resolver.Strategy
Assembly
Solace.SchemaRegistry.Serdes.Core.dll

Default implementation of ISolaceTopicArtifactMapping that maps Solace topic expressions to schema registry artifact references using wildcard pattern matching.

public class SolaceTopicArtifactMapping : ISolaceTopicArtifactMapping
Inheritance
SolaceTopicArtifactMapping
Implements
Inherited Members

Properties

ArtifactReference

Gets the mapped artifact reference.

public IArtifactReference ArtifactReference { get; }

Property Value

IArtifactReference

TopicExpression

Gets the topic expression.

public string TopicExpression { get; }

Property Value

string

Methods

Create(string)

Creates a mapping instance with a generated artifact ID. The generated artifact reference will contain the topic expression as the artifact ID.

public static SolaceTopicArtifactMapping Create(string topicExpression)

Parameters

topicExpression string

The topic expression for matching destination names. Must not be null or empty.

Returns

SolaceTopicArtifactMapping

A SolaceTopicArtifactMapping instance with a generated IArtifactReference.

Exceptions

ArgumentException

Thrown when topicExpression is null or empty.

Create(string, IArtifactReference)

Creates a mapping instance with an explicit IArtifactReference.

public static SolaceTopicArtifactMapping Create(string topicExpression, IArtifactReference artifactReference)

Parameters

topicExpression string

The topic expression for matching destination names. Must not be null or empty.

artifactReference IArtifactReference

The explicit IArtifactReference to map the destination name. Must not be null.

Returns

SolaceTopicArtifactMapping

A SolaceTopicArtifactMapping instance with the explicit IArtifactReference.

Exceptions

ArgumentException

Thrown when topicExpression is null or empty.

ArgumentNullException

Thrown when artifactReference is null.

Create(string, string)

Creates a mapping instance with an explicit artifact ID. This creates an IArtifactReference with the provided artifact ID string.

public static SolaceTopicArtifactMapping Create(string topicExpression, string artifactId)

Parameters

topicExpression string

The topic expression for matching destination names. Must not be null or empty.

artifactId string

The artifact ID string to set on the generated IArtifactReference. Must not be null or empty.

Returns

SolaceTopicArtifactMapping

A SolaceTopicArtifactMapping instance with a generated IArtifactReference.

Exceptions

ArgumentException

Thrown when topicExpression or artifactId is null or empty.

Equals(object)

Determines whether the specified object is equal to the current SolaceTopicArtifactMapping. Two mappings are equal if they have the same topic expression and artifact reference.

public override bool Equals(object obj)

Parameters

obj object

The object to compare with the current mapping.

Returns

bool

true if the specified object is equal to the current mapping; otherwise, false.

GetHashCode()

Serves as the default hash function for the SolaceTopicArtifactMapping type.

public override int GetHashCode()

Returns

int

A hash code for the current mapping.

Match(string)

Method for matching a given destination name to a topic expression.

public bool Match(string destinationName)

Parameters

destinationName string

The destination name to test

Returns

bool

True if the name matches the topic expression otherwise, false

Exceptions

ArgumentNullException

Thrown when destinationName is null.