Interface TierHandler

All Known Implementing Classes:
ToolOwnedTierHandler, TrackedBlockTierHandler, TrackedTierHandler

public interface TierHandler
A tier-specific planner that converts a manifest entry + current disk state + template bytes + prior lockfile state into a single TierAction.

One implementation per file-based ScaffoldTier (ScaffoldTier.TOOL_OWNED, ScaffoldTier.TRACKED, ScaffoldTier.TRACKED_BLOCK). Model-managed entries have their own adapter machinery and do not go through TierHandler.

Handlers are pure — they must not touch disk, and they must be safe to call in any order. The caller (scaffold planner) is responsible for locating the file, reading its bytes, and passing them in.

  • Method Summary

    Modifier and Type
    Method
    Description
    plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry)
    Plan a single entry.
    Which tier this handler is responsible for.
  • Method Details

    • tier

      ScaffoldTier tier()
      Which tier this handler is responsible for.
      Returns:
      the tier; never null
    • plan

      TierAction plan(ManifestEntry entry, Path resolvedDest, byte[] currentContent, byte[] templateContent, byte[] createContent, LockfileEntry priorEntry)
      Plan a single entry.
      Parameters:
      entry - the manifest entry being planned
      resolvedDest - absolute destination path (placeholders already expanded)
      currentContent - bytes currently on disk at resolvedDest, or null if no file exists
      templateContent - bytes loaded from the scaffold zip at entry.source(); never null for file-based tiers
      createContent - bytes loaded from the scaffold zip at the entry's create-source extra, or null when the entry declares none. Only consulted when currentContent is null — tiers that support create-case seeding (currently ScaffoldTier.TRACKED_BLOCK) seed this content into the newly created file ahead of their managed region; other tiers ignore it
      priorEntry - lockfile entry from the last publish, or null if this entry has never been applied
      Returns:
      a TierAction describing what publish should do
      Throws:
      ScaffoldException - if the handler cannot decide (e.g. malformed block markers)