Table of Contents

Class Filter

Namespace
Microsoft.ServiceBus.Messaging
Assembly
Microsoft.ServiceBus.dll

Describes a filter expression that is evaluated against a BrokeredMessage.

[DataContract(Name = "Filter", Namespace = "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect")]
[KnownType(typeof(SqlFilter))]
[KnownType(typeof(TrueFilter))]
[KnownType(typeof(FalseFilter))]
[KnownType(typeof(CorrelationFilter))]
[KnownType(typeof(DateTimeOffset))]
public abstract class Filter : IExtensibleDataObject
Inheritance
Filter
Implements
IExtensibleDataObject
Derived
Inherited Members

Remarks

Filter is an abstract class with the following concrete implementations:

  • SqlFilter that represents a filter using SQL syntax.
  • CorrelationFilter that provides an optimization for correlation equality expressions.

Properties

RequiresPreprocessing

Gets a value indicating whether the filter expression requires preprocessing.

public abstract bool RequiresPreprocessing { get; }

Property Value

bool

true if the filter expression requires preprocessing; otherwise, false.

Methods

Match(BrokeredMessage)

Matches the BrokeredMessage against the FilterExpression.

public abstract bool Match(BrokeredMessage message)

Parameters

message BrokeredMessage

The BrokeredMessage object.

Returns

bool

true if the BrokeredMessage matches the filtering expression; otherwise, false.

Exceptions

InvalidOperationException

The operation is invalid with the current state of object.

FilterException

Filter evaluation failed.

Preprocess()

Preprocesses the filter expression and returns a preprocessed FilterExpression.

public abstract Filter Preprocess()

Returns

Filter

The preprocessed FilterExpression.

Exceptions

InvalidOperationException

The operation is invalid with the current state of object.

Validate()

Validates the FilterExpression and make sure it complies with the valid grammar rules.

public abstract void Validate()

Exceptions

FilterException

The filter statement is invalid or is potentially complex enough to consume too much computing power when evaluating the statement.

See Also