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 ArtifactReference
artifactReference(Record<T> data, ParsedSchema<S> parsedSchema)
Resolves and returns theArtifactReference
for a given record.boolean
loadSchema()
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:ArtifactReferenceResolverStrategy
Resolves and returns theArtifactReference
for a given record. ThisArtifactReference
indicates where the schema is located or should be registered within the registry.- Specified by:
artifactReference
in 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
ArtifactReference
under which the schema is located or should be registered.
-
loadSchema
public boolean loadSchema()
Description copied from interface:ArtifactReferenceResolverStrategy
Determines whether to load and provide the parsed schema to theArtifactReferenceResolverStrategy.artifactReference(Record, ParsedSchema)
method.- Specified by:
loadSchema
in interfaceArtifactReferenceResolverStrategy<T,S>
- Returns:
- true if the schema should be loaded and passed, false otherwise. Default implementation returns true.
-
-