diff options
-rw-r--r-- | same/src/main/java/com/orbekk/same/MasterService.java | 2 | ||||
-rw-r--r-- | same/src/main/java/com/orbekk/same/MasterServiceImpl.java | 28 |
2 files changed, 12 insertions, 18 deletions
diff --git a/same/src/main/java/com/orbekk/same/MasterService.java b/same/src/main/java/com/orbekk/same/MasterService.java index f1ef24a..46e8ec1 100644 --- a/same/src/main/java/com/orbekk/same/MasterService.java +++ b/same/src/main/java/com/orbekk/same/MasterService.java @@ -1,6 +1,6 @@ package com.orbekk.same; public interface MasterService { - void joinNetworkRequest(String networkName, String clientUrl); + void joinNetworkRequest(String clientUrl); boolean updateStateRequest(String component, String newData, long revision); } diff --git a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java index 6779702..410def8 100644 --- a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java +++ b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java @@ -23,24 +23,18 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable { } @Override - public void joinNetworkRequest(String networkName, String clientUrl) { - if (networkName.equals(state.getDataOf(".networkName"))) { - List<String> participants = participants(); - if (!participants.contains(clientUrl)) { - participants.add(clientUrl); - synchronized(this) { - notifyAll(); - state.updateFromObject(".participants", participants, - state.getRevision(".participants")); - } - } else { - logger.warn("Client {} already part of network. " + - "Ignoring participation request", clientUrl); + public void joinNetworkRequest(String clientUrl) { + List<String> participants = participants(); + if (!participants.contains(clientUrl)) { + participants.add(clientUrl); + synchronized(this) { + notifyAll(); + state.updateFromObject(".participants", participants, + state.getRevision(".participants")); } - } else { - logger.warn("Client {} tried to join {}, but network name is {}", - new Object[]{ clientUrl, networkName, - state.getDataOf(".networkName") }); + } else { + logger.warn("Client {} already part of network. " + + "Ignoring participation request", clientUrl); } } |