Class StreamDefinitionValidator

java.lang.Object
org.infosmid.stream.core.StreamDefinitionValidator

public class StreamDefinitionValidator extends Object
Validates stream definitions against application metadata. Ensures application usage in a stream matches the defined application type.
  • Field Details

    • SUPPORTED_TYPES

      public static final Set<String> SUPPORTED_TYPES
  • Constructor Details

    • StreamDefinitionValidator

      public StreamDefinitionValidator()
    • StreamDefinitionValidator

      public StreamDefinitionValidator(@NonNull StreamParser streamParser, @NonNull StreamBindingResolver streamBindingResolver)
  • Method Details

    • getStreamParser

      public @NonNull StreamParser getStreamParser()
    • getStreamBindingResolver

      public @NonNull StreamBindingResolver getStreamBindingResolver()
    • validate

      public void validate(@NonNull List<StreamDefinition> streamDefinitions, @Nullable Properties metadataProperties)
      Validates a list of stream definitions against application metadata.
      Parameters:
      streamDefinitions - the stream definitions to validate
      metadataProperties - the metadata properties containing image definitions
    • validate

      public void validate(@NonNull StreamDefinition streamDefinition, @Nullable Properties metadataProperties)
      Validates a stream definition against application metadata.
      Parameters:
      streamDefinition - the stream definition to validate
      metadataProperties - the metadata properties containing image definitions
    • validate

      public void validate(@NonNull String streamName, @NonNull StreamNode streamNode, @Nullable Properties metadataProperties)
      Validates a parsed stream node against application metadata.
      Parameters:
      streamName - the name of the stream
      streamNode - the parsed stream node
      metadataProperties - the metadata properties containing image definitions
    • validateAppType

      public void validateAppType(@NonNull String streamName, @NonNull AppNode appNode, @NonNull StreamBindingResolver.AppType actualType)
      Validates that the application type is one of the supported types.
      Parameters:
      streamName - the name of the stream
      appNode - the application node in the stream
      actualType - the topological type of the application
    • resolveImage

      public @NonNull String resolveImage(@NonNull String streamName, @NonNull AppNode appNode, @NonNull StreamBindingResolver.AppType actualType, @Nullable Properties metadataProperties)
      Resolves the container image URL for an application and validates its type.
      Parameters:
      streamName - the name of the stream
      appNode - the application node in the stream
      actualType - the topological type of the application
      metadataProperties - the metadata properties containing image definitions
      Returns:
      the resolved container image URL