java.lang.Object
|
+--stec.iws.RealmAdministrator
public abstract class RealmAdministrator extends Object
Defines methods used by iServer Administrator to manage realms.
Methods
Method
|
Description
|
destroy
|
Called by iServer Administrator when unloading the security administrator realm.
|
init
|
Called by iServer Administrator when loading the security administrator realm.
|
load
|
Called by iServer Administrator to load configuration items.
|
save
|
Called by iServer Administrator to save configuration items.
|
destroy
Called by iServer Administrator when unloading the security administrator realm.
Syntax
public void destroy()
Parameters
Returns
Throws
Example
public destroy()
{
super.destroy();
close_files();
}
init
Called by iServer Administrator when loading the security administrator realm.
Syntax
public void init(Hashtable parameters) throws Exception
Parameters
parameters
|
a hashtable containing initialization parameters.
|
Returns
Throws
Exception
|
any exception thrown.
|
Example
public void init(Hashtable parameters) throws Exception
{
super.init(parameters);
Object filename = parameters.get(file_name);
if(filename == null)
{
filename = "realm.dat";
}
open_files((String)file_name);
}
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();
}
}
}
|