It seems that there are now a number of modules designed to offer
diagnostic and useful internal information to the end user via a servlet.
I propose that we bring these all under one flexible mechanism.

We could define a generic interface for a "Statlet" as follows:

/**
 * Will return specific diagnostic information about the
 * internals of that node in HTML format suitable for inclusion in a
 * HTML page 
 **/
public interface Statlet
{
  public String getName();
  public String getDescription();
  public String getHtml();
}

The Statlet should probably be given the freenet.node.Node object in its
constructor.

A Statlet can then be registered with a StatletGroup, which is itself a
Statlet, as follows:

/**
 * A Statlet which contains other Statlets
 **/
public class StatletGroup implements Statlet
{
  /**
   * Add a Statlet to this Group
   **/
  public void register(Statlet s)
  { ... }

  /**
   * Set whether the statlets in this group should be displayed on
   * a single page or on separate pages
   * @param b True iff statlets in this group should be displayed
   *          on the same page
   **/
  public void setExpanded(boolean b)
  { ... }

  ...add implementations of other required Statlet methods...
}

Through this mechanism a hierarchy of Statlets can be created, which could
then be presented to the user as a HTML menu (perhaps using frames) by a
StatletManagerServlet, this could be accessed by browsing to
http://127.0.0.1:8888/stats/ (I don't think there is much excuse for tying
up another port, all HTTP communication with the user should be via port
8888).

Thoughts?

Ian.

-- 
Ian Clarke                                        ian at freenetproject.org
Founder & Coordinator, The Freenet Project    http://freenetproject.org/
Chief Technology Officer, Uprizer Inc.           http://www.uprizer.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20020122/23965402/attachment.pgp>

Reply via email to