Interface ArtifactImporter<T>
- Type Parameters:
T- the manifest entry type this importer handles
- All Known Implementing Classes:
EndpointImporter,GroupImporter,LibraryImporter,MenuImporter,PanelImporter,PatchImporter,PermissionImporter,ProcessImporter,PropertyImporter,QueryImporter,ReportImporter,ScriptImporter
public interface ArtifactImporter<T>
Strategy interface for importing a specific artifact type from a Git manifest.
Each artifact type (panels, scripts, processes, etc.) has its own implementation.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddeleteOrphan(String key, String user) Deletes the artifact identified by the given key, if it exists.Returns the artifact type name this importer handles (e.g.getEntries(GitManifest manifest) Extracts the typed entry list from the manifest.intgetOrder()Returns the execution order.importEntry(T entry, FileResolver resolver, String user) Imports a single entry.
-
Method Details
-
getArtifactType
String getArtifactType()Returns the artifact type name this importer handles (e.g. "panels", "scripts"). Used for logging and result tracking. -
getOrder
int getOrder()Returns the execution order. Lower values run first. This ensures dependencies are imported before dependents (e.g. groups before permissions, queries before reports). -
getEntries
Extracts the typed entry list from the manifest.- Parameters:
manifest- the parsed manifest- Returns:
- list of entries to import, may be empty
-
importEntry
Imports a single entry. Handles create-or-update semantics: looks up by key/sigla, creates if missing, updates if exists.- Parameters:
entry- the manifest entry to importresolver- resolves relative file paths to input streamsuser- the login of the user performing the import- Returns:
- result indicating what happened (CREATED, UPDATED, SKIPPED, ERROR)
-
deleteOrphan
Deletes the artifact identified by the given key, if it exists. Called when a key that was previously tracked is no longer present in the manifest. Implementations that cannot safely delete (e.g. require additional context or have active dependencies) should leave this as a no-op.- Parameters:
key- the artifact key (sigla) to deleteuser- the login of the user performing the sync
-