com.day.cq.compat.codeupgrade.CodeUpgradeTask Maven / Gradle / Ivy
/**
* Copyright 1997-2004 Day Management AG
* Barfuesserplatz 6, 4001 Basel, Switzerland
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* Day Management AG, ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Day.
*/
package com.day.cq.compat.codeupgrade;
import org.osgi.annotation.versioning.ConsumerType;
/** A service that executes a code upgrade.
* From CQ5.6 on, such services are executed by the
* cq-upgrades-executor bundle Activator,
* synchronously when that bundle starts.
*/
@ConsumerType
public interface CodeUpgradeTask extends Runnable {
/**
* Declares if the {@code CodeUpgradeTask} needs to be executed immediately with upgrade startup or may be delayed
*/
enum MigrationType {
/**
* {@code CodeUpgradeTask}s marked IMMEDIATE will be executed with the upgrade startup.
* Legacy behavior no longer recommended as it forces consuming code to be upgraded along with the upgrade
*/
IMMEDIATE,
/**
* {@code CodeUpgradeTask}s marked DELAYED will not be executed unless explicitly triggered via system property {@link MigrationModeCheck#PROP_MIGRATION}
* Providing the option to decouple the adjustment of depending code from the upgrade.
*/
DELAYED
}
/**
* @return True if an upgrade is needed
*/
public boolean upgradeNeeded();
/** Called to cancel an upgrade that might be in progress */
public void cancelUpgrade();
/**
* @return upgrade progress info string currently set
*/
public String getProgressInfo();
}