Class RedisKeySpace
java.lang.Object
org.gcube.informationsystem.resourceregistry.redis.RedisKeySpace
Central registry of Redis key constants and factory methods for the Resource Registry.
All keys are prefixed with
RedisConfiguration.KEY_PREFIX to allow safe
co-hosting with other applications on the same Redis instance.
Context key schema:
{prefix}:ctx:uuid:{uuid}— STRING — canonical context JSON (includes path){prefix}:ctx:path:{uuid}— STRING — computed path string{prefix}:ctx:fname:{urlEncodedPath}— STRING — URL-encoded path → UUID{prefix}:ctx:prevpath:{urlEncodedPath}— STRING — URL-encoded previous path → UUID{prefix}:ctx:list— ZSET — UUID members with insertion-order score{prefix}:ctx:children:{uuid}— SET — direct child UUIDs{prefix}:ctx:parent:{uuid}— STRING — parent UUID (absent for root)
Type key schema:
{prefix}:type:uuid:{uuid}— STRING — canonical type JSON{prefix}:type:name:{urlEncodedTypeName}— STRING — URL-encoded type name → UUID{prefix}:type:list— ZSET — UUID members with insertion-order score{prefix}:type:children:{uuid}— SET — direct subtype UUIDs{prefix}:type:parent:{uuid}— SET — direct supertype UUIDs (multiple inheritance supported; absent for root types){prefix}:type:linearization:{uuid}— STRING — precomputed C3-linearized JSON array of ancestor type names, internal-only
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringScan/delete pattern matching every key of this registry, whatever its namespace.static final StringPub/sub channel carrying every cross-instance notification (message payload: a serializedClusterEvent), so a change handled by one service instance reaches every other one sharing this Redis.static final StringRedis key for the ordered set (ZSET) of all context UUIDs.static final StringScan/delete pattern matching every context-related key.static final StringVersion of the authoritative Context state represented by the complete cache.static final StringFast-read copy of the authoritative schema version counter held in the database.static final StringRedis key for the ordered set (ZSET) of all type UUIDs.static final StringScan/delete pattern matching every type-related key. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcontextChildrenKey(UUID uuid) Key of the SET that holds the direct child UUIDs of the given context.static StringcontextFnameKey(String path) Key that maps a context path to its UUID.static StringcontextParentKey(UUID uuid) Key that stores the parent UUID string for the given context UUID.static StringcontextPathKey(UUID uuid) Key that stores the computed path string for the given context UUID (e.g.static StringcontextPreviousPathKey(String path) Key that maps one of a context's previous paths to its UUID.static StringcontextUuidKey(UUID uuid) Key that stores the full canonical JSON for the given context UUID.static StringtypeChildrenKey(UUID uuid) Key of the SET that holds the direct subtype UUIDs of the given type.static StringtypeLinearizationKey(UUID uuid) Key that stores the precomputed, C3-linearized list of ancestor type names for the given type, in Method-Resolution-Order (most-derived-first) -- internal-only bookkeeping, never part of a type's own returned JSON representation (mirrorstype:parent/type:children: derived structural data kept alongside the type's canonical blob, not inside it).static StringtypeMissingKey(String typeName) Key of the negative-cache tombstone recording that no Type with this name exists.static StringtypeNameKey(String typeName) Key that maps a type name to its UUID.static StringtypeParentKey(UUID uuid) Key of the SET that holds the direct supertype UUIDs of the given type (multiple inheritance supported; absent for root types).static StringtypeUuidKey(UUID uuid) Key that stores the canonical JSON for the given type UUID.
-
Field Details
-
ALL_SCAN_PATTERN
Scan/delete pattern matching every key of this registry, whatever its namespace. -
CTX_LIST_KEY
Redis key for the ordered set (ZSET) of all context UUIDs. -
CTX_VERSION_KEY
Version of the authoritative Context state represented by the complete cache. -
CTX_SCAN_PATTERN
Scan/delete pattern matching every context-related key. -
TYPE_LIST_KEY
Redis key for the ordered set (ZSET) of all type UUIDs. -
TYPE_SCAN_PATTERN
Scan/delete pattern matching every type-related key. -
SCHEMA_VERSION_KEY
Fast-read copy of the authoritative schema version counter held in the database.Deliberately outside the
type:namespace:TYPE_SCAN_PATTERNis whatinvalidateAll()sweeps, and a version stamp stored under it would be destroyed by the very invalidation whose effect it exists to detect.It is a cache of the counter, never the counter itself — the database remains authoritative, and a missing or unreadable value must be treated as "cannot validate", meaning every cached entry is ignored, never as "unchanged".
-
CLUSTER_EVENT_CHANNEL
Pub/sub channel carrying every cross-instance notification (message payload: a serializedClusterEvent), so a change handled by one service instance reaches every other one sharing this Redis. A single channel serves all event kinds; the kind is carried inside the message rather than encoded in the channel name, which keeps one subscription — and, on the backstop side, one reserved OrientDB session — regardless of how many kinds exist.
-
-
Method Details
-
contextUuidKey
Key that stores the full canonical JSON for the given context UUID. The JSON includes the injectedpathfield.- Parameters:
uuid- the UUID of the context- Returns:
- the Redis key
-
contextPathKey
Key that stores the computed path string for the given context UUID (e.g./gcube/devsec/devVRE).- Parameters:
uuid- the UUID of the context- Returns:
- the Redis key
-
contextFnameKey
Key that maps a context path to its UUID. The path is URL-encoded so that/characters do not clash with the:separator used elsewhere in the key structure.- Parameters:
path- the fully-qualified context path- Returns:
- the Redis key
-
contextPreviousPathKey
Key that maps one of a context's previous paths to its UUID. Kept apart fromcontextFnameKey(String), so that a current path is always looked up first.- Parameters:
path- the previous path- Returns:
- the Redis key
-
contextChildrenKey
Key of the SET that holds the direct child UUIDs of the given context.- Parameters:
uuid- the UUID of the context- Returns:
- the Redis key
-
contextParentKey
Key that stores the parent UUID string for the given context UUID. Absent for root contexts.- Parameters:
uuid- the UUID of the context- Returns:
- the Redis key
-
typeUuidKey
Key that stores the canonical JSON for the given type UUID.- Parameters:
uuid- the UUID of the type- Returns:
- the Redis key
-
typeNameKey
Key that maps a type name to its UUID. The name is URL-encoded to avoid collisions with the:separator.- Parameters:
typeName- the name of the type- Returns:
- the Redis key
-
typeChildrenKey
Key of the SET that holds the direct subtype UUIDs of the given type.- Parameters:
uuid- the UUID of the type- Returns:
- the Redis key
-
typeParentKey
Key of the SET that holds the direct supertype UUIDs of the given type (multiple inheritance supported; absent for root types).- Parameters:
uuid- the UUID of the type- Returns:
- the Redis key
-
typeLinearizationKey
Key that stores the precomputed, C3-linearized list of ancestor type names for the given type, in Method-Resolution-Order (most-derived-first) -- internal-only bookkeeping, never part of a type's own returned JSON representation (mirrorstype:parent/type:children: derived structural data kept alongside the type's canonical blob, not inside it). Computed once, at type creation / cache warm-up time, so that ordinary reads never have to recompute or re-derive it.- Parameters:
uuid- the UUID of the type- Returns:
- the Redis key
-
typeMissingKey
Key of the negative-cache tombstone recording that no Type with this name exists.Keyed by name rather than by UUID, because a type that does not exist has no UUID — which is precisely the lookup being answered. Shares the
type:namespace so thatinvalidateAll()clears tombstones along with everything else.- Parameters:
typeName- the canonical type name- Returns:
- the Redis key
-