package impl.manipulators;
import Sight.Agents.*;
import Sight.dds.*;
import java.io.*;
import Sight.Agents.util.*;
public class alarmBell extends Sight.Agents.Prototypes.Wrapper implements Serializable {
public class Request extends Sight.Request implements java.io.Serializable {
public CharSequence field_0;
public CharSequence field_1;
public CharSequence field_2;
public CharSequence field_3;
public Sight.Agents.Request submit() { return Sight.Agents.Request.submit(Public, this, getKey()); };
public Sight.Agents.Request submit(String key)
{ return Sight.Agents.Request.submit(Public, this, key); };
};
public static Request getDefaultRequest() {
return Public.getRequest(); }
private Request getRequest() { return new Request(); };
public dStructure getRequestDds() {
return new Sight.dds.Records(true,
new dField[] {
new dField("field_0","CharSequence","Information",""),
new dField("field_1","CharSequence","Information",""),
new dField("field_2","CharSequence","Information",""),
new dField("field_3","CharSequence","Information","") }
);
}
public static class Result extends Sight.Result implements Serializable {
public Object[] a = new Object[1];
String id;
public String getReport(int verbosityLevel)
{
return "<a href=\"Events.html#evt_"+id+"\">note "+id+"</a><a name=\"evt_"+id+"\"></a>";
};
public CharSequence getReportForRecord(Object x, int verbosityLevel)
{
return getReport(verbosityLevel);
};
};
public static PrintStream alarms = null;
public static int id = 1;
public synchronized Object go(Object o_request) throws Exception
{
if (alarms==null)
alarms = Sight.Log.LogFileOpener.OpenHTML("Events");
Request r = (Request) o_request;
alarms.println("<a href=\"Index.html#evt_"+id+"\">note "+id+"</a>");
alarms.print("<a name=\"evt_"+id+"\"></a>");
alarms.print("<blockquote>");
if (r.field_0!=null)
alarms.print(r.field_0);
if (r.field_1!=null)
alarms.print("<br>"+r.field_1);
if (r.field_2!=null)
alarms.print("<br>"+r.field_2);
if (r.field_3!=null)
alarms.print("<br>"+r.field_3);
alarms.println("</blockquote>");
alarms.flush();
Result R = new Result();
R.id = Integer.toString(id);
id++;
return R;
};
public alarmBell() {
setDescription("Stores the messages about the events that occur where it is connected in 'Events.html'");
setMasterURL("");
setWriteCache(false);
setReadCache(false);
};
public static alarmBell Public = new alarmBell();
public static Agent getAvailableAgent() { return Public; };
public static void main(String[] args) {
Sight.Agents.util.Pind.showConsoles();
try {
Request request = getDefaultRequest();
Sight.Agents.Request submission = request.submit();
Result response = (Result) submission.getResult();
System.out.println(response.getReport(2));
} catch (Exception exc)
{ if (exc!=null) System.out.println(exc.getMessage());
exc.printStackTrace();
};
}
;
}