|
@@ -22,7 +22,6 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.config;
|
24
|
24
|
|
25
|
|
-import com.dmdirc.DMDircMBassador;
|
26
|
25
|
import com.dmdirc.Precondition;
|
27
|
26
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
28
|
27
|
import com.dmdirc.interfaces.config.ConfigProvider;
|
|
@@ -79,18 +78,16 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
79
|
78
|
/**
|
80
|
79
|
* The identities that have been loaded into this manager.
|
81
|
80
|
*
|
82
|
|
- * Standard identities are inserted with a <code>null</code> key, custom identities use their
|
|
81
|
+ * Standard identities are inserted with a {@code null} key, custom identities use their
|
83
|
82
|
* custom type as the key.
|
84
|
83
|
*/
|
85
|
84
|
private final Multimap<String, ConfigProvider> identities = ArrayListMultimap.create();
|
86
|
85
|
/** Map of paths to corresponding config providers, to facilitate reloading. */
|
87
|
86
|
private final Map<Path, ConfigProvider> configProvidersByPath = new ConcurrentHashMap<>();
|
88
|
|
- /** The event bus to post events to. */
|
89
|
|
- private final DMDircMBassador eventBus;
|
90
|
87
|
/**
|
91
|
88
|
* The {@link ConfigProviderListener}s that have registered with this manager.
|
92
|
89
|
*
|
93
|
|
- * Listeners for standard identities are inserted with a <code>null</code> key, listeners for a
|
|
90
|
+ * Listeners for standard identities are inserted with a {@code null} key, listeners for a
|
94
|
91
|
* specific custom type use their type as the key.
|
95
|
92
|
*/
|
96
|
93
|
private final Multimap<String, WeakReference<ConfigProviderListener>> listeners =
|
|
@@ -111,13 +108,11 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
111
|
108
|
*
|
112
|
109
|
* @param baseDirectory The BASE config directory.
|
113
|
110
|
* @param identitiesDirectory The directory to store identities in.
|
114
|
|
- * @param eventBus The event bus to post events to
|
115
|
111
|
*/
|
116
|
112
|
public IdentityManager(final Path baseDirectory, final Path identitiesDirectory,
|
117
|
|
- final DMDircMBassador eventBus, final ClientInfo clientInfo) {
|
|
113
|
+ final ClientInfo clientInfo) {
|
118
|
114
|
this.configDirectory = baseDirectory;
|
119
|
115
|
this.identitiesDirectory = identitiesDirectory;
|
120
|
|
- this.eventBus = eventBus;
|
121
|
116
|
this.clientInfo = clientInfo;
|
122
|
117
|
}
|
123
|
118
|
|
|
@@ -661,9 +656,8 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
661
|
656
|
@Override
|
662
|
657
|
public ConfigProviderMigrator createMigratableConfig(final String protocol,
|
663
|
658
|
final String ircd, final String network, final String server) {
|
664
|
|
- final ConfigManager configManager = new ConfigManager(clientInfo, this, eventBus, protocol,
|
665
|
|
- ircd,
|
666
|
|
- network, server);
|
|
659
|
+ final ConfigManager configManager = new ConfigManager(clientInfo, this, protocol,
|
|
660
|
+ ircd, network, server);
|
667
|
661
|
setUpConfigManager(configManager);
|
668
|
662
|
return new ConfigManagerMigrator(configManager);
|
669
|
663
|
}
|
|
@@ -671,7 +665,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
671
|
665
|
@Override
|
672
|
666
|
public ConfigProviderMigrator createMigratableConfig(final String protocol,
|
673
|
667
|
final String ircd, final String network, final String server, final String channel) {
|
674
|
|
- final ConfigManager configManager = new ConfigManager(clientInfo, this, eventBus, protocol,
|
|
668
|
+ final ConfigManager configManager = new ConfigManager(clientInfo, this, protocol,
|
675
|
669
|
ircd, network, server, channel);
|
676
|
670
|
setUpConfigManager(configManager);
|
677
|
671
|
return new ConfigManagerMigrator(configManager);
|
|
@@ -680,7 +674,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
680
|
674
|
@Override
|
681
|
675
|
public AggregateConfigProvider createAggregateConfig(final String protocol, final String ircd,
|
682
|
676
|
final String network, final String server) {
|
683
|
|
- final ConfigManager configManager = new ConfigManager(clientInfo, this, eventBus, protocol,
|
|
677
|
+ final ConfigManager configManager = new ConfigManager(clientInfo, this, protocol,
|
684
|
678
|
ircd, network, server);
|
685
|
679
|
setUpConfigManager(configManager);
|
686
|
680
|
return configManager;
|
|
@@ -689,7 +683,7 @@ public class IdentityManager implements IdentityFactory, IdentityController {
|
689
|
683
|
@Override
|
690
|
684
|
public AggregateConfigProvider createAggregateConfig(final String protocol, final String ircd,
|
691
|
685
|
final String network, final String server, final String channel) {
|
692
|
|
- final ConfigManager configManager = new ConfigManager(clientInfo, this, eventBus, protocol,
|
|
686
|
+ final ConfigManager configManager = new ConfigManager(clientInfo, this, protocol,
|
693
|
687
|
ircd, network, server, channel);
|
694
|
688
|
setUpConfigManager(configManager);
|
695
|
689
|
return configManager;
|