Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
DataMigrationManager | 31 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package com.xpn.xwiki.store.migration; | |
21 | ||
22 | import org.xwiki.component.annotation.Role; | |
23 | ||
24 | /** | |
25 | * Interface for all migration managers. | |
26 | * | |
27 | * @version $Id: b631d077d8c9aebdd6474e9ada8d51aa59b76a56 $ | |
28 | * @since 3.4M1 | |
29 | */ | |
30 | @Role | |
31 | public interface DataMigrationManager | |
32 | { | |
33 | /** | |
34 | * @return current DB version or null for a new database | |
35 | * @xwiki.xwikicfg xwiki.store.migration.version - override data version | |
36 | * @throws DataMigrationException if any error | |
37 | */ | |
38 | XWikiDBVersion getDBVersion() throws DataMigrationException; | |
39 | ||
40 | /** | |
41 | * @return current DB migration status or null for a new database | |
42 | * @throws DataMigrationException if any error | |
43 | * @since 4.4.1 | |
44 | */ | |
45 | DataMigrationStatus getDataMigrationStatus() throws DataMigrationException; | |
46 | ||
47 | /** | |
48 | * Check current database version and proceed to migrations. Migration is processed only once, and depends on the | |
49 | * following configuration: | |
50 | * | |
51 | * @xwiki.xwikicfg xwiki.store.migration - 1 to enable migration, default to 0 | |
52 | * @xwiki.xwikicfg xwiki.store.migration.databases - list of database to migrate, default to all | |
53 | * @xwiki.xwikicfg xwiki.store.migration.forced - force run selected migrations | |
54 | * @xwiki.xwikicfg xwiki.store.migration.ignored - ignore selected migrations | |
55 | * @xwiki.xwikicfg xwiki.store.migration.exitAfterEnd - 1 to exit at the end of migrations, default to 0 | |
56 | * @throws MigrationRequiredException when version is incompatible with current version | |
57 | * @throws DataMigrationException when an error occurs during check. | |
58 | */ | |
59 | void checkDatabase() throws MigrationRequiredException, DataMigrationException; | |
60 | ||
61 | /** | |
62 | * @return latest DB version | |
63 | * @since 3.4M1 | |
64 | */ | |
65 | XWikiDBVersion getLatestVersion(); | |
66 | ||
67 | /** | |
68 | * Setup the schema of a new DB and set it to the latest version (not running migrations). | |
69 | * This should be used on a newly created DB only | |
70 | * | |
71 | * @throws DataMigrationException if any error | |
72 | * @since 3.4M1 | |
73 | */ | |
74 | void initNewDB() throws DataMigrationException; | |
75 | } |