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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Closes this schema resolver and releases any system resources associated with it.default 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 reference)Resolves a schema based on the given artifact reference.voidsetClient(com.solace.serdes.registry.rest.client.RegistryClient client)Sets the client for thisSchemaResolver.voidsetSchemaParser(SchemaParser<S,T> schemaParser)Sets the schema parser for theSchemaResolver.
-
-
-
Method Detail
-
configure
default void configure(Map<String,?> properties)
Configures thisSchemaResolverwith the given configuration properties.- Parameters:
properties- the configuration properties
-
setClient
void setClient(com.solace.serdes.registry.rest.client.RegistryClient client)
Sets the client for thisSchemaResolver.- Parameters:
client- the client to be used for resolving schemas
-
setSchemaParser
void setSchemaParser(SchemaParser<S,T> schemaParser)
Sets the schema parser for theSchemaResolver.- 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
SchemaLookUpResultsobject 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
SchemaLookUpResultsobject 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-