📄 jembossparams.java
字号:
int n=0; while(st.hasMoreTokens()) { st.nextToken(); n++; } int sizeEnvp = envp.length; String environ[] = new String[n+sizeEnvp]; st = new StringTokenizer(embossEnvironment," "); for(int i=0;i<sizeEnvp;i++) environ[i] = envp[i]; n=sizeEnvp; while(st.hasMoreTokens()) { environ[n] = new String(st.nextToken()); n++; } return environ; }/**** Acd file location* @return acd file location**/ public String getAcdDirToParse() { return acdDirToParse; }/**** Set the URL of the public soap server* @param s URL of the public services**/ public void setPublicSoapURL(String s) { publicSoapURL = s; }/**** Returns the URL of the private soap server* @return URL of the private services**/ public String getPrivateSoapURL() { return privateSoapURL; }/**** Set the URL of the private soap server* @param s URL of the private services**/ public void setPrivateSoapURL(String s) { privateSoapURL = s; }/**** Return whether we have failover on the public server**/ public boolean getPublicServerFailover() { return publicServerFailOver; }/**** Return whether we have failover on the private server**/ public boolean getPrivateServerFailover() { return privateServerFailOver; }/**** Return a vector containing the list of public servers**/ public Vector getPublicServers() { return publicServers; }/**** Return a vector containing the list of private servers**/ public Vector getPrivateServers() { return privateServers; }/**** Mark a server as bad**/ public void setServerStatus(String server, int i) { serverStatusHash.put(server, new Integer(i)); }/**** Return the username needed for the remote service* @return the username**/ public String getServiceUserName() { return serviceUserName; }/**** Save the username needed for the remote service* @param newUserName the username**/ public void setServiceUserName(String newUserName) { serviceUserName = newUserName; }/**** Return the password needed for the remote service* @return password**/ public char[] getServicePasswd() { return servicePasswd; }/**** Return the password needed for the remote service* @return password**/ public byte[] getServicePasswdByte() { return servicePasswdByte; }/**** Return the password as byte array**/ private static byte[] toByteArr(char ch[]) { int len = ch.length; byte msb[] = new byte[len]; for(int i=0;i<len;i++) msb[i] = (byte)(ch[i]); return msb; }/**** Save the password needed for the remote service* @param newPasswd the username**/ public void setServicePasswd(char[] newPasswd) { int csize = newPasswd.length; servicePasswd = new char[csize]; for(int i=0;i<csize;i++) servicePasswd[i] = newPasswd[i]; servicePasswdByte = toByteArr(newPasswd); }/**** Get the name of the soap service * @return soap service name**/ public String getSoapService() { return soapService; }/**** Get the name of the private soap service * @return private service name **/ public String getPrivateSoapService() { return privateSoapService; }/**** Set the name of the private soap service* @param s private service name**/ public void setPrivateSoapService(String s) { privateSoapService = s; }/**** Get the name of the public soap service we're using* @return public service name**/ public String getPublicSoapService() { return publicSoapService; }/**** Set the name of the public soap service we're using* @param s public service name**/ public void setPublicSoapService(String s) { publicSoapService = s; }/**** A description of the server settings* @return description of the services**/ public String serverDescription() { String serverdesc = "Current Settings:" +"\nPublic Server: "+publicSoapURL +"\nPrivate Server: "+privateSoapURL +"\nPublic SOAP service: "+publicSoapService +"\nPrivate SOAP service: "+privateSoapService; return serverdesc; }/**** Whether to show debugging information**/ public boolean getDebug() { return debug; }/**** Whether this service supports batch mode* @return true if batch mode supported**/ public boolean getHasBatchMode() { return hasBatchMode; }/**** Whether this service supports interactive mode* @return true if interactive mode supported**/ public boolean getHasInteractiveMode() { return hasInteractiveMode; }/**** The current mode (interactive or batch).* @return a String containing the current mode**/ public String getCurrentMode() { if(hasInteractiveMode) { if (hasBatchMode) return currentMode; else return "interactive"; } else { if (hasBatchMode) return "batch"; else return currentMode; } }/**** Set the current mode (interactive or batch). * @param newMode The new execution mode**/ public void setCurrentMode(String newMode) { currentMode = newMode; }/**** Return the mode list as a vector, suitable for loading into* a combobox.* @return mode list**/ public Vector modeVector() { Vector mv = new Vector(); if (hasInteractiveMode) { if (hasBatchMode) { if (currentMode.equals("interactive")) { mv.add("interactive"); mv.add("batch"); } else if (currentMode.equals("batch")) { mv.add("batch"); mv.add("interactive"); } else { mv.add(currentMode); mv.add("interactive"); mv.add("batch"); } } else mv.add("interactive"); } else { if(hasBatchMode) mv.add("batch"); } return mv; }/**** Update the properties structure. * This doesn't update the actual properties, just the Properties object* so you must call updateSettingsFromProperties yoursefl** @param name A String naming the property to be updated* @param newvalue A String containing the new value of the property**/ public void updateJembossProperty(String name, String newvalue) { if (jembossSettings.getProperty(name) != null) jembossSettings.setProperty(name,newvalue); }/**** Parse a key=value string to update the properties structure* @param entry String containing a key=value message**/ public void updateJembossPropString(String entry) { int isep = entry.indexOf('='); if(isep != -1) { String pkey = entry.substring(0,isep); String pvalue = entry.substring(isep+1); updateJembossProperty(pkey, pvalue); } }/**** Parse an array of key=value strings to update the properties structure* @param entries Array of Strings containing key=value messages**/ public void updateJembossPropStrings(String[] entries) { for (int i=0; i < entries.length; ++i) updateJembossPropString(entries[i]); updateSettingsFromProperties(); setupServerRedundancy(); }/**** Update properties from a Hashtable* @param hash Hashtable containg properties**/ public void updateJembossPropHash(Hashtable hash) { Enumeration enumer = hash.keys(); while(enumer.hasMoreElements()) { String thiskey = (String)enumer.nextElement().toString(); String thisval = (String)hash.get(thiskey); updateJembossProperty(thiskey,thisval); } updateSettingsFromProperties(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -