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 Realm RealmAdmin... ServletManager Utils Servlet API CGI SSI Servlets Config Files Log Files Classes Directory Tree Samples Sales Legal Feedback |
    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
Norhtin
#### 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
| Copyright © 1997-2000 Servertec. All rights reserved. Last Modified: Sun Jan 09 19:34:12 EST 2000