Explorar el Código

Use ConnectionManager.

Change-Id: Ic0e6e5f95adc30e773945c95e73d321d589503d2
Depends-On: I8888522d58ff4d332c4a477702442c29a82d12ff
Reviewed-on: http://gerrit.dmdirc.com/3871
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
changes/71/3871/3
Chris Smith hace 9 años
padre
commit
8cc02bbfff

+ 6
- 6
identd/src/com/dmdirc/addons/identd/IdentClient.java Ver fichero

@@ -23,9 +23,9 @@
23 23
 package com.dmdirc.addons.identd;
24 24
 
25 25
 import com.dmdirc.DMDircMBassador;
26
-import com.dmdirc.ServerManager;
27 26
 import com.dmdirc.events.UserErrorEvent;
28 27
 import com.dmdirc.interfaces.Connection;
28
+import com.dmdirc.interfaces.ConnectionManager;
29 29
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
30 30
 import com.dmdirc.interfaces.config.ReadOnlyConfigProvider;
31 31
 import com.dmdirc.logger.ErrorLevel;
@@ -51,7 +51,7 @@ public class IdentClient implements Runnable {
51 51
     /** The Thread in use for this client. */
52 52
     private volatile Thread thread;
53 53
     /** Server manager. */
54
-    private final ServerManager serverManager;
54
+    private final ConnectionManager connectionManager;
55 55
     /** Global configuration to read settings from. */
56 56
     private final AggregateConfigProvider config;
57 57
     /** This plugin's settings domain. */
@@ -63,17 +63,17 @@ public class IdentClient implements Runnable {
63 63
      * @param eventBus      The event bus to post errors on
64 64
      * @param server        The server that owns this
65 65
      * @param socket        The socket we are handing
66
-     * @param serverManager Server manager to retrieve servers from
66
+     * @param connectionManager Server manager to retrieve servers from
67 67
      * @param config        Global config to read settings from
68 68
      * @param domain        This plugin's settings domain
69 69
      */
70 70
     public IdentClient(final DMDircMBassador eventBus, final IdentdServer server, final Socket socket,
71
-            final ServerManager serverManager, final AggregateConfigProvider config,
71
+            final ConnectionManager connectionManager, final AggregateConfigProvider config,
72 72
             final String domain) {
73 73
         this.eventBus = eventBus;
74 74
         this.server = server;
75 75
         this.socket = socket;
76
-        this.serverManager = serverManager;
76
+        this.connectionManager = connectionManager;
77 77
         this.config = config;
78 78
         this.domain = domain;
79 79
     }
@@ -239,7 +239,7 @@ public class IdentClient implements Runnable {
239 239
      * @return The server instance listening on the given port
240 240
      */
241 241
     protected Connection getConnectionByPort(final int port) {
242
-        for (Connection connection : serverManager.getServers()) {
242
+        for (Connection connection : connectionManager.getConnections()) {
243 243
             if (connection.getParser().getLocalPort() == port) {
244 244
                 return connection;
245 245
             }

+ 6
- 6
identd/src/com/dmdirc/addons/identd/IdentdServer.java Ver fichero

@@ -24,8 +24,8 @@ package com.dmdirc.addons.identd;
24 24
 
25 25
 import com.dmdirc.ClientModule.GlobalConfig;
26 26
 import com.dmdirc.DMDircMBassador;
27
-import com.dmdirc.ServerManager;
28 27
 import com.dmdirc.events.UserErrorEvent;
28
+import com.dmdirc.interfaces.ConnectionManager;
29 29
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
30 30
 import com.dmdirc.logger.ErrorLevel;
31 31
 import com.dmdirc.plugins.PluginDomain;
@@ -52,7 +52,7 @@ public final class IdentdServer implements Runnable {
52 52
     /** Arraylist of all the clients we have */
53 53
     private final List<IdentClient> clientList = new ArrayList<>();
54 54
     /** Server manager. */
55
-    private final ServerManager serverManager;
55
+    private final ConnectionManager connectionManager;
56 56
     /** Have we failed to start this server previously? */
57 57
     private boolean failed;
58 58
     /** Global configuration to read plugin's from. */
@@ -64,17 +64,17 @@ public final class IdentdServer implements Runnable {
64 64
      * Create the IdentdServer.
65 65
      *
66 66
      * @param eventBus      The event bus to post errors on
67
-     * @param serverManager Server manager to iterate over servers
67
+     * @param connectionManager Server manager to iterate over servers
68 68
      * @param config        Global config
69 69
      * @param domain        This plugin's setting domain
70 70
      */
71 71
     @Inject
72 72
     public IdentdServer(final DMDircMBassador eventBus,
73
-            final ServerManager serverManager,
73
+            final ConnectionManager connectionManager,
74 74
             @GlobalConfig final AggregateConfigProvider config,
75 75
             @PluginDomain(IdentdPlugin.class) final String domain) {
76 76
         this.eventBus = eventBus;
77
-        this.serverManager = serverManager;
77
+        this.connectionManager = connectionManager;
78 78
         this.config = config;
79 79
         this.domain = domain;
80 80
     }
@@ -89,7 +89,7 @@ public final class IdentdServer implements Runnable {
89 89
             try {
90 90
                 final Socket clientSocket = serverSocket.accept();
91 91
                 final IdentClient client = new IdentClient(eventBus, this, clientSocket,
92
-                        serverManager, config, domain);
92
+                        connectionManager, config, domain);
93 93
                 client.start();
94 94
                 addClient(client);
95 95
             } catch (IOException e) {

+ 3
- 3
identd/test/com/dmdirc/addons/identd/IdentClientTest.java Ver fichero

@@ -24,8 +24,8 @@ package com.dmdirc.addons.identd;
24 24
 
25 25
 import com.dmdirc.DMDircMBassador;
26 26
 import com.dmdirc.Server;
27
-import com.dmdirc.ServerManager;
28 27
 import com.dmdirc.interfaces.Connection;
28
+import com.dmdirc.interfaces.ConnectionManager;
29 29
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
30 30
 import com.dmdirc.parser.irc.IRCClientInfo;
31 31
 import com.dmdirc.parser.irc.IRCParser;
@@ -46,7 +46,7 @@ import static org.mockito.Mockito.when;
46 46
 public class IdentClientTest {
47 47
 
48 48
     @Mock private AggregateConfigProvider acp;
49
-    @Mock private ServerManager sm;
49
+    @Mock private ConnectionManager sm;
50 50
     @Mock private Server server;
51 51
     @Mock private IRCParser parser;
52 52
     @Mock private IRCClientInfo client;
@@ -57,7 +57,7 @@ public class IdentClientTest {
57 57
         final List<Connection> servers = new ArrayList<>();
58 58
         servers.add(server);
59 59
 
60
-        when(sm.getServers()).thenReturn(servers);
60
+        when(sm.getConnections()).thenReturn(servers);
61 61
         when(server.getParser()).thenReturn(parser);
62 62
         when(parser.getLocalPort()).thenReturn(60);
63 63
         when(parser.getLocalClient()).thenReturn(client);

+ 6
- 6
lagdisplay/src/com/dmdirc/addons/lagdisplay/ServerInfoDialog.java Ver fichero

@@ -22,12 +22,12 @@
22 22
 
23 23
 package com.dmdirc.addons.lagdisplay;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.ServerState;
27 26
 import com.dmdirc.addons.ui_swing.MainFrame;
28 27
 import com.dmdirc.addons.ui_swing.components.statusbar.StatusbarPanel;
29 28
 import com.dmdirc.addons.ui_swing.components.statusbar.StatusbarPopupWindow;
30 29
 import com.dmdirc.interfaces.Connection;
30
+import com.dmdirc.interfaces.ConnectionManager;
31 31
 
32 32
 import java.util.List;
33 33
 
@@ -48,7 +48,7 @@ public class ServerInfoDialog extends StatusbarPopupWindow {
48 48
     /** Swing main frame. */
49 49
     private final MainFrame mainFrame;
50 50
     /** Server manager to retrieve servers from. */
51
-    private final ServerManager serverManager;
51
+    private final ConnectionManager connectionManager;
52 52
 
53 53
     /**
54 54
      * Creates a new ServerInfoDialog.
@@ -56,23 +56,23 @@ public class ServerInfoDialog extends StatusbarPopupWindow {
56 56
      * @param manager       The {@link LagDisplayManager} we're using for info
57 57
      * @param parent        The {@link JPanel} to use for positioning
58 58
      * @param mainFrame     The frame that will own this dialog.
59
-     * @param serverManager The manager to use to iterate servers.
59
+     * @param connectionManager The manager to use to iterate servers.
60 60
      */
61 61
     public ServerInfoDialog(
62 62
             final LagDisplayManager manager,
63 63
             final StatusbarPanel<JLabel> parent,
64 64
             final MainFrame mainFrame,
65
-            final ServerManager serverManager) {
65
+            final ConnectionManager connectionManager) {
66 66
         super(parent, mainFrame);
67 67
 
68 68
         this.manager = manager;
69 69
         this.mainFrame = mainFrame;
70
-        this.serverManager = serverManager;
70
+        this.connectionManager = connectionManager;
71 71
     }
72 72
 
73 73
     @Override
74 74
     protected void initContent(final JPanel panel) {
75
-        final List<Connection> connections = serverManager.getServers();
75
+        final List<Connection> connections = connectionManager.getConnections();
76 76
 
77 77
         if (connections.isEmpty()) {
78 78
             panel.add(new JLabel("No open servers."));

+ 5
- 5
lagdisplay/src/com/dmdirc/addons/lagdisplay/ServerInfoDialogFactory.java Ver fichero

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.lagdisplay;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.addons.ui_swing.MainFrame;
27 26
 import com.dmdirc.addons.ui_swing.components.statusbar.StatusbarPanel;
27
+import com.dmdirc.interfaces.ConnectionManager;
28 28
 
29 29
 import javax.inject.Inject;
30 30
 import javax.inject.Singleton;
@@ -38,19 +38,19 @@ public class ServerInfoDialogFactory {
38 38
 
39 39
     private final LagDisplayManager manager;
40 40
     private final MainFrame mainFrame;
41
-    private final ServerManager serverManager;
41
+    private final ConnectionManager connectionManager;
42 42
 
43 43
     @Inject
44 44
     public ServerInfoDialogFactory(final LagDisplayManager manager, final MainFrame mainFrame,
45
-            final ServerManager serverManager) {
45
+            final ConnectionManager connectionManager) {
46 46
         this.manager = manager;
47 47
         this.mainFrame = mainFrame;
48
-        this.serverManager = serverManager;
48
+        this.connectionManager = connectionManager;
49 49
     }
50 50
 
51 51
     public ServerInfoDialog getServerInfoDialog(
52 52
             final StatusbarPanel<JLabel> parent) {
53
-        return new ServerInfoDialog(manager, parent, mainFrame, serverManager);
53
+        return new ServerInfoDialog(manager, parent, mainFrame, connectionManager);
54 54
     }
55 55
 
56 56
 }

+ 7
- 7
serverlistdialog/src/com/dmdirc/addons/serverlistdialog/ServerListModel.java Ver fichero

@@ -22,13 +22,13 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlistdialog;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.actions.wrappers.PerformType;
27 26
 import com.dmdirc.actions.wrappers.PerformWrapper.PerformDescription;
28 27
 import com.dmdirc.addons.serverlists.ServerEntry;
29 28
 import com.dmdirc.addons.serverlists.ServerGroup;
30 29
 import com.dmdirc.addons.serverlists.ServerGroupItem;
31 30
 import com.dmdirc.addons.serverlists.ServerList;
31
+import com.dmdirc.interfaces.ConnectionManager;
32 32
 import com.dmdirc.interfaces.config.IdentityController;
33 33
 import com.dmdirc.util.collections.ListenerList;
34 34
 
@@ -51,23 +51,23 @@ public class ServerListModel {
51 51
     /** Active server item. */
52 52
     private ServerGroupItem activeItem;
53 53
     /** ServerManager that ServerEntrys use to create servers */
54
-    private final ServerManager serverManager;
54
+    private final ConnectionManager connectionManager;
55 55
     /** The controller to read/write settings with. */
56 56
     private final IdentityController identityController;
57 57
 
58 58
     /**
59 59
      * Creates a new server list model.
60 60
      *
61
-     * @param serverManager      ServerManager currently in use.
61
+     * @param connectionManager      ServerManager currently in use.
62 62
      * @param identityController The controller to read/write settings with.
63 63
      * @param serverList         The server list to use for the top-level entries.
64 64
      */
65 65
     @Inject
66 66
     public ServerListModel(
67
-            final ServerManager serverManager,
67
+            final ConnectionManager connectionManager,
68 68
             final IdentityController identityController,
69 69
             final ServerList serverList) {
70
-        this.serverManager = serverManager;
70
+        this.connectionManager = connectionManager;
71 71
         this.identityController = identityController;
72 72
         list = serverList;
73 73
         listeners = new ListenerList();
@@ -227,8 +227,8 @@ public class ServerListModel {
227 227
      */
228 228
     public void addEntry(final ServerGroup parentGroup, final String entryName,
229 229
             final URI url) {
230
-        final ServerGroupItem sg = new ServerEntry(identityController,
231
-                serverManager, parentGroup, entryName, url, null);
230
+        final ServerGroupItem sg = new ServerEntry(identityController, connectionManager,
231
+                parentGroup, entryName, url, null);
232 232
         parentGroup.addItem(sg);
233 233
         for (ServerListListener listener : listeners.get(
234 234
                 ServerListListener.class)) {

+ 6
- 6
serverlists/src/com/dmdirc/addons/serverlists/ServerEntry.java Ver fichero

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlists;
24 24
 
25
-import com.dmdirc.ServerManager;
25
+import com.dmdirc.interfaces.ConnectionManager;
26 26
 import com.dmdirc.interfaces.config.IdentityController;
27 27
 
28 28
 import java.net.URI;
@@ -39,13 +39,13 @@ public class ServerEntry extends ServerGroupItemBase {
39 39
     /** The group that owns this entry. */
40 40
     private final ServerGroup group;
41 41
     /** The manager to use to create new servers. */
42
-    private final ServerManager serverManager;
42
+    private final ConnectionManager connectionManager;
43 43
 
44 44
     /**
45 45
      * Creates a new server entry.
46 46
      *
47 47
      * @param identityController The controller to read/write settings with.
48
-     * @param serverManager      The server manager to connect to servers with.
48
+     * @param connectionManager      The server manager to connect to servers with.
49 49
      * @param group              The group that owns this entry
50 50
      * @param name               The name of this server
51 51
      * @param address            The address of this server
@@ -53,12 +53,12 @@ public class ServerEntry extends ServerGroupItemBase {
53 53
      */
54 54
     public ServerEntry(
55 55
             final IdentityController identityController,
56
-            final ServerManager serverManager,
56
+            final ConnectionManager connectionManager,
57 57
             final ServerGroup group, final String name,
58 58
             final URI address, final String profile) {
59 59
         super(identityController);
60 60
 
61
-        this.serverManager = serverManager;
61
+        this.connectionManager = connectionManager;
62 62
         setName(name);
63 63
         setProfile(profile);
64 64
         this.address = address;
@@ -97,7 +97,7 @@ public class ServerEntry extends ServerGroupItemBase {
97 97
 
98 98
     @Override
99 99
     public void connect() {
100
-        serverManager.connectToAddress(address, getProfileIdentity());
100
+        connectionManager.connectToAddress(address, getProfileIdentity());
101 101
     }
102 102
 
103 103
     @Override

+ 6
- 6
serverlists/src/com/dmdirc/addons/serverlists/ServerList.java Ver fichero

@@ -24,10 +24,10 @@ package com.dmdirc.addons.serverlists;
24 24
 
25 25
 import com.dmdirc.DMDircMBassador;
26 26
 import com.dmdirc.Precondition;
27
-import com.dmdirc.ServerManager;
28 27
 import com.dmdirc.addons.serverlists.io.ServerGroupReader;
29 28
 import com.dmdirc.addons.serverlists.io.ServerGroupWriter;
30 29
 import com.dmdirc.addons.serverlists.service.ServerListServiceProvider;
30
+import com.dmdirc.interfaces.ConnectionManager;
31 31
 import com.dmdirc.interfaces.config.ConfigProvider;
32 32
 import com.dmdirc.interfaces.config.ConfigProviderListener;
33 33
 import com.dmdirc.interfaces.config.IdentityController;
@@ -52,7 +52,7 @@ public class ServerList implements ConfigProviderListener {
52 52
     /** A list of all known groups. */
53 53
     private final Map<ServerGroup, ServerGroupWriter> groups = new HashMap<>();
54 54
     /** ServerManager that ServerEntrys use to create servers */
55
-    private final ServerManager serverManager;
55
+    private final ConnectionManager connectionManager;
56 56
     /** The controller to read/write settings with. */
57 57
     private final IdentityController identityController;
58 58
     /** The factory to create new identities with. */
@@ -62,7 +62,7 @@ public class ServerList implements ConfigProviderListener {
62 62
      * Creates a new ServerList and loads groups and servers.
63 63
      *
64 64
      * @param pluginManager      Plugin Manager to use.
65
-     * @param serverManager      Server Manager to use.
65
+     * @param connectionManager      Server Manager to use.
66 66
      * @param identityController The controller to read/write settings with.
67 67
      * @param identityFactory    The factory to create new identities with.
68 68
      * @param eventBus           The event bus to post errors to
@@ -70,11 +70,11 @@ public class ServerList implements ConfigProviderListener {
70 70
     @Inject
71 71
     public ServerList(
72 72
             final PluginManager pluginManager,
73
-            final ServerManager serverManager,
73
+            final ConnectionManager connectionManager,
74 74
             final IdentityController identityController,
75 75
             final IdentityFactory identityFactory,
76 76
             final DMDircMBassador eventBus) {
77
-        this.serverManager = serverManager;
77
+        this.connectionManager = connectionManager;
78 78
         this.identityController = identityController;
79 79
         this.identityFactory = identityFactory;
80 80
 
@@ -162,7 +162,7 @@ public class ServerList implements ConfigProviderListener {
162 162
     public void configProviderAdded(final ConfigProvider configProvider) {
163 163
         try {
164 164
             final ServerGroupReader reader
165
-                    = new ServerGroupReader(serverManager, identityController, configProvider);
165
+                    = new ServerGroupReader(connectionManager, identityController, configProvider);
166 166
             addServerGroup(reader.read(), reader.getWriter());
167 167
         } catch (IllegalArgumentException ex) {
168 168
             // Silently ignore

+ 5
- 5
serverlists/src/com/dmdirc/addons/serverlists/io/ServerEntryReader.java Ver fichero

@@ -22,9 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlists.io;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.addons.serverlists.ServerEntry;
27 26
 import com.dmdirc.addons.serverlists.ServerGroup;
27
+import com.dmdirc.interfaces.ConnectionManager;
28 28
 import com.dmdirc.interfaces.config.ConfigProvider;
29 29
 import com.dmdirc.interfaces.config.IdentityController;
30 30
 
@@ -40,15 +40,15 @@ import java.net.URISyntaxException;
40 40
 public class ServerEntryReader {
41 41
 
42 42
     /** ServerManager that ServerEntrys use to create servers */
43
-    private final ServerManager serverManager;
43
+    private final ConnectionManager connectionManager;
44 44
     /** The controller to read/write settings with. */
45 45
     private final IdentityController identityController;
46 46
     /** The identity to read entries from. */
47 47
     private final ConfigProvider identity;
48 48
 
49
-    public ServerEntryReader(final ServerManager serverManager,
49
+    public ServerEntryReader(final ConnectionManager connectionManager,
50 50
             final IdentityController identityController, final ConfigProvider identity) {
51
-        this.serverManager = serverManager;
51
+        this.connectionManager = connectionManager;
52 52
         this.identityController = identityController;
53 53
         this.identity = identity;
54 54
     }
@@ -75,7 +75,7 @@ public class ServerEntryReader {
75 75
         final String serverName = identity.getOption(name, "name");
76 76
         final URI serverURI = new URI(identity.getOption(name, "address"));
77 77
 
78
-        return new ServerEntry(identityController, serverManager, group, serverName, serverURI, null);
78
+        return new ServerEntry(identityController, connectionManager, group, serverName, serverURI, null);
79 79
     }
80 80
 
81 81
 }

+ 4
- 4
serverlists/src/com/dmdirc/addons/serverlists/io/ServerGroupReader.java Ver fichero

@@ -22,8 +22,8 @@
22 22
 
23 23
 package com.dmdirc.addons.serverlists.io;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.addons.serverlists.ServerGroup;
26
+import com.dmdirc.interfaces.ConnectionManager;
27 27
 import com.dmdirc.interfaces.config.ConfigProvider;
28 28
 import com.dmdirc.interfaces.config.IdentityController;
29 29
 
@@ -48,17 +48,17 @@ public class ServerGroupReader {
48 48
     /**
49 49
      * Creates a new ServerGroupReader that will read from the specified identity.
50 50
      *
51
-     * @param serverManager      The server manager to use to connect to servers.
51
+     * @param connectionManager      The server manager to use to connect to servers.
52 52
      * @param identityController The identity controller to use.
53 53
      * @param identity           The identity describing the server group
54 54
      */
55 55
     public ServerGroupReader(
56
-            final ServerManager serverManager,
56
+            final ConnectionManager connectionManager,
57 57
             final IdentityController identityController,
58 58
             final ConfigProvider identity) {
59 59
         this.identity = identity;
60 60
         this.identityController = identityController;
61
-        this.entryReader = new ServerEntryReader(serverManager, identityController, identity);
61
+        this.entryReader = new ServerEntryReader(connectionManager, identityController, identity);
62 62
     }
63 63
 
64 64
     /**

+ 7
- 7
ui_swing/src/com/dmdirc/addons/ui_swing/Apple.java Ver fichero

@@ -24,10 +24,10 @@ package com.dmdirc.addons.ui_swing;
24 24
 
25 25
 import com.dmdirc.ClientModule.GlobalConfig;
26 26
 import com.dmdirc.DMDircMBassador;
27
-import com.dmdirc.ServerManager;
28 27
 import com.dmdirc.addons.ui_swing.components.menubar.MenuBar;
29 28
 import com.dmdirc.events.ClientOpenedEvent;
30 29
 import com.dmdirc.events.UserErrorEvent;
30
+import com.dmdirc.interfaces.ConnectionManager;
31 31
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
32 32
 import com.dmdirc.logger.ErrorLevel;
33 33
 import com.dmdirc.util.InvalidURIException;
@@ -73,7 +73,7 @@ public class Apple implements InvocationHandler {
73 73
     /** Whether the CLIENT_OPENED action has been called or not. */
74 74
     private boolean clientOpened = false;
75 75
     /** The server manager to use to connect to URLs. */
76
-    private final ServerManager serverManager;
76
+    private final ConnectionManager connectionManager;
77 77
     /** Event bus. */
78 78
     private final DMDircMBassador eventBus;
79 79
 
@@ -84,16 +84,16 @@ public class Apple implements InvocationHandler {
84 84
      * This will attempt to load the native library and register the URL open callback.
85 85
      *
86 86
      * @param configManager Config manager
87
-     * @param serverManager The server manager to use to connect to URLs.
87
+     * @param connectionManager The server manager to use to connect to URLs.
88 88
      * @param eventBus      The bus to listen for events on.
89 89
      */
90 90
     @Inject
91 91
     public Apple(
92 92
             @GlobalConfig final AggregateConfigProvider configManager,
93
-            final ServerManager serverManager,
93
+            final ConnectionManager connectionManager,
94 94
             final DMDircMBassador eventBus) {
95 95
         this.configManager = configManager;
96
-        this.serverManager = serverManager;
96
+        this.connectionManager = connectionManager;
97 97
         this.eventBus = eventBus;
98 98
     }
99 99
 
@@ -444,7 +444,7 @@ public class Apple implements InvocationHandler {
444 444
         synchronized (addresses) {
445 445
             clientOpened = true;
446 446
             for (final URI addr : addresses) {
447
-                serverManager.connectToAddress(addr);
447
+                connectionManager.connectToAddress(addr);
448 448
             }
449 449
             addresses.clear();
450 450
         }
@@ -515,7 +515,7 @@ public class Apple implements InvocationHandler {
515 515
                     Thread.currentThread().setContextClassLoader(ClassLoader.getSystemClassLoader());
516 516
                 }
517 517
 
518
-                serverManager.connectToAddress(uri);
518
+                connectionManager.connectToAddress(uri);
519 519
             } else {
520 520
                 addresses.add(uri);
521 521
             }

+ 6
- 6
ui_swing/src/com/dmdirc/addons/ui_swing/QuitWorker.java Ver fichero

@@ -23,8 +23,8 @@
23 23
 package com.dmdirc.addons.ui_swing;
24 24
 
25 25
 import com.dmdirc.DMDircMBassador;
26
-import com.dmdirc.ServerManager;
27 26
 import com.dmdirc.events.ClientClosingEvent;
27
+import com.dmdirc.interfaces.ConnectionManager;
28 28
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
29 29
 import com.dmdirc.interfaces.config.ConfigProvider;
30 30
 import com.dmdirc.interfaces.config.IdentityController;
@@ -42,7 +42,7 @@ public class QuitWorker extends SwingWorker<Void, Void> {
42 42
     /** The config to read settings from. */
43 43
     private final AggregateConfigProvider globalConfig;
44 44
     /** The server manager to use to disconnect all servers. */
45
-    private final ServerManager serverManager;
45
+    private final ConnectionManager connectionManager;
46 46
     /** The main frame to interact with. */
47 47
     private final MainFrame mainFrame;
48 48
     /** Bus to dispatch events on. */
@@ -52,19 +52,19 @@ public class QuitWorker extends SwingWorker<Void, Void> {
52 52
      * Creates a new {@link QuitWorker}.
53 53
      *
54 54
      * @param identityController The identity controller to use to read/write settings.
55
-     * @param serverManager      The server manager to use to disconnect all servers.
55
+     * @param connectionManager      The server manager to use to disconnect all servers.
56 56
      * @param mainFrame          The main frame to interact with.
57 57
      * @param eventBus           Bus to dispatch events on.
58 58
      */
59 59
     @Inject
60 60
     public QuitWorker(
61 61
             final IdentityController identityController,
62
-            final ServerManager serverManager,
62
+            final ConnectionManager connectionManager,
63 63
             final MainFrame mainFrame,
64 64
             final DMDircMBassador eventBus) {
65 65
         this.globalIdentity = identityController.getUserSettings();
66 66
         this.globalConfig = identityController.getGlobalConfiguration();
67
-        this.serverManager = serverManager;
67
+        this.connectionManager = connectionManager;
68 68
         this.mainFrame = mainFrame;
69 69
         this.eventBus = eventBus;
70 70
     }
@@ -72,7 +72,7 @@ public class QuitWorker extends SwingWorker<Void, Void> {
72 72
     @Override
73 73
     protected Void doInBackground() {
74 74
         eventBus.publishAsync(new ClientClosingEvent());
75
-        serverManager.closeAll(globalConfig.getOption("general", "closemessage"));
75
+        connectionManager.closeAll(globalConfig.getOption("general", "closemessage"));
76 76
         globalIdentity.setOption("ui", "frameManagerSize",
77 77
                 String.valueOf(mainFrame.getFrameManagerSize()));
78 78
         return null;

+ 6
- 6
ui_swing/src/com/dmdirc/addons/ui_swing/components/menubar/HelpMenu.java Ver fichero

@@ -22,11 +22,11 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.menubar;
24 24
 
25
-import com.dmdirc.ServerManager;
26 25
 import com.dmdirc.addons.ui_swing.Apple;
27 26
 import com.dmdirc.addons.ui_swing.dialogs.about.AboutDialog;
28 27
 import com.dmdirc.addons.ui_swing.dialogs.feedback.FeedbackDialog;
29 28
 import com.dmdirc.addons.ui_swing.injection.DialogProvider;
29
+import com.dmdirc.interfaces.ConnectionManager;
30 30
 
31 31
 import java.awt.event.ActionEvent;
32 32
 import java.awt.event.ActionListener;
@@ -45,7 +45,7 @@ public class HelpMenu extends JMenu implements ActionListener {
45 45
     /** Serial version UID. */
46 46
     private static final long serialVersionUID = 1;
47 47
     /** Server manager to use to join dev chat. */
48
-    private final ServerManager serverManager;
48
+    private final ConnectionManager connectionManager;
49 49
     /** Provider of feedback dialogs. */
50 50
     private final DialogProvider<FeedbackDialog> feedbackDialogProvider;
51 51
     /** Provider of about dialogs. */
@@ -54,17 +54,17 @@ public class HelpMenu extends JMenu implements ActionListener {
54 54
     /**
55 55
      * Instantiates a new help menu.
56 56
      *
57
-     * @param serverManager          The manager to use to join dev chat.
57
+     * @param connectionManager          The manager to use to join dev chat.
58 58
      * @param feedbackDialogProvider Provider of feedback dialogs.
59 59
      * @param aboutDialogProvider    Provider of about dialogs.
60 60
      */
61 61
     @Inject
62 62
     public HelpMenu(
63
-            final ServerManager serverManager,
63
+            final ConnectionManager connectionManager,
64 64
             final DialogProvider<FeedbackDialog> feedbackDialogProvider,
65 65
             final DialogProvider<AboutDialog> aboutDialogProvider) {
66 66
         super("Help");
67
-        this.serverManager = serverManager;
67
+        this.connectionManager = connectionManager;
68 68
         this.feedbackDialogProvider = feedbackDialogProvider;
69 69
         this.aboutDialogProvider = aboutDialogProvider;
70 70
         setMnemonic('h');
@@ -108,7 +108,7 @@ public class HelpMenu extends JMenu implements ActionListener {
108 108
                 aboutDialogProvider.displayOrRequestFocus();
109 109
                 break;
110 110
             case "JoinDevChat":
111
-                serverManager.joinDevChat();
111
+                connectionManager.joinDevChat();
112 112
                 break;
113 113
             case "feedback":
114 114
                 feedbackDialogProvider.displayOrRequestFocus();

+ 4
- 4
ui_swing/src/com/dmdirc/addons/ui_swing/components/statusbar/InviteLabel.java Ver fichero

@@ -25,7 +25,6 @@ package com.dmdirc.addons.ui_swing.components.statusbar;
25 25
 import com.dmdirc.ClientModule.GlobalConfig;
26 26
 import com.dmdirc.DMDircMBassador;
27 27
 import com.dmdirc.Invite;
28
-import com.dmdirc.ServerManager;
29 28
 import com.dmdirc.addons.ui_swing.MainFrame;
30 29
 import com.dmdirc.addons.ui_swing.SelectionListener;
31 30
 import com.dmdirc.addons.ui_swing.UIUtilities;
@@ -34,6 +33,7 @@ import com.dmdirc.events.ServerConnectErrorEvent;
34 33
 import com.dmdirc.events.ServerConnectedEvent;
35 34
 import com.dmdirc.events.ServerDisconnectedEvent;
36 35
 import com.dmdirc.interfaces.Connection;
36
+import com.dmdirc.interfaces.ConnectionManager;
37 37
 import com.dmdirc.interfaces.InviteListener;
38 38
 import com.dmdirc.ui.IconManager;
39 39
 
@@ -75,14 +75,14 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements InviteLi
75 75
      *
76 76
      * @param eventBus      The event bus to subscribe to events on
77 77
      * @param iconManager   The manager to retrieve the invite icon from.
78
-     * @param serverManager The manager to use to iterate servers.
78
+     * @param connectionManager The manager to use to iterate servers.
79 79
      * @param mainFrame     Main frame
80 80
      */
81 81
     @Inject
82 82
     public InviteLabel(
83 83
             final DMDircMBassador eventBus,
84 84
             @GlobalConfig final IconManager iconManager,
85
-            final ServerManager serverManager,
85
+            final ConnectionManager connectionManager,
86 86
             final MainFrame mainFrame) {
87 87
         super(new JLabel());
88 88
 
@@ -99,7 +99,7 @@ public class InviteLabel extends StatusbarPopupPanel<JLabel> implements InviteLi
99 99
         accept.setActionCommand("acceptAll");
100 100
         accept.addActionListener(this);
101 101
 
102
-        for (final Connection connection : serverManager.getServers()) {
102
+        for (final Connection connection : connectionManager.getConnections()) {
103 103
             connection.addInviteListener(this);
104 104
         }
105 105
 

+ 3
- 3
ui_swing/src/com/dmdirc/addons/ui_swing/injection/SwingModule.java Ver fichero

@@ -26,7 +26,6 @@ import com.dmdirc.ClientModule;
26 26
 import com.dmdirc.ClientModule.GlobalConfig;
27 27
 import com.dmdirc.ClientModule.UserConfig;
28 28
 import com.dmdirc.DMDircMBassador;
29
-import com.dmdirc.ServerManager;
30 29
 import com.dmdirc.actions.ActionManager;
31 30
 import com.dmdirc.addons.ui_swing.Apple;
32 31
 import com.dmdirc.addons.ui_swing.MainFrame;
@@ -54,6 +53,7 @@ import com.dmdirc.addons.ui_swing.framemanager.FrameManagerProvider;
54 53
 import com.dmdirc.addons.ui_swing.framemanager.tree.TreeFrameManagerProvider;
55 54
 import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
56 55
 import com.dmdirc.config.prefs.PreferencesDialogModel;
56
+import com.dmdirc.interfaces.ConnectionManager;
57 57
 import com.dmdirc.interfaces.LifecycleController;
58 58
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
59 59
 import com.dmdirc.interfaces.config.ConfigProvider;
@@ -200,9 +200,9 @@ public class SwingModule {
200 200
     public URLHandler getURLHandler(
201 201
             final DMDircMBassador eventBus,
202 202
             @GlobalConfig final AggregateConfigProvider globalConfig,
203
-            final ServerManager serverManager,
203
+            final ConnectionManager connectionManager,
204 204
             final StatusBarManager statusBarManager) {
205
-        return new URLHandler(eventBus, globalConfig, serverManager, statusBarManager);
205
+        return new URLHandler(eventBus, globalConfig, connectionManager, statusBarManager);
206 206
     }
207 207
 
208 208
     @Provides

Loading…
Cancelar
Guardar