Skip to content

Commit

Permalink
Use Connection not Server in ServerManager.
Browse files Browse the repository at this point in the history
  • Loading branch information
greboid committed Mar 27, 2016
1 parent 0997552 commit 2e73368
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/com/dmdirc/ServerManager.java
Expand Up @@ -65,7 +65,7 @@ public class ServerManager implements ConnectionManager {

private static final Logger LOG = LoggerFactory.getLogger(ServerManager.class);
/** All servers that currently exist. */
private final Set<Server> servers = new CopyOnWriteArraySet<>();
private final Set<Connection> servers = new CopyOnWriteArraySet<>();
/** The manager to use to find profiles. */
private final ProfileManager profileManager;
/** The identity factory to give to servers. */
Expand Down Expand Up @@ -102,11 +102,11 @@ public ServerManager(
}

@Override
public Server createServer(final URI uri, final Profile profile) {
public Connection createServer(final URI uri, final Profile profile) {
final ConfigProviderMigrator configProvider = identityFactory.createMigratableConfig(uri.
getScheme(), "", "", uri.getHost());

final Server server = serverFactoryImpl.getServer(
final Connection server = serverFactoryImpl.getServer(
configProvider,
Executors.newScheduledThreadPool(1,
new ThreadFactoryBuilder().setNameFormat("server-timer-%d").build()),
Expand All @@ -122,7 +122,7 @@ public Server createServer(final URI uri, final Profile profile) {
*
* @param server The server to be registered
*/
void registerServer(final Server server) {
void registerServer(final Connection server) {
servers.add(server);
}

Expand All @@ -143,14 +143,14 @@ public List<Connection> getConnections() {

@Override
public void disconnectAll(final String message) {
for (Server server : servers) {
for (Connection server : servers) {
server.disconnect(message);
}
}

@Override
public void closeAll(final String message) {
for (Server server : servers) {
for (Connection server : servers) {
server.disconnect(message);
server.getWindowModel().close();
}
Expand All @@ -175,7 +175,7 @@ public Connection connectToAddress(final URI uri) {

@Override
public Connection connectToAddress(final URI uri, final Profile profile) {
final Server server = servers.stream()
final Connection server = servers.stream()
.filter(s -> s.compareURI(uri)).findAny()
.orElse(createServer(uri, profile));

Expand Down

0 comments on commit 2e73368

Please sign in to comment.