Record Class ValidationContext

java.lang.Object
java.lang.Record
io.confluent.kafka.odyssey.ValidationContext

public record ValidationContext(ClassifyResult classified, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient srClient, boolean srClientReady, String errorMessage) extends Record
Context for the validation phase, containing classified topics and SR client. Created after classification and (optionally) token acquisition.

Use ready(ClassifyResult, SchemaRegistryClient) when an SR client is available, or notReady(ClassifyResult, String) when it could not be created (e.g., token acquisition failed).

  • Constructor Details

    • ValidationContext

      public ValidationContext(ClassifyResult classified, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient srClient, boolean srClientReady, String errorMessage)
      Creates an instance of a ValidationContext record class.
      Parameters:
      classified - the value for the classified record component
      srClient - the value for the srClient record component
      srClientReady - the value for the srClientReady record component
      errorMessage - the value for the errorMessage record component
  • Method Details

    • ready

      public static ValidationContext ready(ClassifyResult classified, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient srClient)
    • notReady

      public static ValidationContext notReady(ClassifyResult classified, String errorMessage)
    • topicsWithOdysseyConfigs

      public List<org.apache.kafka.common.message.CreateTopicsRequestData.CreatableTopic> topicsWithOdysseyConfigs()
    • namespace

      public String namespace()
    • extractedAssociations

      public Map<String, ParsedAssociations> extractedAssociations()
    • request

      public OdysseyRequestContext request()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • classified

      public ClassifyResult classified()
      Returns the value of the classified record component.
      Returns:
      the value of the classified record component
    • srClient

      public io.confluent.kafka.schemaregistry.client.SchemaRegistryClient srClient()
      Returns the value of the srClient record component.
      Returns:
      the value of the srClient record component
    • srClientReady

      public boolean srClientReady()
      Returns the value of the srClientReady record component.
      Returns:
      the value of the srClientReady record component
    • errorMessage

      public String errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component