@Service public class DefaultConfigFilesService extends Object implements ConfigFilesService
| Modifier and Type | Field and Description |
|---|---|
static String |
LIC_MULE_FILE |
static String |
ORIGINAL_FILES_NEW_DISTRO_FOLDER |
static String |
READY_FOLDER_NAME |
static String |
TO_REVIEW_FOLDER_NAME |
| Constructor and Description |
|---|
DefaultConfigFilesService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkConflicts(Path oldMule,
Path newMule,
boolean isDryRunMode)
This method runs as a precondition of the upgrade command.
|
void |
copyFinalConfigFiles(Path oldMule,
boolean isDryRunMode)
Copy the config files from the resolved config files folder "ready" to the ${MULE_HOME}/conf during the upgrade command after
no conflicts were found
|
Path |
getConfConfigFileDestination(Path muleHome,
String configFilePath) |
Path |
getConfFolderInDistro(Path muleHome) |
Path |
getReadyConfigFileDestination(Path muleHome,
String configFilePath)
Extracts the filename of the configFilePath passed as argument and resolves the destination path inside the "ready" folder.
|
Path |
getReadyFolderInDistro(Path muleHome)
Gets the corresponding path of the "ready" folder inside the distribution.
|
String |
getReadyFolderName() |
Path |
getResolvedConflictsFolder()
Gets the folder where the config files to be used after the upgrade.
|
Path |
getResolvedConflictsFolderInDistro(Path muleHome) |
String |
getSolveConflictsDocsPage()
Gets the documentation page section explaining in detail how to resolve the config files conflicts to be used in the ERROR
messages logs.
|
Path |
getToReviewConfigFileDestination(Path muleHome,
String configFilePath)
Extracts the filename of the configFilePath passed as argument and resolves the destination path inside the "to_review"
folder .
|
Path |
getToReviewFolderInDistro(Path muleHome)
Gets the corresponding path of the "to_review" folder inside the distribution.
|
String |
getToReviewFolderName() |
public static final String TO_REVIEW_FOLDER_NAME
public static final String READY_FOLDER_NAME
public static final String ORIGINAL_FILES_NEW_DISTRO_FOLDER
public static final String LIC_MULE_FILE
public Path getResolvedConflictsFolder()
ConfigFilesServicegetResolvedConflictsFolder in interface ConfigFilesServicepublic String getSolveConflictsDocsPage()
ConfigFilesServicegetSolveConflictsDocsPage in interface ConfigFilesServicepublic boolean checkConflicts(Path oldMule, Path newMule, boolean isDryRunMode) throws IOException
ConfigFilesServiceConfigFilesService.copyFinalConfigFiles(Path, boolean)
Finally, the new config files are copied too in the "new" aux folder so the user can detect the new changes in an easy way.checkConflicts in interface ConfigFilesServiceoldMule - The Mule Runtime Distribution path of the old distro.newMule - The Mule Runtime Distribution path of the new distro.isDryRunMode - Flag which in case is in true it avoids copying the config files and deleting the resolved conflicts
folderIOExceptionpublic String getToReviewFolderName()
public String getReadyFolderName()
public Path getToReviewFolderInDistro(Path muleHome)
ConfigFilesServicegetToReviewFolderInDistro in interface ConfigFilesServicemuleHome - Path of the mule distribution inside the 'to_review' path is going to be resolvedpublic Path getToReviewConfigFileDestination(Path muleHome, String configFilePath)
ConfigFilesServicegetToReviewConfigFileDestination in interface ConfigFilesServicemuleHome - Path of the mule distribution against the 'to_review' path is going to be resolvedconfigFilePath - Path of the config file to extract its filenamepublic Path getReadyFolderInDistro(Path muleHome)
ConfigFilesServicegetReadyFolderInDistro in interface ConfigFilesServicemuleHome - Path of the mule distribution inside the 'ready' path is going to be resolvedpublic Path getReadyConfigFileDestination(Path muleHome, String configFilePath)
ConfigFilesServicegetReadyConfigFileDestination in interface ConfigFilesServicemuleHome - Path of the mule distribution against the 'ready' path is going to be resolvedconfigFilePath - Path of the config file to extract its filenamepublic Path getConfConfigFileDestination(Path muleHome, String configFilePath)
public void copyFinalConfigFiles(Path oldMule, boolean isDryRunMode) throws IOException
ConfigFilesServicecopyFinalConfigFiles in interface ConfigFilesServiceoldMule - The Mule Runtime Distribution path where the resolved config files folder is present to copy the config files
from there during the upgrade.isDryRunMode - Flag which in case is in true it avoids copying the config files and deleting the resolved conflicts folderIOExceptionCopyright © 2022 MuleSoft, Inc.. All rights reserved.