Class StoreValueIfAbsent
java.lang.Object
io.fluxcapacitor.common.api.Request
io.fluxcapacitor.common.api.Command
io.fluxcapacitor.common.api.keyvalue.StoreValueIfAbsent
- All Implemented Interfaces:
JsonType
Stores a key-value pair only if the specified key does not already exist in the key-value store.
This command ensures atomic "put-if-absent" semantics, making it useful for distributed locks, idempotency markers, or one-time setup flags in legacy Flux applications.
Notes
- Always uses
Guarantee.STORED
for persistence safety. - This command is part of the legacy key-value subsystem. For most modern use cases, consider migrating
to the
DocumentStore
orSearchable
storage model.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Lightweight metric representation for logging or monitoring. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIndicates the delivery guarantee required for this command.Optionally specifies a routing key for this command, which may be used to partition work or apply consistent hashing when processed in the Flux platform.toMetric()
Converts this object into a compact metric representation for logging or monitoring.toString()
-
Constructor Details
-
StoreValueIfAbsent
public StoreValueIfAbsent()
-
-
Method Details
-
getGuarantee
Description copied from class:Command
Indicates the delivery guarantee required for this command.- Specified by:
getGuarantee
in classCommand
- Returns:
- the
Guarantee
level (e.g.STORED
,SENT
,NONE
)
-
toString
-
toMetric
Description copied from interface:JsonType
Converts this object into a compact metric representation for logging or monitoring.Used by the Flux client to avoid logging large payloads directly while still tracking platform usage.
- Returns:
- a safe and compact object suitable for serialization to the metrics log
-
routingKey
Description copied from class:Command
Optionally specifies a routing key for this command, which may be used to partition work or apply consistent hashing when processed in the Flux platform.- Overrides:
routingKey
in classCommand
- Returns:
- a routing key string, or
null
if not specified
-