Class StoreValueIfAbsent
java.lang.Object
io.fluxzero.common.api.Request
io.fluxzero.common.api.Command
io.fluxzero.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 Fluxzero applications.
Notes
- Always uses
Guarantee.STOREDfor persistence safety. - This command is part of the legacy key-value subsystem. For most modern use cases, consider migrating
to the
DocumentStoreorSearchablestorage model.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLightweight 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 Fluxzero Runtime.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:CommandIndicates the delivery guarantee required for this command.- Specified by:
getGuaranteein classCommand- Returns:
- the
Guaranteelevel (e.g.STORED,SENT,NONE)
-
toString
-
toMetric
Description copied from interface:JsonTypeConverts this object into a compact metric representation for logging or monitoring.Used by the Fluxzero Java SDK 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:CommandOptionally specifies a routing key for this command, which may be used to partition work or apply consistent hashing when processed in the Fluxzero Runtime.- Overrides:
routingKeyin classCommand- Returns:
- a routing key string, or
nullif not specified
-