Class: UpdateConstraintFactory

diffusion.topicUpdate. UpdateConstraintFactory


new UpdateConstraintFactory()

Factory for the constraint types.

An instance can be obtained by calling diffusion.updateConstraints().

Since:
  • 6.2

Methods


jsonValue()

Create a constraint that partially matches the current topic value.

The topic must be a JSON topic. The diffusion.topicUpdate.PartialJSON partially describes the structure of a JSON value.

Returns:

the constraint

Type
diffusion.topicUpdate.PartialJSON

locked(lock)

Create a constraint requiring a lock to be held by the session.

This can be used to coordinate operations between multiple sessions.

Parameters:
Name Type Description
lock SessionLock

the lock

Returns:

the constraint

Type
diffusion.topicUpdate.UpdateConstraint

noTopic()

Create a constraint requiring the path to have no topic.

This is useful when setting the first value of a topic being added using addAndSet 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.

Returns:

the constraint

Type
diffusion.topicUpdate.UpdateConstraint

noValue()

Create a constraint requiring the topic to have no value.

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.

Returns:

the constraint

Type
diffusion.topicUpdate.UpdateConstraint

value(value, dataType)

Create a constraint requiring the current value of the topic to match the supplied value.

Create a constraint requiring the current value of the topic to match the supplied value.

If dataType is not specified, the data type is inferred from the value parameter.

This method 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.

When a string, int64 or double topic is updated to a {@code null} value, the topic is set to have no value. Use the #noValue() constraint to check if the topic has no value.

Parameters:
Name Type Description
value any

the value

dataType diffusion.datatypes.DataType

the optional type of the values

Returns:

the constraint

Type
diffusion.topicUpdate.UpdateConstraint