Class RegistryIndex

java.lang.Object
network.ike.docs.plugin.diff.RegistryIndex

public final class RegistryIndex extends Object
One side's view of the IKE topic registry: topic id → source file and assembly id → flattened topic-refs. This is what lets an assembly module's idoc:diff run project the corpus diff onto its own membership (ike-issues#649 scoping decision) — the registry, not include-line parsing, is the source of truth for which topics an assembly contains.

Also hosts the registry YAML shape helpers shared with RegistryDelta.

  • Method Details

    • load

      public static RegistryIndex load(GitSource git, String ref, String registryRoot) throws IOException
      Load the registry as it stands on one side of a comparison.
      Parameters:
      git - repository access
      ref - the side to read (GitSource.WORKTREE or a committish) — projections use the to side, so membership reflects the state under review
      registryRoot - repository-relative source root that contains topic-registry.yaml and topic-registry/
      Returns:
      the index (empty maps when no registry exists on that side)
      Throws:
      IOException - on repository access failure
    • topicFile

      public String topicFile(String topicId)
      Resolve a topic id to its source file, relative to the registry root (e.g. topics/arch/asg-substrate.adoc).
      Parameters:
      topicId - the topic id
      Returns:
      the registry-root-relative file, or null when the id is unknown
    • assemblyRefs

      public List<String> assemblyRefs(String assemblyId)
      An assembly's flattened topic-refs, in document order.
      Parameters:
      assemblyId - the assembly id (by IKE naming convention equal to the module's artifactId)
      Returns:
      the topic ids, or null when the assembly is not registered
    • membershipDelta

      public static String membershipDelta(GitSource git, String fromRef, String toRef, String registryRoot, String assemblyId) throws IOException
      Render one assembly's membership delta (topic-refs added and removed between two sides) as a small registry-delta partial for an assembly-projection packet.
      Parameters:
      git - repository access
      fromRef - the from side
      toRef - the to side (may be GitSource.WORKTREE)
      registryRoot - the registry source root
      assemblyId - the assembly to report on
      Returns:
      the partial's text with a level-1 title, or an empty string when this assembly's membership is unchanged
      Throws:
      IOException - on repository access failure