diff options
| -rw-r--r-- | src/main/java/derms/replica2/Hosts.java | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/main/java/derms/replica2/Hosts.java b/src/main/java/derms/replica2/Hosts.java deleted file mode 100644 index 8df77c1..0000000 --- a/src/main/java/derms/replica2/Hosts.java +++ /dev/null @@ -1,28 +0,0 @@ -package derms.replica2; - -import derms.City; - -import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Map; - -class Hosts { - private static Map<City, String> hosts = null; - - static String get(City city) throws UnknownHostException { - if (hosts == null) - init(); - - String host = hosts.get(city); - if (host == null) - throw new UnknownHostException("unknown host: "+city); - return host; - } - - private static void init() { - hosts = new HashMap<City, String>(); - hosts.put(new City("MTL"), "alpine1"); - hosts.put(new City("QUE"), "alpine2"); - hosts.put(new City("SHE"), "alpine3"); - } -} |