Class BlockMetaDataConfigFactory
- java.lang.Object
-
- com.tibco.ep.tcs.runtime.config.BlockMetaDataConfigFactory
-
public class BlockMetaDataConfigFactory extends Object
Factory for producing block metadata configuration from different sources. Includes factory methods for producing different types of block metadata configuration given HOCON or interface configuration that specifies the block metadata type and associated configuration. One of the HOCON factory methods performs validation against the block metadata schema, and is intended for use when loading block metadata from classpath resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockMetaDataConfigFactory.BlockType
Full list of block types.
-
Field Summary
Fields Modifier and Type Field Description protected static String
META_DATA_TYPE_PROP
Metadata type config property.
-
Constructor Summary
Constructors Constructor Description BlockMetaDataConfigFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isPotentialBlockMetaDataConfigurationDocument(String candidate)
Return true if the specified string is a block metadata configuration document, false otherwise.static BlockMetaDataConfig
makeBlockMetaDataConfig(IBlockMetaData source)
Create the appropriate block metadata subclass from the specified interface source.static BlockMetaDataConfig
makeBlockMetaDataConfig(com.typesafe.config.Config config)
Create the appropriate block metadata configuration subclass from HOCON configuration.static IdentifiedBlockMetaDataConfig
makeIdentifiedBlockMetaDataConfig(BlockMetaDataConfigFactory.BlockType blockType)
Create a new identified block metadata configuration.static IdentifiedBlockMetaDataConfig
makeIdentifiedBlockMetaDataConfig(com.typesafe.config.Config config, String resourceName, FlowValidationProblemList problems, com.tibco.ep.dtm.configuration.hocon.schema.Validator validator)
Create an identified block metadata configuration object from HOCON configuration.
-
-
-
Field Detail
-
META_DATA_TYPE_PROP
protected static final String META_DATA_TYPE_PROP
Metadata type config property.- See Also:
- Constant Field Values
-
-
Method Detail
-
isPotentialBlockMetaDataConfigurationDocument
public static boolean isPotentialBlockMetaDataConfigurationDocument(String candidate)
Return true if the specified string is a block metadata configuration document, false otherwise. The test is primitive, and does not assume the document is well formed; that is, it might be in the process of editing. The document can be YAML, JSON, or HOCON.
- Parameters:
candidate
- the candidate to check- Returns:
- true if it looks like it is a block metadata configuration document as described above, false otherwise.
-
makeIdentifiedBlockMetaDataConfig
public static IdentifiedBlockMetaDataConfig makeIdentifiedBlockMetaDataConfig(BlockMetaDataConfigFactory.BlockType blockType)
Create a new identified block metadata configuration. The returned configuration contains an empty identification configuration and an empty block metadata configuration of the desired type.
- Parameters:
blockType
- desired type- Returns:
- empty identified block metadata config object
-
makeIdentifiedBlockMetaDataConfig
public static IdentifiedBlockMetaDataConfig makeIdentifiedBlockMetaDataConfig(com.typesafe.config.Config config, String resourceName, FlowValidationProblemList problems, com.tibco.ep.dtm.configuration.hocon.schema.Validator validator)
Create an identified block metadata configuration object from HOCON configuration. Validates against the block metadata schema, placing any problems in the problem list. If there are any problems, the method returns null.
- Parameters:
config
- source metadataresourceName
- the resource containing the source metadata, used in error reportingproblems
- validation problem list, added to with any validation errorsvalidator
- schema validator- Returns:
- metadata instance, null if any errors
-
makeBlockMetaDataConfig
public static BlockMetaDataConfig makeBlockMetaDataConfig(com.typesafe.config.Config config)
Create the appropriate block metadata configuration subclass from HOCON configuration. Assumes schema
validation
has already been performed on this configuration and that it is valid. Call this to create a configuration builder from inline HOCON inside a flow that's already had HOCON validation performed on it.- Parameters:
config
- source inline metadata- Returns:
- metadata instance
-
makeBlockMetaDataConfig
public static BlockMetaDataConfig makeBlockMetaDataConfig(IBlockMetaData source)
Create the appropriate block metadata subclass from the specified interface source.
- Parameters:
source
- source block metadata- Returns:
- metadata instance
-
-