Class DestinationIdStrategy<T,S>
- java.lang.Object
-
- com.solace.serdes.common.resolver.strategy.DestinationIdStrategy<T,S>
-
- Type Parameters:
T- The type of object to be serialized/deserializedS- The type of schema
- All Implemented Interfaces:
ArtifactReferenceResolverStrategy<T,S>
- Direct Known Subclasses:
SolaceTopicIdStrategy
public class DestinationIdStrategy<T,S> extends Object implements ArtifactReferenceResolverStrategy<T,S>
A strategy for resolving artifact references based on destination names.This strategy uses the destination name from the record's metadata as the artifact ID and uses the default group ID. It requires that the record's metadata and destination name are non-null and non-empty.
-
-
Constructor Summary
Constructors Constructor Description DestinationIdStrategy()Constructs a DestinationIdStrategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactReferenceartifactReference(Record<T> data, ParsedSchema<S> parsedSchema)Resolves and returns theArtifactReferencefor a given record.booleanloadSchema()Determines whether to load and provide the parsed schema to theArtifactReferenceResolverStrategy.artifactReference(Record, ParsedSchema)method.
-
-
-
Method Detail
-
artifactReference
public ArtifactReference artifactReference(Record<T> data, ParsedSchema<S> parsedSchema)
Description copied from interface:ArtifactReferenceResolverStrategyResolves and returns theArtifactReferencefor a given record. ThisArtifactReferenceindicates where the schema is located or should be registered within the registry.- Specified by:
artifactReferencein interfaceArtifactReferenceResolverStrategy<T,S>- Parameters:
data- The record for which to resolve theArtifactReference.parsedSchema- The schema of the record being resolved. This can be null ifArtifactReferenceResolverStrategy.loadSchema()returns false.- Returns:
- The
ArtifactReferenceunder which the schema is located or should be registered.
-
loadSchema
public boolean loadSchema()
Description copied from interface:ArtifactReferenceResolverStrategyDetermines whether to load and provide the parsed schema to theArtifactReferenceResolverStrategy.artifactReference(Record, ParsedSchema)method.- Specified by:
loadSchemain interfaceArtifactReferenceResolverStrategy<T,S>- Returns:
- true if the schema should be loaded and passed, false otherwise. Default implementation returns true.
-
-