java.lang.Object
|
+--javax.servlet.http.HttpServlet
|
+--stec.iws.RealmAdministrator
public abstract class RealmAdministrator extends HttpServlet
Defined methods used by iServer Administrator to manage realms.
Methods
Method
|
Description
|
load
|
Called by iServer Administrator to load configuration items.
|
save
|
Called by iServer Administrator to save configuration items.
|
load
Called by iServer Administrator to load configuration items.
Syntax
public abstract Hashtable load(String form_name) throws Exception
Parameters
form_name
|
the name of the form used to identify the configuration item to load.
|
Returns
Hashtable
|
contains key, value pairs with the configuration information for the form.
|
Throws
Exception
|
any exception thrown.
|
Example
public Hashtable load(String form_name) throws Exception
{
return Utils.load("./config/" + form_name + ".conf");
}
load
Called by iServer Administrator to save configuration items.
Syntax
public abstract Hashtable save(String form_name, Hashtable items) throws Exception
Parameters
form_name
|
the name of the form used to identify the configuration item to save.
|
items
|
contains key, value pairs with the configuration information for the form.
|
Returns
Throws
Exception
|
any exception thrown.
|
Example
public void save(String form_name, Hashtable items)
throws Exception
{
StringBuffer output = new StringBuffer();
String key;
String value;
Enumeration e = items.keys();
while(e.hasMoreElements())
{
key = (String)e.nextElement();
value = (String)items.get(key);
output.append(DString.replace(key, "\\", "\\\\"));
output.append(" = ");
output.append(DString.replace(value, "\\", "\\\\"));
output.append('\n');
}
PrintWriter writer = null;
try
{
fh = new File("./config/" + form_name + ".conf");
writer = new PrintWriter(new FileOutputStream(fh));
writer.write(output.toString());
}
finally
{
if(writer != null)
{
writer.close();
}
}
}
|