Browse Source

Move Migrator and LifecycleController to bundles.

pull/767/head
Chris Smith 7 years ago
parent
commit
e2a7803809

+ 0
- 42
api/src/main/java/com/dmdirc/interfaces/Migrator.java View File

@@ -1,42 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2015 DMDirc Developers
3
- *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
21
- */
22
-
23
-package com.dmdirc.interfaces;
24
-
25
-/**
26
- * A class that can perform one-off migration after a client upgrade.
27
- */
28
-public interface Migrator {
29
-
30
-    /**
31
-     * Determines whether migration is needed or not.
32
-     *
33
-     * @return True if migration is required, false otherwise.
34
-     */
35
-    boolean needsMigration();
36
-
37
-    /**
38
-     * Performs the actual migration.
39
-     */
40
-    void migrate();
41
-
42
-}

api/src/main/java/com/dmdirc/interfaces/LifecycleController.java → bundles/com.dmdirc.util.system/src/main/java/com/dmdirc/util/system/LifecycleController.java View File

@@ -1,26 +1,21 @@
1 1
 /*
2
- * Copyright (c) 2006-2015 DMDirc Developers
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3 3
  *
4
- * Permission is hereby granted, free of charge, to any person obtaining a copy
5
- * of this software and associated documentation files (the "Software"), to deal
6
- * in the Software without restriction, including without limitation the rights
7
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- * copies of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 8
  *
11
- * The above copyright notice and this permission notice shall be included in
12
- * all copies or substantial portions of the Software.
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
13 11
  *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- * SOFTWARE.
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 16
  */
22 17
 
23
-package com.dmdirc.interfaces;
18
+package com.dmdirc.util.system;
24 19
 
25 20
 /**
26 21
  * Provides methods that control the lifecycle of the application.

+ 37
- 0
bundles/com.dmdirc.util.system/src/main/java/com/dmdirc/util/system/Migrator.java View File

@@ -0,0 +1,37 @@
1
+/*
2
+ * Copyright (c) 2006-2017 DMDirc Developers
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
7
+ * permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10
+ * Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
14
+ * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ */
17
+
18
+package com.dmdirc.util.system;
19
+
20
+/**
21
+ * A class that can perform one-off migration after a client upgrade.
22
+ */
23
+public interface Migrator {
24
+
25
+    /**
26
+     * Determines whether migration is needed or not.
27
+     *
28
+     * @return True if migration is required, false otherwise.
29
+     */
30
+    boolean needsMigration();
31
+
32
+    /**
33
+     * Performs the actual migration.
34
+     */
35
+    void migrate();
36
+
37
+}

+ 1
- 1
src/main/java/com/dmdirc/ClientModule.java View File

@@ -33,7 +33,7 @@ import com.dmdirc.interfaces.CommandController;
33 33
 import com.dmdirc.interfaces.ConnectionFactory;
34 34
 import com.dmdirc.interfaces.ConnectionManager;
35 35
 import com.dmdirc.events.eventbus.EventBus;
36
-import com.dmdirc.interfaces.LifecycleController;
36
+import com.dmdirc.util.system.LifecycleController;
37 37
 import com.dmdirc.config.provider.AggregateConfigProvider;
38 38
 import com.dmdirc.interfaces.config.IdentityController;
39 39
 import com.dmdirc.plugins.PluginModule;

+ 1
- 1
src/main/java/com/dmdirc/Main.java View File

@@ -26,7 +26,7 @@ import com.dmdirc.events.FirstRunEvent;
26 26
 import com.dmdirc.interfaces.CommandController.CommandDetails;
27 27
 import com.dmdirc.interfaces.ConnectionManager;
28 28
 import com.dmdirc.events.eventbus.EventBus;
29
-import com.dmdirc.interfaces.Migrator;
29
+import com.dmdirc.util.system.Migrator;
30 30
 import com.dmdirc.util.system.SystemLifecycleComponent;
31 31
 import com.dmdirc.interfaces.config.IdentityController;
32 32
 import com.dmdirc.interfaces.ui.UIController;

+ 1
- 1
src/main/java/com/dmdirc/SystemLifecycleController.java View File

@@ -21,7 +21,7 @@ import com.dmdirc.config.GlobalConfig;
21 21
 import com.dmdirc.events.ClientClosedEvent;
22 22
 import com.dmdirc.interfaces.ConnectionManager;
23 23
 import com.dmdirc.events.eventbus.EventBus;
24
-import com.dmdirc.interfaces.LifecycleController;
24
+import com.dmdirc.util.system.LifecycleController;
25 25
 import com.dmdirc.util.system.SystemLifecycleComponent;
26 26
 import com.dmdirc.config.provider.AggregateConfigProvider;
27 27
 import com.dmdirc.interfaces.config.IdentityController;

+ 1
- 1
src/main/java/com/dmdirc/commandparser/aliases/ActionAliasMigrator.java View File

@@ -19,7 +19,7 @@ package com.dmdirc.commandparser.aliases;
19 19
 
20 20
 import com.dmdirc.commandline.CommandLineOptionsModule.Directory;
21 21
 import com.dmdirc.commandline.CommandLineOptionsModule.DirectoryType;
22
-import com.dmdirc.interfaces.Migrator;
22
+import com.dmdirc.util.system.Migrator;
23 23
 import com.dmdirc.util.io.ConfigFile;
24 24
 import com.dmdirc.util.io.InvalidConfigFileException;
25 25
 

+ 1
- 1
src/main/java/com/dmdirc/commandparser/aliases/AliasesModule.java View File

@@ -19,7 +19,7 @@ package com.dmdirc.commandparser.aliases;
19 19
 
20 20
 import com.dmdirc.commandline.CommandLineOptionsModule.Directory;
21 21
 import com.dmdirc.commandline.CommandLineOptionsModule.DirectoryType;
22
-import com.dmdirc.interfaces.Migrator;
22
+import com.dmdirc.util.system.Migrator;
23 23
 import com.dmdirc.util.system.SystemLifecycleComponent;
24 24
 
25 25
 import java.nio.file.Path;

+ 1
- 1
src/main/java/com/dmdirc/commandparser/aliases/DefaultAliasInstaller.java View File

@@ -17,7 +17,7 @@
17 17
 
18 18
 package com.dmdirc.commandparser.aliases;
19 19
 
20
-import com.dmdirc.interfaces.Migrator;
20
+import com.dmdirc.util.system.Migrator;
21 21
 
22 22
 import java.io.IOException;
23 23
 import java.io.InputStream;

+ 1
- 1
src/main/java/com/dmdirc/commandparser/auto/ActionServerPerformMigrator.java View File

@@ -19,7 +19,7 @@ package com.dmdirc.commandparser.auto;
19 19
 
20 20
 import com.dmdirc.commandline.CommandLineOptionsModule.Directory;
21 21
 import com.dmdirc.commandline.CommandLineOptionsModule.DirectoryType;
22
-import com.dmdirc.interfaces.Migrator;
22
+import com.dmdirc.util.system.Migrator;
23 23
 import com.dmdirc.util.io.ConfigFile;
24 24
 import com.dmdirc.util.io.InvalidConfigFileException;
25 25
 

+ 1
- 1
src/main/java/com/dmdirc/commandparser/auto/AutoCommandModule.java View File

@@ -17,7 +17,7 @@
17 17
 
18 18
 package com.dmdirc.commandparser.auto;
19 19
 
20
-import com.dmdirc.interfaces.Migrator;
20
+import com.dmdirc.util.system.Migrator;
21 21
 import com.dmdirc.util.system.SystemLifecycleComponent;
22 22
 
23 23
 import java.nio.file.Path;

+ 1
- 1
src/main/java/com/dmdirc/commandparser/commands/global/Exit.java View File

@@ -24,7 +24,7 @@ import com.dmdirc.commandparser.CommandType;
24 24
 import com.dmdirc.commandparser.commands.BaseCommand;
25 25
 import com.dmdirc.commandparser.commands.context.CommandContext;
26 26
 import com.dmdirc.interfaces.CommandController;
27
-import com.dmdirc.interfaces.LifecycleController;
27
+import com.dmdirc.util.system.LifecycleController;
28 28
 import com.dmdirc.interfaces.WindowModel;
29 29
 
30 30
 import javax.annotation.Nonnull;

+ 1
- 1
src/main/java/com/dmdirc/config/profiles/IdentitiesProfileMigrator.java View File

@@ -17,7 +17,7 @@
17 17
 
18 18
 package com.dmdirc.config.profiles;
19 19
 
20
-import com.dmdirc.interfaces.Migrator;
20
+import com.dmdirc.util.system.Migrator;
21 21
 import com.dmdirc.config.provider.ConfigProvider;
22 22
 import com.dmdirc.interfaces.config.IdentityController;
23 23
 import com.google.common.collect.Lists;

+ 1
- 1
src/main/java/com/dmdirc/config/profiles/ProfilesModule.java View File

@@ -18,7 +18,7 @@
18 18
 package com.dmdirc.config.profiles;
19 19
 
20 20
 import com.dmdirc.commandline.CommandLineOptionsModule;
21
-import com.dmdirc.interfaces.Migrator;
21
+import com.dmdirc.util.system.Migrator;
22 22
 import com.dmdirc.util.system.SystemLifecycleComponent;
23 23
 
24 24
 import java.nio.file.Path;

Loading…
Cancel
Save