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

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