Class ConfigurationFile
java.lang.Object
org.jboss.as.controller.persistence.ConfigurationFile
Encapsulates the configuration file and manages its history
- Author:
- Kabir Khan, Brian Stansberry
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPolicy controlling how to deal with the configuration file -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationFile(File configurationDir, String rawName, String name, boolean persistOriginal) Creates a new ConfigurationFile.ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit, File tmpDir, ConfigurationExtension configurationExtension) Creates a new ConfigurationFile.ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit, ConfigurationExtension configurationExtension) Creates a new ConfigurationFile. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCanFindNewBootFile(String bootFileName) Gets the file from which boot operations should be parsed.Gets the file to which modifications would be persisted, if this object is persisting changes outside the history directoryvoidresetBootFile(boolean reloadUsingLast, String newBootFileName) Reset so the next call togetBootFile()will re-determine the appropriate file to use for parsing boot operations.booleanuseGit()
-
Constructor Details
-
ConfigurationFile
public ConfigurationFile(File configurationDir, String rawName, String name, boolean persistOriginal) Creates a new ConfigurationFile.- Parameters:
configurationDir- directory in which configuration files are stored. Cannot benulland must exist and be a directoryrawName- default name for configuration files of the type handled by this object. Cannot benullor an empty stringname- user provided name of the configuration file to usepersistOriginal-trueif configuration modifications should be persisted back to the main configuration file;falseif they should only be persisted to the configuration history directory
-
ConfigurationFile
public ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit, ConfigurationExtension configurationExtension) Creates a new ConfigurationFile.- Parameters:
configurationDir- directory in which configuration files are stored. Cannot benulland must exist and be a directoryrawName- default name for configuration files of the type handled by this object. Cannot benullor an empty stringname- user provided name of the configuration file to useinteractionPolicy- policy governing interaction with the configuration file.useGit-trueif configuration is using Git to manage its history.configurationExtension- extra configuration.
-
ConfigurationFile
public ConfigurationFile(File configurationDir, String rawName, String name, ConfigurationFile.InteractionPolicy interactionPolicy, boolean useGit, File tmpDir, ConfigurationExtension configurationExtension) Creates a new ConfigurationFile.- Parameters:
configurationDir- directory in which configuration files are stored. Cannot benulland must exist and be a directory.rawName- default name for configuration files of the type handled by this object. Cannot benullor an empty string.name- user provided name of the configuration file to use.interactionPolicy- policy governing interaction with the configuration file.useGit-trueif configuration is using Git to manage its history.tmpDir- The server temporary directory to use as a fallback if the configuration directory cannot be written and we are running on read only mode.configurationExtension- extra configuration.
-
-
Method Details
-
useGit
public boolean useGit() -
checkCanFindNewBootFile
-
resetBootFile
Reset so the next call togetBootFile()will re-determine the appropriate file to use for parsing boot operations. IfreloadUsingLastistrue, whilenewBootFileNameis notnull,newBootFileNamewill take precedence. If anewBootFileNameis used, callers must callcheckCanFindNewBootFile(String)first.- Parameters:
reloadUsingLast-trueif the next call togetBootFile()should use the last file from the history. Only relevant if this object is not persisting changes back to the original source filenewBootFileName- the name of the new bootfile
-
getBootFile
Gets the file from which boot operations should be parsed.- Returns:
- the file. Will not be
null
-
getConfigurationExtension
-
getInteractionPolicy
-
getMainFile
Gets the file to which modifications would be persisted, if this object is persisting changes outside the history directory -
getConfigurationDir
-