Class ApicurioDescriptorLoader
java.lang.Object
ai.pipestream.common.util.descriptor.ApicurioDescriptorLoader
- All Implemented Interfaces:
DescriptorLoader
Loads Protocol Buffer descriptors from Apicurio Schema Registry.
This is a placeholder implementation for future integration with Apicurio.
When implemented, this will:
- Connect to Apicurio Registry REST API
- Download proto schemas by artifact ID or group
- Cache descriptors locally
- Support schema versioning
- Handle schema evolution
Example future usage:
ApicurioDescriptorLoader loader = ApicurioDescriptorLoader.builder()
.registryUrl("http://apicurio-registry:8080/apis/registry/v2")
.groupId("ai.pipestream.protos")
.authentication(apiKey)
.build();
List<FileDescriptor> descriptors = loader.loadDescriptors();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for ApicurioDescriptorLoader.Nested classes/interfaces inherited from interface ai.pipestream.common.util.descriptor.DescriptorLoader
DescriptorLoader.DescriptorLoadException -
Constructor Summary
ConstructorsConstructorDescriptionApicurioDescriptorLoader(String registryUrl, String groupId, String artifactId) Creates an ApicurioDescriptorLoader (placeholder). -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder.Gets the artifact ID.Gets the group ID.Gets a human-readable name for this loader type.Gets the registry URL.booleanChecks if this loader is available and can load descriptors.com.google.protobuf.Descriptors.FileDescriptorloadDescriptor(String fileName) Loads a specific file descriptor by name.List<com.google.protobuf.Descriptors.FileDescriptor> Loads all available file descriptors from this loader's source.
-
Constructor Details
-
ApicurioDescriptorLoader
Creates an ApicurioDescriptorLoader (placeholder).- Parameters:
registryUrl- The Apicurio registry URLgroupId- The schema group IDartifactId- Optional specific artifact ID
-
-
Method Details
-
loadDescriptors
public List<com.google.protobuf.Descriptors.FileDescriptor> loadDescriptors() throws DescriptorLoader.DescriptorLoadExceptionDescription copied from interface:DescriptorLoaderLoads all available file descriptors from this loader's source.- Specified by:
loadDescriptorsin interfaceDescriptorLoader- Returns:
- A list of FileDescriptors
- Throws:
DescriptorLoader.DescriptorLoadException- if loading fails
-
loadDescriptor
public com.google.protobuf.Descriptors.FileDescriptor loadDescriptor(String fileName) throws DescriptorLoader.DescriptorLoadException Description copied from interface:DescriptorLoaderLoads a specific file descriptor by name.- Specified by:
loadDescriptorin interfaceDescriptorLoader- Parameters:
fileName- The proto file name (e.g., "my_types.proto")- Returns:
- The FileDescriptor, or null if not found
- Throws:
DescriptorLoader.DescriptorLoadException- if loading fails
-
isAvailable
public boolean isAvailable()Description copied from interface:DescriptorLoaderChecks if this loader is available and can load descriptors. For example, a GoogleDescriptorLoader would return false if the .dsc file is not on classpath.- Specified by:
isAvailablein interfaceDescriptorLoader- Returns:
- true if the loader can load descriptors
-
getLoaderType
Description copied from interface:DescriptorLoaderGets a human-readable name for this loader type.- Specified by:
getLoaderTypein interfaceDescriptorLoader- Returns:
- The loader type name
-
getRegistryUrl
Gets the registry URL.- Returns:
- The registry URL
-
getGroupId
Gets the group ID.- Returns:
- The group ID
-
getArtifactId
Gets the artifact ID.- Returns:
- The artifact ID, or null if loading all artifacts in group
-
builder
Creates a new builder.- Returns:
- A new builder instance
-