public class WalkModFacade extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
log |
| Constructor and Description |
|---|
WalkModFacade(File walkmodCfg,
OptionsBuilder optionsBuilder,
ConfigurationProvider configurationProvider)
Initalizes a Walkmod service
|
WalkModFacade(OptionsBuilder optionsBuilder)
Initalizes a Walkmod service
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChainConfig(ChainConfig chainCfg,
boolean recursive,
String before)
Adds a new chain configuration into the configuration file
|
void |
addConfigurationParameter(String param,
String value,
String type,
String category,
String name,
String chain,
boolean recursive)
Sets an specific parameter value into a bean.
|
void |
addExcludesToChain(String chain,
List<String> excludes,
boolean recursive,
boolean setToReader,
boolean setToWriter)
Adds a list of excludes rules into a chain
|
void |
addIncludesToChain(String chain,
List<String> includes,
boolean recursive,
boolean setToReader,
boolean setToWriter)
Adds a list of includes rules into a chain
|
void |
addModules(List<String> modules)
Adds a module into the configuration file
|
void |
addPluginConfig(PluginConfig pluginConfig,
boolean recursive)
Adds a new plugin into the configuration file
|
void |
addProviderConfig(ProviderConfig providerCfg,
boolean recursive)
Adds a new provider configuration into the configuration file
|
void |
addTransformationConfig(String chain,
String path,
boolean recursive,
TransformationConfig transformationCfg,
Integer order,
String before)
Adds a new transformation configuration into the configuration file
|
List<File> |
apply(String... chains)
Applies a list of transformation chains.
|
List<File> |
check(String... chains)
Applies a list of transformation chains without updating the source files.
|
Configuration |
getConfiguration()
Returns the equivalent configuration representation of the Walkmod config file.
|
void |
init()
Initializes an empty walkmod configuration file
|
List<BeanDefinition> |
inspectPlugin(PluginConfig plugin)
Retrieves the bean definitions that contains an specific plugin.
|
void |
install()
Downloads the list of declared plugins in the configuration file using Ivy.
|
List<File> |
patch(String... chains)
Generates a list of patches according the transformation chains
|
void |
removeChains(List<String> chains,
boolean recursive)
Removes the chains from the Walkmod config file.
|
void |
removeExcludesToChain(String chain,
List<String> excludes,
boolean recursive,
boolean setToReader,
boolean setToWriter)
Removes a list of excludes rules into a chain
|
void |
removeIncludesToChain(String chain,
List<String> includes,
boolean recursive,
boolean setToReader,
boolean setToWriter)
Removes a list of excludes rules into a chain
|
void |
removeModules(List<String> modules)
Removes the module list from the configuration file
|
void |
removePluginConfig(PluginConfig pluginConfig,
boolean recursive)
Removes a plugin from the configuration file.
|
void |
removeProviders(List<String> providers,
boolean recursive)
Removes the list of configuration providers from the config file.
|
void |
removeTransformations(String chain,
List<String> transformations,
boolean recursive)
Remove a list of transformations for an specific chain.
|
void |
setReader(String chain,
String type,
String path,
boolean recursive,
Map<String,String> params)
Sets an specific reader for an specific chain.
|
void |
setWriter(String chain,
String type,
String path,
boolean recursive,
Map<String,String> params)
Sets an specific writer for an specific chain.
|
public WalkModFacade(OptionsBuilder optionsBuilder)
optionsBuilder - Map of option. See Options and OptionsBuilder for available
options and default values.public WalkModFacade(File walkmodCfg, OptionsBuilder optionsBuilder, ConfigurationProvider configurationProvider)
walkmodCfg - Walkmod configuration file. If null, file named 'walkmod.xml' is searched at the
root.optionsBuilder - Map of option. See Options and OptionsBuilder for available
options and default values.configurationProvider - Configuration provider responsible for the resolution of plugins (used to use
custom classloading strategies). If null Ivy is used.public List<File> apply(String... chains) throws InvalidConfigurationException
chains - the list of applied transformation chains.InvalidConfigurationException - if the walkmod configuration is invalid and it is working in no verbose mode.public List<File> patch(String... chains) throws InvalidConfigurationException
chains - the list of applied transformation chains.InvalidConfigurationException - if the walkmod configuration is invalid and it is working in no verbose mode.public List<File> check(String... chains) throws InvalidConfigurationException
chains - the list of applied transformation chains.InvalidConfigurationException - if the walkmod configuration is invalid and it is working in no verbose mode.public void init()
throws Exception
Exception - in case that the walkmod configuration file can't be created.public void addChainConfig(ChainConfig chainCfg, boolean recursive, String before) throws Exception
chainCfg - chain configuration to addrecursive - Adds the new chain into all the submodulesbefore - Decides which is the next chain to execute.Exception - in case that the walkmod configuration file can't be read.public void addTransformationConfig(String chain, String path, boolean recursive, TransformationConfig transformationCfg, Integer order, String before) throws Exception
chain - chain identifier where the transformation will be appended. It can be null.path - the path where the transformation config will be applied if the chain does not
exists or is null.recursive - if the transformation config is added recursively to all the submodules.transformationCfg - transformation configuration to addorder - priority orderbefore - defines which is the next chain to executeException - in case that the walkmod configuration file can't be read.public void addProviderConfig(ProviderConfig providerCfg, boolean recursive) throws Exception
providerCfg - provider configuration to add.recursive - if the provider config is added recursively to all the submodules.Exception - in case that the walkmod configuration file can't be read.public void addPluginConfig(PluginConfig pluginConfig, boolean recursive) throws Exception
pluginConfig - the plugin to addrecursive - if the plugin config is added recursively to all the submodules.Exception - in case that the walkmod configuration file can't be read.public void install()
throws InvalidConfigurationException
InvalidConfigurationException - if the walkmod configuration is invalid and it is working in no verbose mode.public void addModules(List<String> modules) throws Exception
modules - Modules to addException - if the walkmod configuration file can't be read.public void removeTransformations(String chain, List<String> transformations, boolean recursive) throws Exception
chain - To remove the transformations. By default, it is the "default" chain.transformations - List of transformation names (type ids) to be removed.recursive - If the action is applied to all the submodules.Exception - if the walkmod configuration file can't be read.public void setWriter(String chain, String type, String path, boolean recursive, Map<String,String> params) throws Exception
chain - Chain to apply the writertype - Writer type to setpath - Writer path to setrecursive - If to set the writer to all the submodules.params - Writer parametersException - if the walkmod configuration file can't be read.public void setReader(String chain, String type, String path, boolean recursive, Map<String,String> params) throws Exception
chain - Chain to apply the writertype - Reader type to setpath - Reader path to setrecursive - If to set the reader to all the submodules.params - Reader parametersException - if the walkmod configuration file can't be read.public void removePluginConfig(PluginConfig pluginConfig, boolean recursive) throws Exception
pluginConfig - Plugin configuration to remove.recursive - If it necessary to remove the plugin from all the submodules.Exception - if the walkmod configuration file can't be read.public void removeModules(List<String> modules) throws Exception
modules - Module names to removeException - if the walkmod configuration file can't be read.public void removeProviders(List<String> providers, boolean recursive) throws Exception
providers - Name of the configuration providers to remove.recursive - If it necessary to remove the plugin from all the submodules.Exception - If the walkmod configuration file can't be read.public Configuration getConfiguration() throws Exception
Exception - If the walkmod configuration file can't be read.public void removeChains(List<String> chains, boolean recursive) throws Exception
chains - Chain names to removerecursive - If it necessary to remove the chains from all the submodules.Exception - If the walkmod configuration file can't be read.public List<BeanDefinition> inspectPlugin(PluginConfig plugin)
plugin - Plugin container of bean definitions.public void addConfigurationParameter(String param, String value, String type, String category, String name, String chain, boolean recursive) throws Exception
param - Parameter namevalue - Parameter valuetype - Bean type to set the parametercategory - Bean category to set the parameter (walker, reader, transformation, writer)name - Bean name/alias to set the parameterchain - Bean chain to filter the beans to take into accountrecursive - If it necessary to set the parameter to all the submodules.Exception - If the walkmod configuration file can't be read.public void addIncludesToChain(String chain, List<String> includes, boolean recursive, boolean setToReader, boolean setToWriter)
chain - Chain to apply the includes listincludes - List of includesrecursive - If it necessary to set the parameter to all the submodules.setToReader - If it is added into the reader includes listsetToWriter - If it is added into the writer includes listpublic void addExcludesToChain(String chain, List<String> excludes, boolean recursive, boolean setToReader, boolean setToWriter)
chain - Chain to apply the excludes listexcludes - List of excludesrecursive - If it necessary to set the parameter to all the submodules.setToReader - If it is added into the reader includes listsetToWriter - If it is added into the writer includes listpublic void removeExcludesToChain(String chain, List<String> excludes, boolean recursive, boolean setToReader, boolean setToWriter)
chain - Chain to apply the excludes listexcludes - List of excludesrecursive - If it necessary to set the parameter to all the submodules.setToReader - If it is added into the reader includes listsetToWriter - If it is added into the writer includes listpublic void removeIncludesToChain(String chain, List<String> includes, boolean recursive, boolean setToReader, boolean setToWriter)
chain - Chain to apply the excludes listincludes - List of includesrecursive - If it necessary to set the parameter to all the submodules.setToReader - If it is added into the reader includes listsetToWriter - If it is added into the writer includes listCopyright © 2017. All rights reserved.