@Service public class DefaultPreconditionsValidatorService extends Object implements PreconditionsValidatorService
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_FILES_CONFLICTS_WERE_FOUND_PREFIX |
static String |
NOT_ALL_PRECONDITIONS_WERE_MET_PREFIX |
static String |
ROLLBACK_EXCEPTION_MESSAGE_NOT_ALL_PRECONDITIONS_WERE_MET |
static String |
UNSUPPORTED_MULE_VERSION_FOR_UPGRADE_MESSAGE |
static String |
UPGRADE_EXCEPTION_MESSAGE_NOT_ALL_PRECONDITIONS_WERE_MET |
static String |
UPGRADE_EXCEPTION_MESSAGE_USER_DISAGREE |
| Constructor and Description |
|---|
DefaultPreconditionsValidatorService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkBackupExistence(Path muleDistroLocation)
Checks existence of any BackUp.
|
boolean |
checkBackupIntegrity(Path muleDistroLocation) |
List<String> |
checkBackupIntegrityAndGetErrorMessage(Path muleDistroLocation) |
boolean |
checkMuleUpgradeIsSupported(SemVer currentMule,
SemVer newMule)
Verify if the version of the current mule is supported for an upgrade.
|
void |
checkRollbackReadiness(Path muleDistroLocation)
Checks that all preconditions for performing the rollback are met.
|
void |
checkUpgradeReadiness(MuleDistribution oldMule,
MuleDistribution newMule,
boolean force,
boolean isDryRun)
Checks that all preconditions for performing the upgrade are met.
|
List<String> |
getBackupIntegrityErrorMessages(Path muleDistroLocation) |
boolean |
getConsentForOverwritingBackup(Path distroLocation,
boolean force)
Asks consent for overwriting the current BackUp.
|
public static final String NOT_ALL_PRECONDITIONS_WERE_MET_PREFIX
public static final String UPGRADE_EXCEPTION_MESSAGE_NOT_ALL_PRECONDITIONS_WERE_MET
public static final String ROLLBACK_EXCEPTION_MESSAGE_NOT_ALL_PRECONDITIONS_WERE_MET
public static final String CONFIG_FILES_CONFLICTS_WERE_FOUND_PREFIX
public static final String UPGRADE_EXCEPTION_MESSAGE_USER_DISAGREE
public static final String UNSUPPORTED_MULE_VERSION_FOR_UPGRADE_MESSAGE
public DefaultPreconditionsValidatorService()
public void checkUpgradeReadiness(MuleDistribution oldMule, MuleDistribution newMule, boolean force, boolean isDryRun) throws IOException
Preconditions are:
checkUpgradeReadiness in interface PreconditionsValidatorServiceoldMule - MuleDistribution representing the old Mule Runtime distribution being upgradednewMule - MuleDistribution representing the new Mule Runtime distribution used for the upgradeforce - whether explicit consent has been provided for the override related preconditions like the ones for the backup
and applied patchesIllegalStateException - if validations are not metIOException - if an I/O error occurspublic void checkRollbackReadiness(Path muleDistroLocation) throws IOException
Preconditions are:
checkRollbackReadiness in interface PreconditionsValidatorServicemuleDistroLocation - location of the Mule Runtime distribution being validated for rollback process.IllegalStateException - if validations are not met.IOException - if an I/O error occurs.public boolean getConsentForOverwritingBackup(Path distroLocation, boolean force) throws IOException
getConsentForOverwritingBackup in interface PreconditionsValidatorServicedistroLocation - Mule Runtime Distribution Path.force - If force is true, will not ask to the user.IOExceptionpublic boolean checkBackupExistence(Path muleDistroLocation) throws IOException
muleDistroLocation - Mule path to looking for the BackUp.IOException - I/O Exception.public List<String> checkBackupIntegrityAndGetErrorMessage(Path muleDistroLocation) throws IOException
IOExceptionpublic List<String> getBackupIntegrityErrorMessages(Path muleDistroLocation)
public boolean checkBackupIntegrity(Path muleDistroLocation) throws IOException
IOExceptionpublic boolean checkMuleUpgradeIsSupported(SemVer currentMule, SemVer newMule)
currentMule - MuleDistribution representing the old Mule Runtime distribution being upgradedCopyright © 2022 MuleSoft, Inc.. All rights reserved.