diff options
Diffstat (limited to 'same/src/main')
3 files changed, 18 insertions, 0 deletions
diff --git a/same/src/main/java/com/orbekk/same/ConnectionManager.java b/same/src/main/java/com/orbekk/same/ConnectionManager.java index 4a24da5..f1ca65f 100644 --- a/same/src/main/java/com/orbekk/same/ConnectionManager.java +++ b/same/src/main/java/com/orbekk/same/ConnectionManager.java @@ -13,5 +13,6 @@ public interface ConnectionManager { PaxosService getPaxos(String url); Services.Master getMaster0(String location); + Services.Client getClient0(String location); Services.Directory getDirectory(String location); } diff --git a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java index 8c3b9df..34536a0 100644 --- a/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java +++ b/same/src/main/java/com/orbekk/same/ConnectionManagerImpl.java @@ -127,6 +127,16 @@ public class ConnectionManagerImpl implements ConnectionManager { } @Override + public Services.Client getClient0(String location) { + RpcChannel channel = getChannel(location); + if (channel != null) { + return Services.Client.newStub(channel); + } else { + return null; + } + } + + @Override public Services.Directory getDirectory(String location) { RpcChannel channel = getChannel(location); if (channel != null) { diff --git a/same/src/main/java/com/orbekk/same/TestConnectionManager.java b/same/src/main/java/com/orbekk/same/TestConnectionManager.java index 8319467..2305311 100644 --- a/same/src/main/java/com/orbekk/same/TestConnectionManager.java +++ b/same/src/main/java/com/orbekk/same/TestConnectionManager.java @@ -21,6 +21,8 @@ public class TestConnectionManager implements ConnectionManager { new HashMap<String, Services.Directory>(); public Map<String, Services.Master> masterMap0 = new HashMap<String, Services.Master>(); + public Map<String, Services.Client> clientMap0 = + new HashMap<String, Services.Client>(); public TestConnectionManager() { } @@ -49,4 +51,9 @@ public class TestConnectionManager implements ConnectionManager { public Master getMaster0(String location) { return masterMap0.get(location); } + + @Override + public Services.Client getClient0(String location) { + return clientMap0.get(location); + } } |