Class StreamDefinitionValidator
java.lang.Object
org.infosmid.stream.core.StreamDefinitionValidator
Validates stream definitions against application metadata.
Ensures application usage in a stream matches the defined application type.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStreamDefinitionValidator(@NonNull StreamParser streamParser, @NonNull StreamBindingResolver streamBindingResolver) -
Method Summary
Modifier and TypeMethodDescription@NonNull StreamBindingResolver@NonNull StreamParser@NonNull StringresolveImage(@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.voidvalidate(@NonNull String streamName, @NonNull StreamNode streamNode, @Nullable Properties metadataProperties) Validates a parsed stream node against application metadata.voidvalidate(@NonNull List<StreamDefinition> streamDefinitions, @Nullable Properties metadataProperties) Validates a list of stream definitions against application metadata.voidvalidate(@NonNull StreamDefinition streamDefinition, @Nullable Properties metadataProperties) Validates a stream definition against application metadata.voidvalidateAppType(@NonNull String streamName, @NonNull AppNode appNode, @NonNull StreamBindingResolver.AppType actualType) Validates that the application type is one of the supported types.
-
Field Details
-
SUPPORTED_TYPES
-
-
Constructor Details
-
StreamDefinitionValidator
public StreamDefinitionValidator() -
StreamDefinitionValidator
public StreamDefinitionValidator(@NonNull StreamParser streamParser, @NonNull StreamBindingResolver streamBindingResolver)
-
-
Method Details
-
getStreamParser
-
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 validatemetadataProperties- 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 validatemetadataProperties- 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 streamstreamNode- the parsed stream nodemetadataProperties- 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 streamappNode- the application node in the streamactualType- 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 streamappNode- the application node in the streamactualType- the topological type of the applicationmetadataProperties- the metadata properties containing image definitions- Returns:
- the resolved container image URL
-