1 package com.atlassian.activeobjects.internal;
2
3 import com.atlassian.activeobjects.external.ActiveObjects;
4 import com.atlassian.activeobjects.external.ActiveObjectsUpgradeTask;
5 import com.google.common.base.Supplier;
6
7 import java.util.List;
8
9 public interface ActiveObjectUpgradeManager {
10 /**
11 * <p>Manages the upgrades for a given plugin.</p>
12 * <p>Upgrade tasks are treated atomically. I.e the current version of the model is updated after each upgrade task
13 * is completed. If an upgrade task fails (throws an exception) then sub-sequent upgrade tasks won't be run, and
14 * when this method is called the next time it will resume from the 'same point' where it failed.</p>
15 *
16 * @param tableNamePrefix the prefix for table names
17 * @param upgradeTasks the list of upgrade tasks to apply
18 * @param ao an {@link ActiveObjects} supplier.
19 */
20 void upgrade(Prefix tableNamePrefix, List<ActiveObjectsUpgradeTask> upgradeTasks, Supplier<ActiveObjects> ao);
21 }