Class TrackedTierHandler
java.lang.Object
network.ike.plugin.scaffold.TrackedTierHandler
- All Implemented Interfaces:
TierHandler
Tier handler for
ScaffoldTier.TRACKED.
Policy: checksum-guarded whole-file management. Publish refreshes
the file only when the on-disk content matches the lockfile's
applied-sha from the last publish. If the user has edited
the file, publish skips it and draft output surfaces a textual diff
so the user can merge manually.
Produces:
TierAction.UpToDatewhen bytes equal the template;TierAction.WritewithINSTALLwhen the file is absent and no prior entry exists;TierAction.WritewithUPDATEwhen the file matches the priorapplied-sha(safe refresh);TierAction.Skipwhen the file diverges from both the priorapplied-shaand the new template.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionplan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry) Plan a single entry.tier()Which tier this handler is responsible for.
-
Constructor Details
-
TrackedTierHandler
public TrackedTierHandler()Construct a stateless tracked tier handler. Instances are safe to share across planning calls; all per-invocation state lives on method parameters.
-
-
Method Details
-
tier
Description copied from interface:TierHandlerWhich tier this handler is responsible for.- Specified by:
tierin interfaceTierHandler- Returns:
- the tier; never
null
-
plan
public TierAction plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry) Description copied from interface:TierHandlerPlan a single entry.- Specified by:
planin interfaceTierHandler- Parameters:
entry- the manifest entry being plannedresolvedDest- absolute destination path (placeholders already expanded)currentContent- bytes currently on disk atresolvedDest, ornullif no file existstemplateContent- bytes loaded from the scaffold zip atentry.source(); nevernullfor file-based tierscreateContent- bytes loaded from the scaffold zip at the entry'screate-sourceextra, ornullwhen the entry declares none. Only consulted whencurrentContentisnull— tiers that support create-case seeding (currentlyScaffoldTier.TRACKED_BLOCK) seed this content into the newly created file ahead of their managed region; other tiers ignore itpriorEntry- lockfile entry from the last publish, ornullif this entry has never been applied- Returns:
- a
TierActiondescribing what publish should do
-