Interface ModuleFactory
-
- All Superinterfaces:
Factory
,TableFactory
- All Known Implementing Classes:
CoreModuleFactory
@PublicEvolving public interface ModuleFactory extends TableFactory, Factory
A factory to create configured module instances based on string-based properties. See alsoFactory
for more information.Note that this interface supports the
TableFactory
stack for compatibility purposes. This is deprecated, however, and new implementations should implement theFactory
stack instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ModuleFactory.Context
Context provided when a module is created.
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default Module
createModule(Map<String,String> properties)
Deprecated.default Module
createModule(ModuleFactory.Context context)
Creates and configures aModule
.default String
factoryIdentifier()
Returns a unique identifier among same factory interfaces.default Set<ConfigOption<?>>
optionalOptions()
Returns a set ofConfigOption
that an implementation of this factory consumes in addition toFactory.requiredOptions()
.default Map<String,String>
requiredContext()
Deprecated.Implement theFactory
based stack instead.default Set<ConfigOption<?>>
requiredOptions()
Returns a set ofConfigOption
that an implementation of this factory requires in addition toFactory.optionalOptions()
.default List<String>
supportedProperties()
Deprecated.Implement theFactory
based stack instead.
-
-
-
Method Detail
-
createModule
@Deprecated default Module createModule(Map<String,String> properties)
Deprecated.Creates and configures aModule
using the given properties.- Parameters:
properties
- normalized properties describing a module.- Returns:
- the configured module.
-
createModule
default Module createModule(ModuleFactory.Context context)
Creates and configures aModule
.
-
factoryIdentifier
default String factoryIdentifier()
Description copied from interface:Factory
Returns a unique identifier among same factory interfaces.For consistency, an identifier should be declared as one lower case word (e.g.
kafka
). If multiple factories exist for different versions, a version should be appended using "-" (e.g.elasticsearch-7
).- Specified by:
factoryIdentifier
in interfaceFactory
-
requiredOptions
default Set<ConfigOption<?>> requiredOptions()
Description copied from interface:Factory
Returns a set ofConfigOption
that an implementation of this factory requires in addition toFactory.optionalOptions()
.See the documentation of
Factory
for more information.- Specified by:
requiredOptions
in interfaceFactory
-
optionalOptions
default Set<ConfigOption<?>> optionalOptions()
Description copied from interface:Factory
Returns a set ofConfigOption
that an implementation of this factory consumes in addition toFactory.requiredOptions()
.See the documentation of
Factory
for more information.- Specified by:
optionalOptions
in interfaceFactory
-
requiredContext
@Deprecated default Map<String,String> requiredContext()
Deprecated.Implement theFactory
based stack instead.Description copied from interface:TableFactory
Specifies the context that this factory has been implemented for. The framework guarantees to only match for this factory if the specified set of properties and values are met.Typical properties might be: - connector.type - format.type
Specified property versions allow the framework to provide backwards compatible properties in case of string format changes: - connector.property-version - format.property-version
An empty context means that the factory matches for all requests.
- Specified by:
requiredContext
in interfaceTableFactory
-
supportedProperties
@Deprecated default List<String> supportedProperties()
Deprecated.Implement theFactory
based stack instead.Description copied from interface:TableFactory
List of property keys that this factory can handle. This method will be used for validation. If a property is passed that this factory cannot handle, an exception will be thrown. The list must not contain the keys that are specified by the context.Example properties might be: - schema.#.type - schema.#.name - connector.topic - format.line-delimiter - format.ignore-parse-errors - format.fields.#.type - format.fields.#.name
Note: Use "#" to denote an array of values where "#" represents one or more digits. Property versions like "format.property-version" must not be part of the supported properties.
In some cases it might be useful to declare wildcards "*". Wildcards can only be declared at the end of a property key.
For example, if an arbitrary format should be supported: - format.*
Note: Wildcards should be used with caution as they might swallow unsupported properties and thus might lead to undesired behavior.
- Specified by:
supportedProperties
in interfaceTableFactory
-
-