Class EngineManifest
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a sink registration within the manifest, combining the storage key with the engine-bound status. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddFlavorStoragePair(String flavorSignature, EngineManifest.SinkRegistration registration) Adds or updates a flavor-to-sink mapping.booleanaddFlavorStoragePair(String flavorSignature, StorageKey storageKey) Adds a flavor-to-sink mapping with automatic engine-bound detection.booleanaddFlavorStoragePair(String flavorSignature, StorageKey storageKey, boolean engineBound) Adds a flavor-to-sink mapping and optionally marks the sink as engine-bound.booleanaddFlavorStoragePairIfAbsent(String flavorSignature, EngineManifest.SinkRegistration registration) Adds a flavor-to-sink mapping only if no registration with the same storage key exists.booleanaddFlavorStoragePairIfAbsent(String flavorSignature, StorageKey storageKey, boolean engineBound) Adds a flavor-to-sink mapping only if no registration with the same storage key exists.booleanReturns whether this manifest contains any flavor mappings.booleanstatic EngineManifestCreates a new EngineManifest with the specified engine ID.static EngineManifestfromGson(com.inductiveautomation.ignition.common.gson.JsonElement json) static EngineManifestReturns the set of sink IDs that are bound to the engine's lifecycle in at least one flavor.intReturns the number of distinct flavors in this manifest.Returns a map of flavor signatures to their sink registrations.Returns a map of flavor signatures to their storage keys.inthashCode()booleanisEngineBound(String sinkId) Checks if a sink is bound to the engine's lifecycle in any flavor.booleanisEngineBound(String flavorSignature, String sinkId) Checks if a sink is bound to the engine's lifecycle for a specific flavor.voidremoveAllStoragePairs(String flavorSignature) Removes all sink mappings for a flavor.booleanremoveFlavorStoragePair(String flavorSignature, StorageKey storageKey) Removes a flavor-to-sink mapping by storage key.static com.inductiveautomation.ignition.common.gson.JsonObjecttoGson(EngineManifest manifest) static StringtoJson(EngineManifest manifest) withRenamedEngineId(String newEngineId) Creates a new EngineManifest with a renamed engine ID.withRenamedSinkId(String oldSinkId, String newSinkId) Creates a new EngineManifest with a renamed sink ID.withRenamedSinkIdForFlavors(Set<String> flavorSignatures, String oldSinkId, String newSinkId) Creates a new EngineManifest with a renamed sink ID, scoped to specific flavor signatures.
-
Field Details
-
ENGINE_MANIFEST_FILE_NAME
- See Also:
-
-
Method Details
-
from
Creates a new EngineManifest with the specified engine ID.The engine ID is normalized to lowercase to match the behavior of
StorageKey.- Parameters:
engineId- the engine identifier- Returns:
- a new EngineManifest
-
withRenamedEngineId
Creates a new EngineManifest with a renamed engine ID. All flavor-to-sink mappings are copied over with their storage keys updated to reference the new engine ID.For engine-bound sinks, both engineId and sinkId are updated to the new engine ID. For independent sinks, only the engineId is updated while the sinkId is preserved.
- Parameters:
newEngineId- the new engine ID to use- Returns:
- a new EngineManifest with the updated engine ID and storage keys
-
withRenamedSinkId
Creates a new EngineManifest with a renamed sink ID. All flavor-to-sink mappings are copied over with their storage keys updated to reference the new sink ID where the old sink ID matches.This method only renames the sinkId in storage keys. For engine-bound sinks where the entire engine should be renamed, use
withRenamedEngineId(String)instead. The caller is responsible for determining which method to use based on the sink type.- Parameters:
oldSinkId- the old sink ID to renamenewSinkId- the new sink ID to use- Returns:
- a new EngineManifest with the updated sink IDs
-
withRenamedSinkIdForFlavors
public EngineManifest withRenamedSinkIdForFlavors(Set<String> flavorSignatures, String oldSinkId, String newSinkId) Creates a new EngineManifest with a renamed sink ID, scoped to specific flavor signatures. Only entries whose flavor signature is in the given set are renamed; all other entries are copied unchanged.- Parameters:
flavorSignatures- the set of flavor signatures to scope the rename tooldSinkId- the old sink ID to renamenewSinkId- the new sink ID to use- Returns:
- a new EngineManifest with the scoped sink ID rename applied
- Since:
- 8.3.4
-
addFlavorStoragePair
Adds a flavor-to-sink mapping with automatic engine-bound detection.This method infers whether the sink is engine-bound based on the storage key pattern. If the storage key has matching engineId and sinkId (the
StorageKey.repeated(String)pattern), the sink is marked as engine-bound. Otherwise, it's treated as independent.For explicit control over engine-bound status (e.g., when a sink has independent identity even though its name matches the engine), use
addFlavorStoragePair(String, StorageKey, boolean).- Parameters:
flavorSignature- the data flavor signaturestorageKey- the storage key identifying the sink- Returns:
- true if the mapping was added
-
addFlavorStoragePair
public boolean addFlavorStoragePair(String flavorSignature, StorageKey storageKey, boolean engineBound) Adds a flavor-to-sink mapping and optionally marks the sink as engine-bound.Engine-bound sinks have their sinkId renamed when the engine is renamed. This is appropriate for sinks like DatasourceQuerySink that are inherently tied to the datasource/engine. Independent sinks have their own identity separate from the engine.
- Parameters:
flavorSignature- the data flavor signaturestorageKey- the storage key identifying the sinkengineBound- true if this sink is bound to the engine's lifecycle- Returns:
- true if the mapping was added
-
addFlavorStoragePair
public boolean addFlavorStoragePair(String flavorSignature, EngineManifest.SinkRegistration registration) Adds or updates a flavor-to-sink mapping.If a registration with the same storage key already exists for this flavor, it will be replaced. This ensures that when a sink registers with an explicit engine-bound value, it overwrites any previously inferred value (e.g., from data storage before the sink registered).
Use this method when the engine-bound value is authoritative (e.g., from sink registration). Use
addFlavorStoragePairIfAbsent(java.lang.String, com.inductiveautomation.ignition.gateway.storeforward.StorageKey, boolean)when the engine-bound value is inferred and should not overwrite an existing authoritative value.- Parameters:
flavorSignature- the data flavor signatureregistration- the sink registration containing storage key and engine-bound status- Returns:
- true if the mapping was added or updated (changed)
-
addFlavorStoragePairIfAbsent
public boolean addFlavorStoragePairIfAbsent(String flavorSignature, StorageKey storageKey, boolean engineBound) Adds a flavor-to-sink mapping only if no registration with the same storage key exists.This method is intended for cases where the engine-bound value is inferred (e.g., from data storage) and should not overwrite an existing authoritative value from sink registration.
- Parameters:
flavorSignature- the data flavor signaturestorageKey- the storage key identifying the sinkengineBound- true if this sink is bound to the engine's lifecycle- Returns:
- true if the mapping was added, false if a registration with the same storage key already exists
-
addFlavorStoragePairIfAbsent
public boolean addFlavorStoragePairIfAbsent(String flavorSignature, EngineManifest.SinkRegistration registration) Adds a flavor-to-sink mapping only if no registration with the same storage key exists.This method is intended for cases where the engine-bound value is inferred (e.g., from data storage) and should not overwrite an existing authoritative value from sink registration.
- Parameters:
flavorSignature- the data flavor signatureregistration- the sink registration containing storage key and engine-bound status- Returns:
- true if the mapping was added, false if a registration with the same storage key already exists
-
getEngineBoundSinkIds
Returns the set of sink IDs that are bound to the engine's lifecycle in at least one flavor. These sinks will have their directories renamed when the engine is renamed.- Returns:
- unmodifiable set of engine-bound sink IDs
-
isEngineBound
Checks if a sink is bound to the engine's lifecycle for a specific flavor.- Parameters:
flavorSignature- the flavor signaturesinkId- the sink ID to check- Returns:
- true if the sink is engine-bound for this flavor
-
isEngineBound
Checks if a sink is bound to the engine's lifecycle in any flavor.- Parameters:
sinkId- the sink ID to check- Returns:
- true if the sink is engine-bound in at least one flavor
-
removeFlavorStoragePair
Removes a flavor-to-sink mapping by storage key.- Parameters:
flavorSignature- the data flavor signaturestorageKey- the storage key identifying the sink to remove- Returns:
- true if a mapping was removed
-
removeAllStoragePairs
Removes all sink mappings for a flavor.- Parameters:
flavorSignature- the data flavor signature
-
containsFlavors
public boolean containsFlavors()Returns whether this manifest contains any flavor mappings.- Returns:
- true if there are flavor mappings
-
getFlavorCount
public int getFlavorCount()Returns the number of distinct flavors in this manifest.- Returns:
- the flavor count
-
getSinksByFlavor
Returns a map of flavor signatures to their sink registrations.- Returns:
- unmodifiable map of flavor to sink registrations
-
getStorageKeysByFlavor
Returns a map of flavor signatures to their storage keys. This is a convenience method that extracts just the storage keys from the sink registrations.- Returns:
- unmodifiable map of flavor to storage keys
-
getEngineId
-
equals
-
hashCode
public int hashCode() -
fromGson
public static EngineManifest fromGson(com.inductiveautomation.ignition.common.gson.JsonElement json) -
fromJson
-
toGson
public static com.inductiveautomation.ignition.common.gson.JsonObject toGson(EngineManifest manifest) -
toJson
-