Class RegistrationVersionSanitizer

java.lang.Object
ai.pipestream.registration.handlers.RegistrationVersionSanitizer

public final class RegistrationVersionSanitizer extends Object
Defensive sanitizer for registration version strings coming from modules/services. Prevents unresolved template placeholders from reaching persistence/indexing/registry calls.
  • Method Details

    • sanitize

      public static String sanitize(String rawVersion, String registrationName, org.jboss.logging.Logger log, String sourceField)
      Sanitizes a registration version string, falling back to FALLBACK_VERSION for null, blank, or placeholder-like values, and logging a warning when the value had to be replaced.
      Parameters:
      rawVersion - the version string as received
      registrationName - the name of the registering module/service (for the log message)
      log - the logger to warn through, or null to suppress logging
      sourceField - the name of the field the version came from (for the log message)
      Returns:
      the original trimmed version, or FALLBACK_VERSION when it was unusable