Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UpdateStreamBuilder

Builder for update stream to use for updating a specific topic. A builder is created using TopicUpdate.newUpdateStreamBuilder.

The type of the topic being updated must match the type derived from the {@code dataType} parameter.

since

6.9

Hierarchy

  • UpdateStreamBuilder

Index

Methods

build

  • Creates an UpdateStream to use for updating a specific topic.

    The type of the topic being updated must match the type derived from the {@code dataType} parameter.

    Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.

    Streams are validated lazily when the first UpdateStream.set or UpdateStream.validate operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.

    Takes an optional retry strategy that governs recovery attempts following a recoverable exception.

    throws

    a NullValueError if the path or dataType is null or undefined

    Parameters

    • path: string

      the path of the topic

    • dataType: DataType<any, any, any>

      the type of the values expected by the update stream

    Returns UpdateStream

    an update stream

  • Creates a RecoverableUpdateStream to use for updating a specific topic.

    Takes a retry strategy that governs recovery attempts following a recoverable exception.

    In other respects this method works in the same way as calling UpdateStreamBuilder.build without retry strategy.

    throws

    a NullValueError if any of the required arguments null or undefined

    Parameters

    • path: string

      the path of the topic

    • dataType: DataType<any, any, any>

      the type of the values expected by the update stream

    • Optional retryStrategy: RetryStrategy

      an optional retry strategy

    Returns RecoverableUpdateStream

    a recoverable update stream

constraint

  • Specifies an update constraint for this update stream.

    Constraints can be created using updateConstraints}.

    Constraints can be applied to the setting of a value and creation of an update stream. Constraints describe a condition that must be satisfied for the operation to succeed. The constraints are evaluated on the server. The available constraints are: an active session lock, the absence of a topic, the current value of the topic being updated, and a part of the current value of the topic being updated.

    Constraint is Unconstrained by default. Calling this method with a null or undefined parameter resets the constraint for this builder.

    Parameters

    • updateConstraint: UpdateConstraint

      the constraint that must be satisfied for the update stream to be validated

    Returns UpdateStreamBuilder

    this builder

reset

  • Resets the builder to its default parameters.

    Returns UpdateStreamBuilder

    this builder

specification

  • Specifies a TopicSpecification for this update stream.

    If a topic does not exist at the {@code path} one will be created using the {@code topicSpecification} when the update stream is validated. If a topic does exist, its specification must match {@code topicSpecification}, otherwise the operation will fail with an error.

    Specification is undefined by default. Calling this method with a null or undefined parameter removes the specification for this builder.

    Parameters

    Returns UpdateStreamBuilder

    this builder

suppressDeltas

  • Specifies if delta compression should be disabled for this update stream.

    This is {@code false} by default, i.e. delta compression is enabled.

    Disabling delta compression can reduce the CPU workload at the client at the cost of increased bandwidth and possible additional CPU load on the server (if the topic publishes deltas). This may be particularly useful for topics that have PUBLISH_VALUES_ONLY set.

    since

    6.11

    Parameters

    • suppressDeltas: boolean

      the boolean value to set the suppression of delta compression.

    Returns UpdateStreamBuilder

    this builder