Class DefaultSchemaResolver<T,S>
- java.lang.Object
-
- com.solace.serdes.common.resolver.DefaultSchemaResolver<T,S>
-
- Type Parameters:
T- The type of object to be serialized/deserializedS- The type of schema
- All Implemented Interfaces:
SchemaResolver<T,S>,Closeable,AutoCloseable
public class DefaultSchemaResolver<T,S> extends Object implements SchemaResolver<T,S>
Default implementation of the SchemaResolver interface for Solace Schema Registry. This class handles schema resolution, caching, and registry interactions for serialization and deserialization operations.The DefaultSchemaResolver manages schema lookups, caching, and resolution of schema references. It supports various lookup strategies including by content ID, global ID, or artifact coordinates. It also provides options for auto-registering schemas and finding the latest versions.
-
-
Constructor Summary
Constructors Constructor Description DefaultSchemaResolver()Constructs a DefaultSchemaResolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this schema resolver and releases any system resources associated with it.voidconfigure(Map<String,?> properties)Configures thisSchemaResolverwith the given configuration properties.SchemaLookUpResults<S>resolveSchema(Record<T> data)Resolves a schema based on the given record.SchemaLookUpResults<S>resolveSchema(ArtifactReference exactReference)Resolves a schema based on the given artifact reference.voidsetSchemaParser(SchemaParser<S,T> schemaParser)Sets the schema parser for theSchemaResolver.
-
-
-
Method Detail
-
configure
public void configure(Map<String,?> properties)
Description copied from interface:SchemaResolverConfigures thisSchemaResolverwith the given configuration properties.- Specified by:
configurein interfaceSchemaResolver<T,S>- Parameters:
properties- the configuration properties
-
resolveSchema
public SchemaLookUpResults<S> resolveSchema(ArtifactReference exactReference)
Description copied from interface:SchemaResolverResolves a schema based on the given artifact reference.- Specified by:
resolveSchemain interfaceSchemaResolver<T,S>- Parameters:
exactReference- The artifact reference used to look up the schema.- Returns:
- A
SchemaLookUpResultsobject containing the resolved schema and related information.
-
close
public void close()
Description copied from interface:SchemaResolverCloses 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSchemaResolver<T,S>
-
setSchemaParser
public void setSchemaParser(SchemaParser<S,T> schemaParser)
Description copied from interface:SchemaResolverSets the schema parser for theSchemaResolver.- Specified by:
setSchemaParserin interfaceSchemaResolver<T,S>- Parameters:
schemaParser- the schema parser to be used when resolving schemas.
-
resolveSchema
public SchemaLookUpResults<S> resolveSchema(Record<T> data)
Description copied from interface:SchemaResolverResolves a schema based on the given record.- Specified by:
resolveSchemain interfaceSchemaResolver<T,S>- Parameters:
data- The record used to look up the schema.- Returns:
- A
SchemaLookUpResultsobject containing the resolved schema and related information.
-
-