Servertec   RealmAdministrator
Content
Introduction
Release Notes
Features
FAQs
Requirements
Installation
Add-ons
How To
Change Log
Future Plans
Knowledge Base
Documentation
Conventions
Users
Reference
iServer API
AccessLogEntry
Codecs
Connection
ConnectionPool...
DString
ErrorLogEntry
EventLogEntry
FileCache
FileUpload
IOHandler
IOManager
iws
Logger
MultiPartForm
QuickSort
QuickSortString...
Realm
RealmAdmin...
RealmManager
ServletContextImpl
ServletContext...
ServletImpl
ServletManager
Utils

Servlet API
CGI
SSI
Servlets
Config Files
Log Files
Classes
Directory Tree

Samples
Sales
Legal
Feedback

 

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

None

Returns

Nothing

Throws

Nothing

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

Nothing

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

Nothing

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();
    }
  }
}
 top of page
 Built with iScript Copyright © 1997-2000 Servertec. All rights reserved.
Last Modified: Thu Aug 10 13:06:59 EDT 2000