Class ContainerConfigReader
java.lang.Object
org.pipservices3.container.config.ContainerConfigReader
Helper class that reads container configuration from JSON or YAML file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerConfig
readFromFile
(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) Reads container configuration from JSON or YAML file.static ContainerConfig
readFromJsonFile
(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) Reads container configuration from JSON file.static ContainerConfig
readFromYamlFile
(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) Reads container configuration from YAML file.
-
Constructor Details
-
ContainerConfigReader
public ContainerConfigReader()
-
-
Method Details
-
readFromFile
public static ContainerConfig readFromFile(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) throws org.pipservices3.commons.errors.ApplicationException Reads container configuration from JSON or YAML file. The type of the file is determined by file extension.- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.path
- a path to component configuration file.parameters
- values to parameters the configuration or null to skip parameterization.- Returns:
- the read container configuration
- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-
readFromJsonFile
public static ContainerConfig readFromJsonFile(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) throws org.pipservices3.commons.errors.ApplicationException Reads container configuration from JSON file.- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.path
- a path to component configuration file.parameters
- values to parameters the configuration or null to skip parameterization.- Returns:
- the read container configuration.
- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-
readFromYamlFile
public static ContainerConfig readFromYamlFile(String correlationId, String path, org.pipservices3.commons.config.ConfigParams parameters) throws org.pipservices3.commons.errors.ApplicationException Reads container configuration from YAML file.- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.path
- a path to component configuration file.parameters
- values to parameters the configuration or null to skip parameterization.- Returns:
- the read container configuration.
- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-