DefaultHeader

class DefaultHeader(delegate: MutableMap<String, String> = mutableMapOf(), var isReadOnly: Boolean = false) : Header, MutableMap<String, String>

Default implementation of the Header interface.

This class provides a mutable header implementation that can be made read-only. It delegates map operations to an internal mutable map while enforcing read-only constraints.

Author

ahoo wang

Constructors

Link copied to clipboard
constructor(delegate: MutableMap<String, String> = mutableMapOf(), isReadOnly: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Gets the compensation ID from the header, if present.

Link copied to clipboard
Link copied to clipboard

Checks if this header contains compensation information.

Link copied to clipboard
open override var isReadOnly: Boolean

Whether this header is read-only (volatile for thread safety)

Link copied to clipboard
open override val keys: MutableSet<String>
Link copied to clipboard

Retrieves the operator from the command header.

Link copied to clipboard
Link copied to clipboard

Retrieves the operator from the command header, throwing an exception if not present.

Link copied to clipboard
open override val size: Int
Link copied to clipboard

Gets the trace ID from the header.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val values: MutableCollection<String>

Functions

Link copied to clipboard
open override fun clear()

Removes all mappings from this header.

Link copied to clipboard
open override fun containsKey(key: String): Boolean
Link copied to clipboard
open override fun containsValue(value: String): Boolean
Link copied to clipboard
open override fun copy(): Header

Creates a copy of this header.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Extracts the command wait endpoint from the message header.

Link copied to clipboard

Extracts the command wait ID from the message header.

Link copied to clipboard

Extracts a simple waiting chain from the message header. Attempts to extract both simple chain and tail configurations.

Link copied to clipboard

Extracts the wait chain type from the message header.

Link copied to clipboard

Extracts wait function information from the message header.

Link copied to clipboard

Extracts a waiting chain tail from the message header.

Link copied to clipboard

Extracts the waiting stage from the message header.

Link copied to clipboard

Extracts a complete wait strategy from the message header. Attempts to extract both simple waiting chain and waiting for stage strategies.

Link copied to clipboard
open operator override fun get(key: String): String?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard

Checks if the header has the local-first flag set.

Link copied to clipboard

Checks if this header's compensation information matches the given function.

Link copied to clipboard
fun Header.propagate(upstream: Message<*, *>): Header

Extension function to propagate context to this header from an upstream message.

Link copied to clipboard

Adds the command wait endpoint to the message header for propagation.

Link copied to clipboard

Adds the wait chain type to the message header.

Link copied to clipboard

Adds the wait command ID to the message header for propagation.

Link copied to clipboard

Adds wait function information to the message header for propagation.

Link copied to clipboard

Adds the waiting stage to the message header for propagation.

Link copied to clipboard
open override fun put(key: String, value: String): String?

Associates the specified value with the specified key in this header.

Link copied to clipboard
open override fun putAll(from: Map<out String, String>)

Copies all of the mappings from the specified map to this header.

Link copied to clipboard
open override fun remove(key: String): String?

Removes the mapping for the specified key from this header if present.

open override fun remove(key: String, value: String): Boolean

Removes the entry for the specified key only if it is currently mapped to the specified value.

Link copied to clipboard

Extracts the command wait endpoint from the message header, throwing an exception if not present.

Link copied to clipboard

Extracts the command wait ID from the message header, throwing an exception if not present.

Link copied to clipboard

Converts a nullable map of strings to a Header instance.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun with(additional: Map<String, String>): Header
open fun with(key: String, value: String): Header
Link copied to clipboard

Adds compensation information to this header.

Link copied to clipboard
fun Header.withLocalFirst(localFirst: Boolean = true): Header

Adds the local-first flag to the header.

Link copied to clipboard

Creates a new header with the specified operator added.

Link copied to clipboard
open override fun withReadOnly(): Header

Makes this header read-only and returns it.

Link copied to clipboard
Link copied to clipboard

Adds a trace ID to the header.

Link copied to clipboard
Link copied to clipboard
fun Header.withUpstreamName(upstreamName: String): Header
Link copied to clipboard