Class RpcServiceRegistry

java.lang.Object
ru.pathcreator.pyc.rpc.schema.RpcServiceRegistry

public final class RpcServiceRegistry extends Object
Optional startup-time registry for channel and method definitions.

The registry is intentionally separate from rpc.core transport classes. It is meant for service bootstrapping, validation, and reporting: conflict detection, channel and method inventory, protocol visibility, and startup-time analysis. It does not participate in the request/response hot path.

  • Method Details

    • builder

      public static RpcServiceRegistry.Builder builder()
      Creates a new registry builder.
      Returns:
      empty registry builder
    • channels

      public List<RpcChannelSchema> channels()
      Returns the immutable list of registered channel schema entries.
      Returns:
      immutable channel schema list
    • channelCount

      public int channelCount()
      Returns the number of logical channels present in the registry.
      Returns:
      channel count
    • methodCount

      public int methodCount()
      Returns the total number of registered methods across all channels.
      Returns:
      total method count
    • analyze

      public List<RpcValidationIssue> analyze()
      Performs non-fatal startup-time analysis and returns advisory issues that may still be worth reviewing before a service starts taking traffic.
      Returns:
      immutable list of validation warnings
    • renderTextReport

      public String renderTextReport()
      Renders a readable multi-line report for logs, startup diagnostics, or deployment review.
      Returns:
      human-readable registry report
    • renderJsonReport

      public String renderJsonReport()
      Renders the registry as a compact JSON document suitable for logging, diagnostics, or writing to a file.
      Returns:
      JSON report
    • writeTextReport

      public void writeTextReport(Path path) throws IOException
      Writes the text report to the provided file path, creating parent directories when needed.
      Parameters:
      path - destination file path
      Throws:
      IOException - when the report cannot be written
    • writeJsonReport

      public void writeJsonReport(Path path) throws IOException
      Writes the JSON report to the provided file path, creating parent directories when needed.
      Parameters:
      path - destination file path
      Throws:
      IOException - when the report cannot be written