Class 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.

    • Field Detail

      • META_DATA_TYPE_PROP

        protected static final String META_DATA_TYPE_PROP
        Metadata type config property.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BlockMetaDataConfigFactory

        public BlockMetaDataConfigFactory()
    • 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 metadata
        resourceName - the resource containing the source metadata, used in error reporting
        problems - validation problem list, added to with any validation errors
        validator - 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