Interface ITopicSelector
An ITopicSelector is a value that identifies one or more topics.
Depending on where it is used, a selector may be evaluated by either the server of the client library. For example, the server evaluates the selector used to subscribe to a topic. In contrast, the selector used to register a topic handler is evaluated by the client. Applications do not normally need to evaluate selectors, but may do so using Selects(String).
A client may receive a selector providing the context for certain operations. For example, to allow it to veto subscriptions. Limited ability to query the selector's Type, associated Expression, and Path is provided.
Selectors may be compared using the Equals operator. Selectors of different types are never equal.
Selectors may be created using ITopicSelectors.
Namespace: PushTechnology.ClientInterface.Client.Topics
Assembly: Diffusion.Client.dll
Syntax
public interface ITopicSelector
Properties
Expression
The expression associated with this selector.
Declaration
string Expression { get; }
Property Value
Type | Description |
---|---|
String |
PathPrefix
Get the maximum topic path prefix from this selector pattern.
Attempts to extract the largest possible topic path that this selector defines, from the beginning of the selector. If this selector is a SPLIT_PATH_PATTERN or FULL_PATH_PATTERN, this will return a topic path up until the point that a regular expression pattern is first encountered.
For SELECTOR_SETs, this method will return the largest prefix that is common to all included selectors.
If no prefix can be extracted, this will return an empty string.
Declaration
string PathPrefix { get; }
Property Value
Type | Description |
---|---|
String | the largest possible topic path prefix |
Type
Returns the type of selector.
Declaration
TopicSelectorType Type { get; }
Property Value
Type | Description |
---|---|
TopicSelectorType |
Methods
Selects(String)
Evaluate this selector against a topic path.
Declaration
bool Selects(string topicPath)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath |
Returns
Type | Description |
---|---|
Boolean | true if this selector selects topicPath. |