Package io.apicurio.registry.resolver
Class AbstractSchemaResolver<S,T>
java.lang.Object
io.apicurio.registry.resolver.AbstractSchemaResolver<S,T>
- All Implemented Interfaces:
SchemaResolver<S,,T> Closeable,AutoCloseable
- Direct Known Subclasses:
DefaultSchemaResolver
Base implementation of
SchemaResolver-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArtifactReferenceResolverStrategy<S, T> protected RegistryClientFacadeprotected SchemaResolverConfigprotected Stringprotected Stringprotected Stringprotected final ConcurrentHashMap<ArtifactCoordinates, ParsedSchema<S>> protected booleanprotected final ERCache<SchemaLookupResult<S>> protected SchemaParser<S, T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidConfigure, if supported.protected SchemaLookupResult<S> loadFromVersionCoordinates(RegistryVersionCoordinates version, ParsedSchema<S> parsedSchema) protected SchemaLookupResult<S> loadFromVersionCoordinates(RegistryVersionCoordinates version, ParsedSchema<S> parsedSchema, Set<ArtifactReference> references) voidreset()Hard reset cacheprotected StringresolveArtifactId(String artifactId, boolean isReference, String referenceArtifactId) protected ArtifactReferenceresolveArtifactReference(Record<T> data, ParsedSchema<S> parsedSchema, boolean isReference, String referenceArtifactId) Resolve an artifact reference for the given record, and optional parsed schema.protected Map<String, ParsedSchema<S>> resolveReferences(List<RegistryArtifactReference> artifactReferences) Resolves artifact references recursively, using an instance-level deduplication cache to avoid redundant Registry API calls for the same groupId/artifactId/version across independent resolution trees.protected SchemaLookupResult<S> resolveSchemaByGlobalId(long globalId) voidsetArtifactResolverStrategy(ArtifactReferenceResolverStrategy<S, T> artifactResolverStrategy) voidsetClientFacade(RegistryClientFacade clientFacade) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.apicurio.registry.resolver.SchemaResolver
resolveSchema, resolveSchemaByArtifactReference
-
Field Details
-
schemaCache
-
referenceCache
-
config
-
schemaParser
-
clientFacade
-
artifactResolverStrategy
-
explicitArtifactGroupId
-
explicitArtifactId
-
explicitArtifactVersion
-
resolveDereferenced
protected boolean resolveDereferenced
-
-
Constructor Details
-
AbstractSchemaResolver
public AbstractSchemaResolver()
-
-
Method Details
-
configure
Description copied from interface:SchemaResolverConfigure, if supported.- Specified by:
configurein interfaceSchemaResolver<S,T>
-
setClientFacade
- Specified by:
setClientFacadein interfaceSchemaResolver<S,T>
-
getClientFacade
- Specified by:
getClientFacadein interfaceSchemaResolver<S,T>
-
setArtifactResolverStrategy
public void setArtifactResolverStrategy(ArtifactReferenceResolverStrategy<S, T> artifactResolverStrategy) - Specified by:
setArtifactResolverStrategyin interfaceSchemaResolver<S,T> - Parameters:
artifactResolverStrategy- the artifactResolverStrategy to set
-
getSchemaParser
- Specified by:
getSchemaParserin interfaceSchemaResolver<S,T> - See Also:
-
resolveArtifactReference
protected ArtifactReference resolveArtifactReference(Record<T> data, ParsedSchema<S> parsedSchema, boolean isReference, String referenceArtifactId) Resolve an artifact reference for the given record, and optional parsed schema. This will use the artifact resolver strategy and then override the values from that strategy with any explicitly configured values (groupId, artifactId, version).- Parameters:
data-parsedSchema-isReference-- Returns:
- artifact reference
-
resolveArtifactId
-
resolveSchemaByGlobalId
-
resolveReferences
protected Map<String,ParsedSchema<S>> resolveReferences(List<RegistryArtifactReference> artifactReferences) Resolves artifact references recursively, using an instance-level deduplication cache to avoid redundant Registry API calls for the same groupId/artifactId/version across independent resolution trees.- Parameters:
artifactReferences- the references to resolve- Returns:
- map of reference name to parsed schema
-
reset
public void reset()Description copied from interface:SchemaResolverHard reset cache- Specified by:
resetin interfaceSchemaResolver<S,T> - See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- See Also:
-
loadFromVersionCoordinates
protected SchemaLookupResult<S> loadFromVersionCoordinates(RegistryVersionCoordinates version, ParsedSchema<S> parsedSchema) -
loadFromVersionCoordinates
protected SchemaLookupResult<S> loadFromVersionCoordinates(RegistryVersionCoordinates version, ParsedSchema<S> parsedSchema, Set<ArtifactReference> references)
-