Class RoleFile

    • Constructor Detail

      • RoleFile

        public RoleFile()
    • Method Detail

      • getFile

        public String getFile()
        Defines the file name of the generated or downloaded file. Variable placeholders can be used to reference variables or context properties, e.g. ${tenant} for the current tenant name if a tenant multiply plugin is used.
        Returns:
        File name
      • setFile

        public void setFile​(String name)
      • getDir

        public String getDir()
        Sets the directory to generate or download the file in. The directory name is relative to the configuration target directory of the node. Variable placeholders can be used to reference variables or context properties, e.g. ${tenant} for the current tenant name if a tenant multiply plugin is used.
        Returns:
        Directory name
      • setDir

        public void setDir​(String dir)
      • getTemplate

        public String getTemplate()
        Defines the template name to be used to generate the file. The template file should have an ".hbs" extension. The file name is resolved relative to the template directory of the role.
        Returns:
        Template file name
      • setTemplate

        public void setTemplate​(String template)
      • getUrl

        public String getUrl()
        URL to download file from. If a URL is defined the template is ignored, and the target file property optional. If no file property is defined, the file name of the downloaded file is used. For URL protocols you can use http://, https://, classpath:// file:// or mvn://.
        Returns:
        Download URL
      • setUrl

        public void setUrl​(String url)
      • getSymlinkTarget

        public String getSymlinkTarget()
        Target path for symlink. If a symlink target is defined, no file is generated or downloaded, but a symlink is created in the file system pointing to the given target. The target has to point to another file generated or downloaded by CONGA.
        Returns:
        Symlink target
      • setSymlinkTarget

        public void setSymlinkTarget​(String symlinkTarget)
      • getVariants

        public List<String> getVariants()
        Defines the role variant names for which this file should be generated. If no names are defined the file is generated for all role variants. If the node/role has multiple variants, the file is generated if at least one variant from the file definition matches with at least one variant from the role/file ("or"). If the variant name is suffixed with a "*" this variant has to be matched ("and"). The "*" is not part of the variant name.
        Returns:
        List of role variant names
      • setVariants

        public void setVariants​(List<String> variants)
      • getCondition

        public String getCondition()
        Defines a condition whether the file should be generated or not. The condition contains one single variable placeholder reference, e.g. ${myvar}. The condition is true if the resulting string of the variable is not empty and does not match "false".
        Returns:
        Condition expression
      • setCondition

        public void setCondition​(String condition)
      • getFileHeader

        public String getFileHeader()
        Defines the name of a file header plugin that should be applied to the generated file. If no name is given the best-matching plugin is detected automatically by the file extension. If this is not wished, explicitly setting the property to "none" ensures that no plugin is applied.
        Returns:
        File header plugin name
      • setFileHeader

        public void setFileHeader​(String fileHeader)
      • getValidators

        public List<String> getValidators()
        Defines a list of validator plugin names that should be applied to the generated file. If none is given the best-matching plugins are detected automatically by the file extension. If this is not wished, explicitly setting a list entry with "none" ensures that no plugin is applied.
        Returns:
        List of validator plugin names
      • setValidators

        public void setValidators​(List<String> validators)
      • getValidatorOptions

        public Map<String,​Object> getValidatorOptions()
        Defines configuration parameters that are passed as options to the validator plugins. They are merged with the configuration parameters from the configuration inheritance tree.
        Returns:
        Configuration parameters
      • setValidatorOptions

        public void setValidatorOptions​(Map<String,​Object> validatorOptions)
      • getPostProcessors

        public List<String> getPostProcessors()
        Defines a list of post processor plugin names that should be applied to the generated file.
        Returns:
        List of post processor plugin names
      • setPostProcessors

        public void setPostProcessors​(List<String> postProcessors)
      • getPostProcessorOptions

        public Map<String,​Object> getPostProcessorOptions()
        Defines configuration parameters that are passed as options to the post processor plugins. They are merged with the configuration parameters from the configuration inheritance tree.

        Two generic parameters are supported for all post processor:

        • postProcessor.fileHeader: Allows to set a file header for the post-processed files (or "none" for no header).
        • postProcessor.validators: Allows to set a list of validators for the post-processed files (or "none" for no validation)
        Returns:
        Configuration parameters
      • setPostProcessorOptions

        public void setPostProcessorOptions​(Map<String,​Object> postProcessorOptions)
      • getMultiply

        public String getMultiply()
        Defines a multiply plugin name to be used. Using a mulitply plugin multiple files are generated instead of a single file, e.g. one per tenant. To ensure each file has a unique file name variables have to be used in the "file" property.
        Returns:
        Multiply plugin name
      • setMultiply

        public void setMultiply​(String multiply)
      • getMultiplyOptions

        public Map<String,​Object> getMultiplyOptions()
        Defines configuration parameters that are passed as options to the multiply plugin. They are merged with the configuration parameters from the configuration inheritance tree.
        Returns:
        Configuration parameters
      • setMultiplyOptions

        public void setMultiplyOptions​(Map<String,​Object> multiplyOptions)
      • getCharset

        public String getCharset()
        Defines a charset to be used for the generated file. It is expected that the templates is encoded in the same charset. If not set UTF-8 is the default charset.
        Returns:
        Charset name
      • setCharset

        public void setCharset​(String charset)
      • getLineEndings

        public LineEndings getLineEndings()
        Defines the line endings style for the generated files. Possible values are 'unix', 'windows' and 'macos'. If not set 'unix' line endings are the default.
        Returns:
        Line endings style
      • setLineEndings

        public void setLineEndings​(LineEndings lineEndings)
      • getEscapingStrategy

        public String getEscapingStrategy()
        Defines an handlebars escaping strategy plugin to be used. If no name is given the best-matching plugin is detected automatically by the file extension. If this is not wished, explicitly setting the property to "none" ensures that no plugin is applied.
        Returns:
        Handlebars escaping strategy plugin name.
      • setEscapingStrategy

        public void setEscapingStrategy​(String escapingStrategy)
      • getModelOptions

        public Map<String,​Object> getModelOptions()
        Defines additional options that are written to the exported model metadata for this file.
        Returns:
        Model options
      • setModelOptions

        public void setModelOptions​(Map<String,​Object> modelOptions)
      • isDeleteSource

        public boolean isDeleteSource()
        Whether to delete the the source file that was copied with this file definition. This can only be applied when a) the file defined was not generated but copied from an url and b) the url file provider supports deleting the source file (e.g. in local file system and not a remote URL).
        Returns:
        true if the source file references by the url should be deleted
      • setDeleteSource

        public void setDeleteSource​(boolean deleteSource)