Class LocalV1License

java.lang.Object
io.confluent.kafka.schemaregistry.validator.licensing.entities.LocalV1License

public class LocalV1License extends Object
Version 1 license entity that groups DeploymentScope and LicenseType together to prevent orphaning of related license attributes during serialization.

This is a self-contained version for the validator plugin that doesn't depend on external license packages.

This entity provides: - A deterministic key for unique identification - JSON serialization for consumers - Version information for future compatibility

  • Constructor Details

    • LocalV1License

      public LocalV1License(LicenseType licenseType, DeploymentScope deploymentScope)
      Creates a LocalV1License with explicit type and scope.
      Parameters:
      licenseType - The license type
      deploymentScope - The deployment scope
  • Method Details

    • getKey

      public String getKey()
      Returns:
      The unique key for this license entity
    • getLicenseType

      public LicenseType getLicenseType()
      Returns:
      The license type
    • getDeploymentScope

      public DeploymentScope getDeploymentScope()
      Returns:
      The deployment scope
    • toJson

      public String toJson()
      Serializes this license entity to JSON.
      Returns:
      JSON string representation
      Throws:
      RuntimeException - if serialization fails
    • fromJson

      public static LocalV1License fromJson(String json)
      Deserializes a LocalV1License from JSON.
      Parameters:
      json - The JSON string
      Returns:
      The deserialized LocalV1License
      Throws:
      RuntimeException - if deserialization fails
    • toAttributeString

      public String toAttributeString()
      Creates the attribute string in the format: "key:json" This is the format that will be stored in the license attributes.
      Returns:
      The attribute string for serialization
    • fromAttributeString

      public static LocalV1License fromAttributeString(String attributeString)
      Parses a LocalV1License from an attribute string.
      Parameters:
      attributeString - The attribute string in format "key:json"
      Returns:
      The parsed LocalV1License
      Throws:
      IllegalArgumentException - if the attribute string is invalid
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object