Interface IUpdateConstraintFactory
The factory for the update constraint types.
Namespace: PushTechnology.ClientInterface.Client.Features
Assembly: Diffusion.Client.dll
Syntax
public interface IUpdateConstraintFactory
Properties
JSONValue
Gets the constraint that partially matches the current topic value.
Declaration
IPartialJSON JSONValue { get; }
Property Value
Type | Description |
---|---|
IPartialJSON | The constraint. |
NoTopic
Gets the constraint requiring the path to have no topic.
Declaration
IUpdateConstraint NoTopic { get; }
Property Value
Type | Description |
---|---|
IUpdateConstraint | The constraint. |
Remarks
This is useful when setting the first value of a topic being added using AddAndSetAsync<TValue>(String, ITopicSpecification, TValue, IUpdateConstraint) without changing the value if the topic already exists. This constraint is unsatisfied if a topic is present at the path, making it unsuitable for operations that try to set topics without adding them.
NoValue
Gets the constraint requiring the topic to have no value.
Declaration
IUpdateConstraint NoValue { get; }
Property Value
Type | Description |
---|---|
IUpdateConstraint | The constraint. |
Remarks
This is useful when setting the first value of a topic. This constraint is unsatisfied if no topic is present at the path, making it unsuitable for operations that try to add topics.
Methods
Locked(ISessionLock)
Creates a constraint requiring a lock to be held by the session.
Declaration
IUpdateConstraint Locked(ISessionLock sessionLock)
Parameters
Type | Name | Description |
---|---|---|
ISessionLock | sessionLock | The session lock. |
Returns
Type | Description |
---|---|
IUpdateConstraint | The new update constraint. |
Remarks
This can be used to coordinate operations between multiple sessions.
Value<TValue>(TValue)
Creates a constraint requiring the current value of the topic to match the supplied value.
Declaration
IUpdateConstraint Value<TValue>(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The value. |
Returns
Type | Description |
---|---|
IUpdateConstraint | The new update constraint. |
Type Parameters
Name | Description |
---|---|
TValue | The value type. |
Remarks
When a STRING, INT64 or
DOUBLE topic is updated to a null
value, the topic is set to
have no value. Use the NoValue constraint to check if the topic has no value.
This is useful when changing the value of a topic. This constraint is unsatisfied if no topic is present at the path, making it unsuitable for operations that try to add topics.