Package com.solace.serdes.avro.strategy
Class RecordIdStrategy
- java.lang.Object
-
- com.solace.serdes.avro.strategy.RecordIdStrategy
-
- All Implemented Interfaces:
ArtifactReferenceResolverStrategy<Object,org.apache.avro.Schema>
public class RecordIdStrategy extends Object implements ArtifactReferenceResolverStrategy<Object,org.apache.avro.Schema>
An implementation ofArtifactReferenceResolverStrategythat resolves artifact references based on the record ID for Avro schemas. This strategy extracts the artifact ID and group ID from the Avro schema's name and namespace, respectively, using the providedParsedSchema.
-
-
Constructor Summary
Constructors Constructor Description RecordIdStrategy()Constructs a new RecordIdStrategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactReferenceartifactReference(Record<Object> data, ParsedSchema<org.apache.avro.Schema> parsedSchema)Resolves and returns theArtifactReferencefor a givenParsedSchema.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.solace.serdes.common.resolver.strategy.ArtifactReferenceResolverStrategy
loadSchema
-
-
-
-
Method Detail
-
artifactReference
public ArtifactReference artifactReference(Record<Object> data, ParsedSchema<org.apache.avro.Schema> parsedSchema)
Resolves and returns theArtifactReferencefor a givenParsedSchema. This method uses the schema provided in theParsedSchemato extract the schema's name as the artifactId and the schema's namespace as the groupId to build theArtifactReference.- Specified by:
artifactReferencein interfaceArtifactReferenceResolverStrategy<Object,org.apache.avro.Schema>- Parameters:
data- The Avro record for which to resolve theArtifactReference. Note: This parameter is not used in the current implementation.parsedSchema- The parsed schema of the record, used to extract the artifact reference information.- Returns:
- An
ArtifactReferencecontaining the artifact ID and group ID derived from theParsedSchema.
-
-