diff options
Diffstat (limited to 'directory/src')
-rw-r--r-- | directory/src/main/java/com/orbekk/same/directory/DirectoryApp.java | 1 | ||||
-rw-r--r-- | directory/src/main/java/com/orbekk/same/directory/DirectoryServiceImpl.java | 24 |
2 files changed, 3 insertions, 22 deletions
diff --git a/directory/src/main/java/com/orbekk/same/directory/DirectoryApp.java b/directory/src/main/java/com/orbekk/same/directory/DirectoryApp.java index 667d4f0..45ad75a 100644 --- a/directory/src/main/java/com/orbekk/same/directory/DirectoryApp.java +++ b/directory/src/main/java/com/orbekk/same/directory/DirectoryApp.java @@ -4,7 +4,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.orbekk.protobuf.SimpleProtobufServer; -import com.orbekk.same.discovery.DirectoryService; import com.orbekk.same.http.JettyServerBuilder; import com.orbekk.same.http.ServerContainer; diff --git a/directory/src/main/java/com/orbekk/same/directory/DirectoryServiceImpl.java b/directory/src/main/java/com/orbekk/same/directory/DirectoryServiceImpl.java index 9c38446..ff1120e 100644 --- a/directory/src/main/java/com/orbekk/same/directory/DirectoryServiceImpl.java +++ b/directory/src/main/java/com/orbekk/same/directory/DirectoryServiceImpl.java @@ -9,13 +9,12 @@ import org.slf4j.LoggerFactory; import com.google.protobuf.RpcCallback; import com.google.protobuf.RpcController; -import com.orbekk.same.discovery.DirectoryService; import com.orbekk.same.Services; import com.orbekk.same.Services.Empty; import com.orbekk.same.Services.MasterState; import com.orbekk.same.Services.NetworkDirectory; -public class DirectoryServiceImpl extends Services.Directory implements DirectoryService { +public class DirectoryServiceImpl extends Services.Directory { private Logger logger = LoggerFactory.getLogger(getClass()); public final static long EXPIRE_TIME = 15 * 60l * 1000; // 15 minutes List<NetworkEntry> networkList = new ArrayList<NetworkEntry>(); @@ -31,20 +30,7 @@ public class DirectoryServiceImpl extends Services.Directory implements Director logger.info("Cleaned network list. Networks: {}", networkList); } - @Override - public List<String> getNetworks() throws Exception { - cleanNetworkList(); - List<String> networks = new ArrayList<String>(); - for (NetworkEntry e : networkList) { - networks.add(e.networkName); - networks.add(e.masterUrl); - } - return networks; - } - - @Override - public void registerNetwork(String networkName, String masterUrl) - throws Exception { + public void registerNetwork(String networkName, String masterUrl) { cleanNetworkList(); NetworkEntry entry = new NetworkEntry(networkName, masterUrl); entry.register(System.currentTimeMillis()); @@ -55,11 +41,7 @@ public class DirectoryServiceImpl extends Services.Directory implements Director @Override public void registerNetwork(RpcController controller, MasterState request, RpcCallback<Empty> done) { - try { - registerNetwork(request.getNetworkName(), request.getMasterUrl()); - } catch (Exception e) { - // No RPC call here. - } + registerNetwork(request.getNetworkName(), request.getMasterUrl()); done.run(Empty.getDefaultInstance()); } |