1 /***************************************************************
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version 2
6 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * @author: Copyright (C) Tim Carver
19 ***************************************************************/
24 import java.io.FileInputStream;
25 import java.io.FileOutputStream;
26 import java.net.InetAddress;
31 * Contains all property information about the client
35 public class JembossParams
38 /** denotes a server is OK */
39 static public final int SERVER_OK = 0;
40 /** denotes a server is giving errors */
41 static public final int SERVER_ERR = 1;
42 /** denotes a server is not responding */
43 static public final int SERVER_DOWN = 2;
45 // these are the things that could be set
46 private boolean useHTTPSProxy = false;
47 private String useHTTPSProxyName = "useHTTPSProxy";
49 private boolean useProxy = false;
50 private String useProxyName = "proxy.use";
52 private String proxyHost = "wwwcache";
53 private String proxyHostName = "proxy.host";
55 private int proxyPortNum = 8080;
56 private String proxyPortNumName = "proxy.port";
60 /** use a separate proxy for browsing the web */
61 private boolean useBrowserProxy = false;
62 /** property name for using separate proxy for browsing the web */
63 private String useBrowserProxyName = "browserProxy.use";
64 /** browser proxy host */
65 private String browserProxyHost = "wwwcache";
66 /** property name for browser proxy host */
67 private String browserProxyHostName = "browserProxy.host";
68 /** browser proxy port */
69 private int browserProxyPort = 8080;
70 /** property name for browser proxy port */
71 private String browserProxyPortName = "browserProxy.port";
73 private boolean useTFM;
74 private String useTFMName = "tfm.use";
76 /** use proxy authentication */
77 private boolean useProxyAuth = false;
78 /** property name for using proxy authentication */
79 private String useProxyAuthName = "proxy.auth";
81 private String proxyAuthUser = "";
82 private String proxyAuthUserName = "proxy.user";
84 private String proxyAuthPasswd = "";
85 private String proxyAuthPasswdName = "proxy.passwd";
87 private boolean proxyOverride = false;
88 private String proxyOverrideName = "proxy.override";
90 /** use unix authentication to run applications on the server */
91 private boolean useAuth = false;
92 /** property name for using unix authentication */
93 private String useAuthName = "user.auth";
95 /** public services URL */
96 private String publicSoapURL =
97 "http://anaplog.compbio.dundee.ac.uk:8080/axis/services";
98 /** property name for public services URL */
99 private String publicSoapURLName = "server.public";
101 /** private services URL */
102 private String privateSoapURL =
103 "http://anaplog.compbio.dundee.ac.uk:8080/axis/services";
104 /** property name for private services URL */
105 private String privateSoapURLName = "server.private";
108 private String soapService = "JembossServer";
109 /** property name for service name */
110 private String soapServiceName = "VAMSAS Services";
112 /** private service name */
113 private String privateSoapService = "JembossServer";
114 /** property name for private service name */
115 private String privateSoapServiceName = "VAMSAS Services";
117 /** public service name */
118 private String publicSoapService = "JembossServer";
119 /** property name for public service name */
120 private String publicSoapServiceName = "VAMSAS Services";
123 private boolean debug = false;
124 private String debugName = "jemboss.debug";
126 /** batch mode support */
127 private boolean hasBatchMode = true;
128 /** property name for batch mode support */
129 private String hasBatchModeName = "jemboss.hasbatchmode";
130 /** interactive mode support */
131 private boolean hasInteractiveMode = true;
132 /** property name for interactive mode support */
133 private String hasInteractiveModeName = "jemboss.hasinteractivemode";
134 /** current mode for running an application */
135 private String currentMode = "interactive";
136 /** property name for current mode */
137 private String currentModeName = "jemboss.mode";
139 // server lists for redundancy
140 private String serverPublicList = "";
141 private String serverPublicListName = "server.publiclist";
143 private String serverPrivateList = "";
144 private String serverPrivateListName = "server.privatelist";
146 // we don't remember these perhaps we should for captive systems
147 private String serviceUserName = "jalview";
148 private String serviceUserNameName = "user.name";
149 private char[] servicePasswd = null;
150 /** services password */
151 private byte[] servicePasswdByte = null;
153 Properties jembossSettings;
155 // Internal flags to help in the dynamic evaluation of properties
156 private boolean useJavaProxy = false;
157 private String javaProxyPort = "";
158 private String javaProxyHost = "";
159 private boolean useJavaNoProxy = false;
160 private String javaNoProxy = "";
161 private Vector javaNoProxyEntries;
162 private int javaProxyPortNum = 8080;
164 // structures for server redundancy
165 private boolean publicServerFailOver = false;
166 private boolean privateServerFailOver = false;
167 private Hashtable serverStatusHash;
168 private Vector publicServers;
169 private Vector privateServers;
171 /** Jemboss java server */
172 private static boolean jembossServer = false;
173 /** property name for Jemboss java server */
174 private String jembossServerName = "jemboss.server";
177 private static String cygwin = null;
178 /** property name for Jemboss java server */
179 private String cygwinName = "cygwin";
182 /** plplot library location */
183 private String plplot = "/usr/local/share/EMBOSS/";
184 /** property name for plplot library location */
185 private String plplotName = "plplot";
186 /** emboss data location */
187 private String embossData = "/usr/local/share/EMBOSS/data/";
188 /** property name for emboss data location */
189 private String embossDataName = "embossData";
190 /** emboss binary location */
191 private String embossBin = "/usr/local/bin/";
192 /** property name for emboss binary location */
193 private String embossBinName = "embossBin";
194 /** emboss path environment variable */
195 private String embossPath = "/usr/bin/:/bin";
196 /** property name for emboss path environment variable */
197 private String embossPathName = "embossPath";
198 /** emboss environment */
199 private String embossEnvironment = "";
200 /** property name for emboss environment */
201 private String embossEnvironmentName = "embossEnvironment";
202 /** acd file location */
203 private String acdDirToParse = "/usr/local/share/EMBOSS/acd/";
204 /** property name for acd file location */
205 private String acdDirToParseName = "acdDirToParse";
207 //EMBOSS Application pages
208 /** documentation URL */
209 private String embURL = "http://www.uk.embnet.org/Software/EMBOSS/Apps/";
210 /** property name for documentation URL */
211 private String embossURL = "embossURL";
214 /** user home directory */
215 private String userHome = System.getProperty("user.home");
216 /** property name for user home directory */
217 private String userHomeName = "user.home";
222 * Loads and holds the properties
225 public JembossParams()
227 Properties defaults = new Properties();
228 ClassLoader cl = this.getClass().getClassLoader();
230 // initialize data structures
231 serverStatusHash = new Hashtable();
232 publicServers = new Vector();
233 privateServers = new Vector();
235 // initialize settings from table above
236 defaults.put(userHomeName,userHome);
237 defaults.put(embossURL,embURL);
238 defaults.put(plplotName,plplot);
239 defaults.put(embossDataName,embossData);
240 defaults.put(embossBinName,embossBin);
241 defaults.put(embossPathName,embossPath);
242 defaults.put(embossEnvironmentName,embossEnvironment);
243 defaults.put(acdDirToParseName,acdDirToParse);
245 defaults.put(useBrowserProxyName, new Boolean(useBrowserProxy).toString());
246 defaults.put(browserProxyHostName,browserProxyHost);
247 defaults.put(browserProxyPortName,new Integer(browserProxyPort).toString());
249 defaults.put(useTFMName,new Boolean(useTFM).toString());
251 defaults.put(useProxyName, new Boolean(useProxy).toString());
252 defaults.put(useHTTPSProxyName, new Boolean(useHTTPSProxy).toString());
253 defaults.put(proxyHostName,proxyHost);
254 defaults.put(proxyPortNumName, new Integer(proxyPortNum).toString());
255 defaults.put(useProxyAuthName, new Boolean(useProxyAuth).toString());
256 defaults.put(proxyAuthUserName, proxyAuthUser);
257 defaults.put(proxyAuthPasswdName, proxyAuthPasswd);
258 defaults.put(proxyOverrideName, new Boolean(proxyOverride).toString());
259 defaults.put(useAuthName, new Boolean(useAuth).toString());
260 defaults.put(publicSoapURLName, publicSoapURL);
261 defaults.put(privateSoapURLName, privateSoapURL);
262 defaults.put(privateSoapServiceName, privateSoapService);
263 defaults.put(publicSoapServiceName, publicSoapService);
264 defaults.put(debugName, new Boolean(debug).toString());
265 defaults.put(hasBatchModeName, new Boolean(hasBatchMode).toString());
266 defaults.put(hasInteractiveModeName, new Boolean(hasInteractiveMode).toString());
267 defaults.put(currentModeName, currentMode);
268 defaults.put(serverPublicListName, serverPublicList);
269 defaults.put(serverPrivateListName, serverPrivateList);
270 defaults.put(serviceUserNameName, serviceUserName);
272 // load into real settings
273 jembossSettings = new Properties(defaults);
275 // try out of the classpath
278 jembossSettings.load(cl.getResourceAsStream("resources/jemboss.properties"));
283 System.out.println("Didn't find properties file in classpath.");
286 // override with local system settings
287 loadIn(System.getProperty("user.dir"));
289 // override with local user settings
290 loadIn(System.getProperty("user.home"));
292 // update our settings
293 updateSettingsFromProperties();
295 if(System.getProperty("useHTTPSProxy") != null)
296 if(System.getProperty("useHTTPSProxy").equalsIgnoreCase("true"))
299 // set up for overrides
300 javaNoProxyEntries = new Vector();
301 if(System.getProperty("proxyPort") != null)
303 if(System.getProperty("proxyHost") != null)
306 useProxy = useJavaProxy;
307 useBrowserProxy = useJavaProxy;
309 javaProxyPort = System.getProperty("proxyPort");
310 javaProxyPortNum = Integer.parseInt(javaProxyPort);
311 javaProxyHost = System.getProperty("proxyHost");
313 browserProxyHost = javaProxyHost;
314 browserProxyPort = javaProxyPortNum;
316 if(System.getProperty("http.nonProxyHosts") != null)
318 useJavaNoProxy = true;
319 javaNoProxy = System.getProperty("http.nonProxyHosts");
320 StringTokenizer tok = new StringTokenizer(javaNoProxy,"|");
321 while (tok.hasMoreTokens())
323 String toks = tok.nextToken() + "/";
324 javaNoProxyEntries.add(toks);
334 * Load a property from the jemboss.property file.
335 * @param folder location of jemboss.property
338 private void loadIn(String folder)
340 FileInputStream in = null;
343 String fs = System.getProperty("file.separator");
344 in = new FileInputStream(folder + fs + "jemboss.properties");
345 jembossSettings.load(in);
347 catch (java.io.FileNotFoundException e)
351 System.out.println("Can't find properties file in"+folder+"."+
354 catch (java.io.IOException e)
357 System.out.println("Can't read properties file. " +
364 try { in.close(); } catch (java.io.IOException e) { }
373 * Update the property settings for jembossSettings.
376 protected void updateSettingsFromProperties()
383 userHome = jembossSettings.getProperty(userHomeName);
384 embURL = jembossSettings.getProperty(embossURL);
385 plplot = jembossSettings.getProperty(plplotName);
386 embossData = jembossSettings.getProperty(embossDataName);
387 embossBin = jembossSettings.getProperty(embossBinName);
388 embossPath = jembossSettings.getProperty(embossPathName);
389 embossEnvironment = jembossSettings.getProperty(embossEnvironmentName);
390 acdDirToParse = jembossSettings.getProperty(acdDirToParseName);
391 tmp = jembossSettings.getProperty(jembossServerName);
392 jembossServer = new Boolean(tmp).booleanValue();
394 cygwin = jembossSettings.getProperty(cygwinName);
396 tmp = jembossSettings.getProperty(useHTTPSProxyName);
397 useHTTPSProxy = new Boolean(tmp).booleanValue();
398 tmp = jembossSettings.getProperty(useProxyName);
399 useProxy = new Boolean(tmp).booleanValue();
400 proxyHost = jembossSettings.getProperty(proxyHostName);
401 tmp = jembossSettings.getProperty(proxyPortNumName);
402 proxyPortNum = Integer.parseInt(tmp);
404 tmp = jembossSettings.getProperty(useBrowserProxyName);
405 useBrowserProxy = new Boolean(tmp).booleanValue();
406 browserProxyHost = jembossSettings.getProperty(browserProxyHostName);
407 tmp = jembossSettings.getProperty(browserProxyPortName);
408 browserProxyPort = Integer.parseInt(tmp);
410 tmp = jembossSettings.getProperty(useTFMName);
411 useTFM = new Boolean(tmp).booleanValue();
413 tmp = jembossSettings.getProperty(useProxyAuthName);
414 useProxyAuth = new Boolean(tmp).booleanValue();
415 proxyAuthUser = jembossSettings.getProperty(proxyAuthUserName);
416 proxyAuthPasswd = jembossSettings.getProperty(proxyAuthPasswdName);
417 tmp = jembossSettings.getProperty(proxyOverrideName);
418 proxyOverride = new Boolean(tmp).booleanValue();
419 tmp = jembossSettings.getProperty(useAuthName);
420 useAuth = new Boolean(tmp).booleanValue();
421 publicSoapURL = jembossSettings.getProperty(publicSoapURLName);
422 privateSoapURL = jembossSettings.getProperty(privateSoapURLName);
423 soapService = jembossSettings.getProperty(soapServiceName);
424 privateSoapService = jembossSettings.getProperty(privateSoapServiceName);
425 publicSoapService = jembossSettings.getProperty(publicSoapServiceName);
426 tmp = jembossSettings.getProperty(debugName);
427 debug = new Boolean(tmp).booleanValue();
428 tmp = jembossSettings.getProperty(hasBatchModeName);
429 hasBatchMode = new Boolean(tmp).booleanValue();
430 tmp = jembossSettings.getProperty(hasInteractiveModeName);
431 hasInteractiveMode = new Boolean(tmp).booleanValue();
432 currentMode = jembossSettings.getProperty(currentModeName);
433 serverPublicList = jembossSettings.getProperty(serverPublicListName);
434 serverPrivateList = jembossSettings.getProperty(serverPrivateListName);
435 // serviceUserName = jembossSettings.getProperty(serviceUserNameName);
437 catch (Exception e) { }
442 * Initialize the server redundancy data. This is a separate
443 * method because the server info might not be initialized in
444 * the constructor, but may be imported later from the command line.
447 protected void setupServerRedundancy()
449 if (!serverPublicList.equals(""))
452 System.out.println("JembossParams: Redundant public servers\n "
455 publicServerFailOver = true;
456 StringTokenizer tok = new StringTokenizer(serverPublicList,"|");
457 while (tok.hasMoreTokens())
459 String toks = tok.nextToken();
460 publicServers.add(toks);
462 System.out.println(" Entry " + toks);
464 serverStatusHash.put(toks, new Integer(SERVER_OK));
468 if(!serverPrivateList.equals(""))
471 System.out.println("JembossParams: Redundant private servers\n "
474 privateServerFailOver = true;
475 StringTokenizer tok = new StringTokenizer(serverPrivateList,"|");
476 while (tok.hasMoreTokens())
478 String toks = tok.nextToken();
479 privateServers.add(toks);
481 System.out.println(" Entry " + toks);
483 serverStatusHash.put(toks,new Integer(SERVER_OK));
491 * If using a proxy server
494 public boolean getUseProxy()
502 * If using an https proxy server
505 public boolean getUseHTTPSProxy()
507 return useHTTPSProxy;
513 * If using a proxy server for a given URL
514 * @param s the URL we wish to connect to
517 public boolean getUseProxy(String s)
530 int ip = javaNoProxyEntries.size();
531 for(int j = 0 ; j<ip ; ++j)
532 if(s.indexOf((String)javaNoProxyEntries.get(j).toString()) != -1)
542 * The name of the proxy server
543 * @return name of the proxy host
546 public String getProxyHost()
555 return javaProxyHost;
561 * The port the proxy server listens on
562 * @return proxy port number
565 public int getProxyPortNum()
574 return javaProxyPortNum;
580 * Determine if the a proxy server is being used for web browsing
581 * @return true if using a proxy server for the browser
584 public boolean isBrowserProxy()
586 return useBrowserProxy;
591 * Get the name of the proxy server for the browser
592 * @return the name of the proxy host
595 public String getBrowserProxyHost()
597 return browserProxyHost;
603 * The port number of the proxy server for the browser
604 * @return proxy port number
607 public int getBrowserProxyPort()
609 return browserProxyPort;
613 public boolean isUseTFM() { return useTFM; }
618 * If using authenticate with the proxy
619 * @return true if unix authentication used
622 public boolean getUseProxyAuth()
629 * Username needed to use for the proxy server
632 public String getProxyAuthUser()
634 return proxyAuthUser;
639 * Password needed to use for the proxy server
642 public String getProxyAuthPasswd()
644 return proxyAuthPasswd;
649 * A description of the proxy settings
650 * @return a description of the proxy settings
653 public String proxyDescription()
660 String spnum = new Integer(proxyPortNum).toString();
661 pdesc = "Current Settings: " + "Proxy Host: " + proxyHost +
662 " Proxy Port: " + spnum;
665 pdesc = "No proxies, connecting direct.";
671 pdesc = "Settings Imported from Java: " + "Proxy Host: " + javaProxyHost
672 + " Proxy Port: " + javaProxyPort;
674 pdesc = pdesc + "\nNo Proxy On: " + javaNoProxy;
680 String spnum = new Integer(proxyPortNum).toString();
681 pdesc = "Current Settings: " + "Proxy Host: " + proxyHost +
682 " Proxy Port: " + spnum;
685 pdesc = "No proxies, connecting direct.";
693 * Whether the main service requires authentication
694 * @return true if the server is using unix authentication
697 public boolean getUseAuth()
704 * Returns the URL of the public soap server
705 * @return the public services URL
708 public String getPublicSoapURL()
710 return publicSoapURL;
715 * @return true if using a Jemboss server
718 public static boolean isJembossServer()
720 return jembossServer;
725 * @return true if using cygwin
728 public static boolean isCygwin()
730 if(cygwin == null || cygwin.equals(""))
739 * Get the cygwin root
740 * @return cygwin root
743 public String getCygwinRoot()
752 * Get the location of plplot
753 * @return the location of plplot
756 public String getPlplot()
763 * Get the user home directory
764 * @return the user home directory
767 public String getUserHome()
774 * Set the user home directory property
775 * @param s the user home directory
778 public void setUserHome(String s)
785 * @return the documentation URL
788 public String getembURL()
795 * @return the location of the emboss data
798 public String getEmbossData()
805 * @return the location of the emboss binaries
808 public String getEmbossBin()
815 * Get the path for emboss
816 * @return the path for emboss
819 public String getEmbossPath()
826 * Get the environment for emboss
827 * @return the environment for emboss
830 public String getEmbossEnvironment()
832 embossEnvironment = embossEnvironment.trim();
833 embossEnvironment = embossEnvironment.replace(':',' ');
834 embossEnvironment = embossEnvironment.replace(',',' ');
835 return embossEnvironment;
840 * Get the emboss environment as a String array
841 * @return the emboss environment as a String array
844 public String[] getEmbossEnvironmentArray(String[] envp)
846 embossEnvironment = embossEnvironment.trim();
847 embossEnvironment = embossEnvironment.replace(':',' ');
848 embossEnvironment = embossEnvironment.replace(',',' ');
850 if(embossEnvironment.equals(""))
853 StringTokenizer st = new StringTokenizer(embossEnvironment," ");
855 while(st.hasMoreTokens())
861 int sizeEnvp = envp.length;
862 String environ[] = new String[n+sizeEnvp];
863 st = new StringTokenizer(embossEnvironment," ");
864 for(int i=0;i<sizeEnvp;i++)
865 environ[i] = envp[i];
868 while(st.hasMoreTokens())
870 environ[n] = new String(st.nextToken());
880 * @return acd file location
883 public String getAcdDirToParse()
885 return acdDirToParse;
890 * Set the URL of the public soap server
891 * @param s URL of the public services
894 public void setPublicSoapURL(String s)
901 * Returns the URL of the private soap server
902 * @return URL of the private services
905 public String getPrivateSoapURL()
907 return privateSoapURL;
912 * Set the URL of the private soap server
913 * @param s URL of the private services
916 public void setPrivateSoapURL(String s)
923 * Return whether we have failover on the public server
926 public boolean getPublicServerFailover()
928 return publicServerFailOver;
933 * Return whether we have failover on the private server
936 public boolean getPrivateServerFailover()
938 return privateServerFailOver;
943 * Return a vector containing the list of public servers
946 public Vector getPublicServers()
948 return publicServers;
953 * Return a vector containing the list of private servers
956 public Vector getPrivateServers()
958 return privateServers;
963 * Mark a server as bad
966 public void setServerStatus(String server, int i)
968 serverStatusHash.put(server, new Integer(i));
973 * Return the username needed for the remote service
974 * @return the username
977 public String getServiceUserName()
979 return serviceUserName;
984 * Save the username needed for the remote service
985 * @param newUserName the username
988 public void setServiceUserName(String newUserName)
990 serviceUserName = newUserName;
995 * Return the password needed for the remote service
999 public char[] getServicePasswd()
1001 return servicePasswd;
1006 * Return the password needed for the remote service
1010 public byte[] getServicePasswdByte()
1012 return servicePasswdByte;
1017 * Return the password as byte array
1020 private static byte[] toByteArr(char ch[])
1022 int len = ch.length;
1023 byte msb[] = new byte[len];
1025 for(int i=0;i<len;i++)
1026 msb[i] = (byte)(ch[i]);
1033 * Save the password needed for the remote service
1034 * @param newPasswd the username
1037 public void setServicePasswd(char[] newPasswd)
1039 int csize = newPasswd.length;
1040 servicePasswd = new char[csize];
1042 for(int i=0;i<csize;i++)
1043 servicePasswd[i] = newPasswd[i];
1045 servicePasswdByte = toByteArr(newPasswd);
1050 * Get the name of the soap service
1051 * @return soap service name
1054 public String getSoapService()
1061 * Get the name of the private soap service
1062 * @return private service name
1065 public String getPrivateSoapService()
1067 return privateSoapService;
1072 * Set the name of the private soap service
1073 * @param s private service name
1076 public void setPrivateSoapService(String s)
1078 privateSoapService = s;
1083 * Get the name of the public soap service we're using
1084 * @return public service name
1087 public String getPublicSoapService()
1089 return publicSoapService;
1094 * Set the name of the public soap service we're using
1095 * @param s public service name
1098 public void setPublicSoapService(String s)
1100 publicSoapService = s;
1105 * A description of the server settings
1106 * @return description of the services
1109 public String serverDescription()
1111 String serverdesc = "Current Settings:"
1112 +"\nPublic Server: "+publicSoapURL
1113 +"\nPrivate Server: "+privateSoapURL
1114 +"\nPublic SOAP service: "+publicSoapService
1115 +"\nPrivate SOAP service: "+privateSoapService;
1121 * Whether to show debugging information
1124 public boolean getDebug()
1131 * Whether this service supports batch mode
1132 * @return true if batch mode supported
1135 public boolean getHasBatchMode()
1137 return hasBatchMode;
1142 * Whether this service supports interactive mode
1143 * @return true if interactive mode supported
1146 public boolean getHasInteractiveMode()
1148 return hasInteractiveMode;
1153 * The current mode (interactive or batch).
1154 * @return a String containing the current mode
1157 public String getCurrentMode()
1159 if(hasInteractiveMode)
1164 return "interactive";
1177 * Set the current mode (interactive or batch).
1178 * @param newMode The new execution mode
1181 public void setCurrentMode(String newMode)
1183 currentMode = newMode;
1188 * Return the mode list as a vector, suitable for loading into
1193 public Vector modeVector()
1195 Vector mv = new Vector();
1196 if (hasInteractiveMode)
1200 if (currentMode.equals("interactive"))
1202 mv.add("interactive");
1205 else if (currentMode.equals("batch"))
1208 mv.add("interactive");
1212 mv.add(currentMode);
1213 mv.add("interactive");
1218 mv.add("interactive");
1230 * Update the properties structure.
1231 * This doesn't update the actual properties, just the Properties object
1232 * so you must call updateSettingsFromProperties yoursefl
1234 * @param name A String naming the property to be updated
1235 * @param newvalue A String containing the new value of the property
1238 public void updateJembossProperty(String name, String newvalue)
1240 if (jembossSettings.getProperty(name) != null)
1241 jembossSettings.setProperty(name,newvalue);
1246 * Parse a key=value string to update the properties structure
1247 * @param entry String containing a key=value message
1250 public void updateJembossPropString(String entry)
1252 int isep = entry.indexOf('=');
1255 String pkey = entry.substring(0,isep);
1256 String pvalue = entry.substring(isep+1);
1257 updateJembossProperty(pkey, pvalue);
1263 * Parse an array of key=value strings to update the properties structure
1264 * @param entries Array of Strings containing key=value messages
1267 public void updateJembossPropStrings(String[] entries)
1269 for (int i=0; i < entries.length; ++i)
1270 updateJembossPropString(entries[i]);
1272 updateSettingsFromProperties();
1273 setupServerRedundancy();
1278 * Update properties from a Hashtable
1279 * @param hash Hashtable containg properties
1282 public void updateJembossPropHash(Hashtable hash)
1284 Enumeration enumer = hash.keys();
1285 while(enumer.hasMoreElements())
1287 String thiskey = (String)enumer.nextElement().toString();
1288 String thisval = (String)hash.get(thiskey);
1289 updateJembossProperty(thiskey,thisval);
1291 updateSettingsFromProperties();