home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / Notes.jar / lotus / notes / DebugSession.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-11-15  |  6.8 KB  |  229 lines

  1. package lotus.notes;
  2.  
  3. import java.util.Vector;
  4.  
  5. public class DebugSession extends Session {
  6.    private static String dumpAgentContextFile = "AgentRunner.nsf";
  7.    // $FF: renamed from: s lotus.notes.Session
  8.    private Session field_0;
  9.    private String keySrv;
  10.    private String keyDb;
  11.    private String keyAgent;
  12.    private Document doc;
  13.  
  14.    public DebugSession(AgentContext var1) throws NotesException {
  15.       super(1);
  16.       this.dumpAgentContext(Session.newInstance(), var1);
  17.    }
  18.  
  19.    public DebugSession(AgentContext var1, String var2) throws NotesException {
  20.       super(1);
  21.       this.dumpAgentContext(Session.newInstance(), var1, var2);
  22.    }
  23.  
  24.    public DebugSession(String var1, String var2, String var3) throws NotesException {
  25.       super(1);
  26.       this.field_0 = Session.newInstance();
  27.       this.keySrv = var1;
  28.       this.keyDb = var2;
  29.       this.keyAgent = var3;
  30.    }
  31.  
  32.    public Vector getAddressBooks() throws NotesException {
  33.       return this.field_0.getAddressBooks();
  34.    }
  35.  
  36.    public AgentContext getAgentContext() throws NotesException {
  37.       DebugAgentContext var1;
  38.       try {
  39.          Database var2 = this.field_0.getDatabase("", dumpAgentContextFile);
  40.          if (!var2.isOpen()) {
  41.             throw new NotesException("AgentContext database not found");
  42.          }
  43.  
  44.          View var3 = var2.getView("($AgentContexts)");
  45.          if (var3 == null) {
  46.             throw new NotesException("AgentContext view not found");
  47.          }
  48.  
  49.          Vector var4 = new Vector(2, 0);
  50.          var4.addElement((this.keySrv != "" && this.keySrv != "\u0000" ? this.keySrv : "Local") + "!!" + this.keyDb);
  51.          var4.addElement(this.keyAgent);
  52.          this.doc = var3.getDocumentByKey(var4, true);
  53.          if (this.doc == null) {
  54.             throw new NotesException("AgentContext document not found");
  55.          }
  56.  
  57.          var1 = new DebugAgentContext(this.field_0, this.doc);
  58.       } catch (Exception var5) {
  59.          var1 = null;
  60.          System.out.println(((Throwable)var5).getMessage());
  61.       }
  62.  
  63.       return var1;
  64.    }
  65.  
  66.    public String getCommonUserName() throws NotesException {
  67.       return this.field_0.getCommonUserName();
  68.    }
  69.  
  70.    public International getInternational() throws NotesException {
  71.       return this.field_0.getInternational();
  72.    }
  73.  
  74.    public boolean isOnServer() throws NotesException {
  75.       return this.field_0.isOnServer();
  76.    }
  77.  
  78.    public String getNotesVersion() throws NotesException {
  79.       return this.field_0.getNotesVersion();
  80.    }
  81.  
  82.    public String getPlatform() throws NotesException {
  83.       return this.field_0.getPlatform();
  84.    }
  85.  
  86.    public String getUserName() throws NotesException {
  87.       return this.field_0.getUserName();
  88.    }
  89.  
  90.    public Name getUserNameObject() throws NotesException {
  91.       return this.field_0.getUserNameObject();
  92.    }
  93.  
  94.    public String toString() {
  95.       return this.field_0.toString();
  96.    }
  97.  
  98.    public DateRange createDateRange() throws NotesException {
  99.       return this.field_0.createDateRange();
  100.    }
  101.  
  102.    public DateRange createDateRange(DateTime var1, DateTime var2) throws NotesException {
  103.       return this.field_0.createDateRange(var1, var2);
  104.    }
  105.  
  106.    public DateTime createDateTime(String var1) throws NotesException {
  107.       return this.field_0.createDateTime(var1);
  108.    }
  109.  
  110.    public Log createLog(String var1) throws NotesException {
  111.       return this.field_0.createLog(var1);
  112.    }
  113.  
  114.    public Name createName(String var1) throws NotesException {
  115.       return this.field_0.createName(var1);
  116.    }
  117.  
  118.    public Newsletter createNewsletter(DocumentCollection var1) throws NotesException {
  119.       return this.field_0.createNewsletter(var1);
  120.    }
  121.  
  122.    public Registration createRegistration() throws NotesException {
  123.       return this.field_0.createRegistration();
  124.    }
  125.  
  126.    public RichTextStyle createRichTextStyle() throws NotesException {
  127.       return this.field_0.createRichTextStyle();
  128.    }
  129.  
  130.    public Vector evaluate(String var1) throws NotesException {
  131.       return this.field_0.evaluate(var1);
  132.    }
  133.  
  134.    public Vector evaluate(String var1, Document var2) throws NotesException {
  135.       return this.field_0.evaluate(var1, var2);
  136.    }
  137.  
  138.    public Vector freeTimeSearch(DateRange var1, int var2, Object var3, boolean var4) throws NotesException {
  139.       return this.field_0.freeTimeSearch(var1, var2, var3, var4);
  140.    }
  141.  
  142.    public Database getDatabase(String var1, String var2) throws NotesException {
  143.       return this.field_0.getDatabase(var1, var2);
  144.    }
  145.  
  146.    public DbDirectory getDbDirectory(String var1) throws NotesException {
  147.       return this.field_0.getDbDirectory(var1);
  148.    }
  149.  
  150.    public String getEnvironmentString(String var1) throws NotesException {
  151.       return this.field_0.getEnvironmentString(var1);
  152.    }
  153.  
  154.    public String getEnvironmentString(String var1, boolean var2) throws NotesException {
  155.       return this.field_0.getEnvironmentString(var1, var2);
  156.    }
  157.  
  158.    public Object getEnvironmentValue(String var1) throws NotesException {
  159.       return this.field_0.getEnvironmentValue(var1);
  160.    }
  161.  
  162.    public Object getEnvironmentValue(String var1, boolean var2) throws NotesException {
  163.       return this.field_0.getEnvironmentValue(var1, var2);
  164.    }
  165.  
  166.    public Database getURLDatabase() throws NotesException {
  167.       return this.field_0.getURLDatabase();
  168.    }
  169.  
  170.    public void setEnvironmentVar(String var1, Object var2) throws NotesException {
  171.       this.field_0.setEnvironmentVar(var1, var2);
  172.    }
  173.  
  174.    public void setEnvironmentVar(String var1, Object var2, boolean var3) throws NotesException {
  175.       this.field_0.setEnvironmentVar(var1, var2, var3);
  176.    }
  177.  
  178.    private void dumpAgentContext(Session var1, AgentContext var2) throws NotesException {
  179.       try {
  180.          Database var3 = var1.getDatabase("", dumpAgentContextFile);
  181.          if (!var3.isOpen()) {
  182.             throw new NotesException("AgentContext database not found");
  183.          } else {
  184.             this.doc = var3.createDocument();
  185.             this.doc.appendItemValue("Form", "AgentContext");
  186.             new DebugAgentContext(var1, var2, this.doc);
  187.             this.doc.save();
  188.             this.doc.computeWithForm(false, false);
  189.             this.doc.save();
  190.             System.out.println("AgentContext dumped to file " + dumpAgentContextFile);
  191.          }
  192.       } catch (Exception var4) {
  193.          ((Throwable)var4).printStackTrace();
  194.       }
  195.    }
  196.  
  197.    private void dumpAgentContext(Session var1, AgentContext var2, String var3) throws NotesException {
  198.       try {
  199.          Database var4 = var1.getDatabase("", dumpAgentContextFile);
  200.          if (!var4.isOpen()) {
  201.             throw new NotesException("AgentContext database not found");
  202.          } else {
  203.             this.doc = var4.createDocument();
  204.             this.doc.appendItemValue("Form", "AgentContext");
  205.             this.doc.appendItemValue("ClassName", var3);
  206.             new DebugAgentContext(var1, var2, this.doc);
  207.             this.doc.save();
  208.             this.doc.computeWithForm(false, false);
  209.             this.doc.save();
  210.             System.out.println("AgentContext dumped to file " + dumpAgentContextFile);
  211.          }
  212.       } catch (Exception var5) {
  213.          ((Throwable)var5).printStackTrace();
  214.       }
  215.    }
  216.  
  217.    void stampAgentContextDoc() throws NotesException {
  218.       try {
  219.          DateTime var1 = this.field_0.createDateTime("");
  220.          var1.setNow();
  221.          this.doc.removeItem("LastRun");
  222.          this.doc.appendItemValue("LastRun", var1);
  223.          this.doc.save();
  224.       } catch (Exception var2) {
  225.          ((Throwable)var2).printStackTrace();
  226.       }
  227.    }
  228. }
  229.