1 19 package org.openharmonise.vfs.servers; 20 21 import java.util.*; 22 23 import org.openharmonise.vfs.servers.*; 24 25 26 33 public class ServerList { 34 35 38 private static ServerList m_instance = null; 39 40 43 private HashMap m_aServers = new HashMap(); 44 45 48 private Server m_HarmoniseServer = null; 49 50 53 private ServerList() { 54 super(); 55 } 56 57 62 public static ServerList getInstance() { 63 if(m_instance==null) { 64 m_instance = new ServerList(); 65 } 66 return m_instance; 67 } 68 69 74 public void addHarmoniseServer(Server server) { 75 if(server.getURI().getHost()!=null && server.getURI().getHost().equals("localhost")) { 76 this.m_aServers.put("mutley.simulacramedia.com", server); 77 } else if(server.getURI().getHost()==null) { 78 this.m_aServers.put("LOCALFILESYSTEM", server); 79 } 80 this.m_aServers.put(server.getURI().getHost(), server); 81 this.m_HarmoniseServer = server; 82 } 83 84 89 public Server getHarmoniseServer() { 90 return this.m_HarmoniseServer; 91 } 92 93 98 public void addServer(Server server) { 99 if(server.getURI().getHost()!=null && server.getURI().getHost().equals("localhost")) { 100 this.m_aServers.put("mutley.simulacramedia.com", server); 101 } else if(server.getURI().getHost()==null) { 102 this.m_aServers.put("LOCALFILESYSTEM", server); 103 } 104 this.m_aServers.put(server.getURI().getHost(), server); 105 } 106 107 112 public void removeServer(String sHost) { 113 this.m_aServers.remove(sHost); 114 } 115 116 122 public Server getServer(String sHost) { 123 124 return (Server) this.m_aServers.get(sHost); 125 } 126 127 132 public List getServers() { 133 return new ArrayList(this.m_aServers.values()); 134 } 135 136 } 137
| Popular Tags
|