Interface SchemaResolver<T,​S>

  • Type Parameters:
    T - The type of the payload that matches with the schema.
    S - The type of schema this resolver handles.
    All Superinterfaces:
    AutoCloseable, Closeable
    All Known Implementing Classes:
    DefaultSchemaResolver

    public interface SchemaResolver<T,​S>
    extends Closeable
    An interface for resolving schemas.
    • Method Detail

      • configure

        default void configure​(Map<String,​?> properties)
        Configures this SchemaResolver with the given configuration properties.
        Parameters:
        properties - the configuration properties
      • setClient

        void setClient​(com.solace.serdes.registry.rest.client.RegistryClient client)
        Sets the client for this SchemaResolver.
        Parameters:
        client - the client to be used for resolving schemas
      • setSchemaParser

        void setSchemaParser​(SchemaParser<S,​T> schemaParser)
        Sets the schema parser for the SchemaResolver.
        Parameters:
        schemaParser - the schema parser to be used when resolving schemas.
      • resolveSchema

        SchemaLookUpResults<S> resolveSchema​(ArtifactReference reference)
        Resolves a schema based on the given artifact reference.
        Parameters:
        reference - The artifact reference used to look up the schema.
        Returns:
        A SchemaLookUpResults object containing the resolved schema and related information.
      • resolveSchema

        SchemaLookUpResults<S> resolveSchema​(Record<T> data)
        Resolves a schema based on the given record.
        Parameters:
        data - The record used to look up the schema.
        Returns:
        A SchemaLookUpResults object containing the resolved schema and related information.
      • close

        default void close()
        Closes this schema resolver and releases any system resources associated with it. This method is called automatically when the resolver is used in a try-with-resources statement.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable