[Webfunds-commits] java/webfunds/sox BasicAgent.java DepositRequest.java Receipt.java SmartIssuer.java

Ian Grigg iang@cypherpunks.ai
Thu, 12 Apr 2001 00:46:03 -0400 (AST)


iang        01/04/12 00:46:03

  Modified:    webfunds/sox BasicAgent.java DepositRequest.java
                        Receipt.java SmartIssuer.java
  Log:
  cleanups, and all now use new Log() replacement for PrintWriter

Revision  Changes    Path
1.17      +4 -4      java/webfunds/sox/BasicAgent.java

Index: BasicAgent.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/BasicAgent.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- BasicAgent.java	2001/04/06 23:41:13	1.16
+++ BasicAgent.java	2001/04/12 04:46:02	1.17
@@ -1,12 +1,12 @@
 /*
- * $Id: BasicAgent.java,v 1.16 2001/04/06 23:41:13 iang Exp $
+ * $Id: BasicAgent.java,v 1.17 2001/04/12 04:46:02 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
  */
 package webfunds.sox;
 
-import java.io.PrintWriter;
+// import java.io.PrintWriter;
 import java.security.*;
 import java.security.cert.Certificate;
 
@@ -19,7 +19,7 @@
  * BasicAgent provides a technology-independant interface.
  */
 public class BasicAgent
-    extends Debug
+//    extends Debug
 {
 
 
@@ -45,12 +45,12 @@
      * Create a new BasicAgent object (with debug)
      *
      * @param comms the comms agent that sends the requests
-     */
     public BasicAgent(CommsAgent comms, PrintWriter bug)
     {
         debug(bug);
         this.comms = comms;
     }
+     */
   
     /**
      * Issue a request at the "basic" layer.



1.29      +1 -2      java/webfunds/sox/DepositRequest.java

Index: DepositRequest.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/DepositRequest.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- DepositRequest.java	2001/04/06 23:48:53	1.28
+++ DepositRequest.java	2001/04/12 04:46:02	1.29
@@ -1,5 +1,5 @@
 /*
- * $Id: DepositRequest.java,v 1.28 2001/04/06 23:48:53 iang Exp $
+ * $Id: DepositRequest.java,v 1.29 2001/04/12 04:46:02 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -13,7 +13,6 @@
 import java.io.DataOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.PrintWriter;
 
 
 /**



1.45      +7 -7      java/webfunds/sox/Receipt.java

Index: Receipt.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Receipt.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- Receipt.java	2001/04/06 23:52:40	1.44
+++ Receipt.java	2001/04/12 04:46:02	1.45
@@ -1,5 +1,5 @@
 /*
- * $Id: Receipt.java,v 1.44 2001/04/06 23:52:40 iang Exp $
+ * $Id: Receipt.java,v 1.45 2001/04/12 04:46:02 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -17,9 +17,9 @@
 import java.io.DataOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.PrintWriter;
 
-import webfunds.utils.Panic;
+import webfunds.util.Panic;
+import webfunds.util.Log;
 
 
 /**
@@ -201,11 +201,11 @@
              return timestamp * 1000 ;  // was unix time, convert to java time
     }
 
-    protected PrintWriter debug;
+    protected Log bug;
     void logmsg(String s)
     {
-        if (debug != null)
-            debug.println(s);
+        if (bug != null)
+            bug.println(s);
         else
             System.err.println(s);
     }
@@ -458,7 +458,7 @@
         throws IOException, SOXPacketException
     {
 
-        debug = new PrintWriter(System.err, true);
+        bug = new Log();
 
 	// why 2 streams?
         DataInputStream dis = new DataInputStream(is);



1.21      +6 -6      java/webfunds/sox/SmartIssuer.java

Index: SmartIssuer.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/SmartIssuer.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- SmartIssuer.java	2001/04/11 19:18:13	1.20
+++ SmartIssuer.java	2001/04/12 04:46:02	1.21
@@ -1,12 +1,11 @@
 /*
- * $Id: SmartIssuer.java,v 1.20 2001/04/11 19:18:13 iang Exp $
+ * $Id: SmartIssuer.java,v 1.21 2001/04/12 04:46:02 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
  */
 package webfunds.sox;
 
-import java.io.PrintWriter;
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.security.cert.Certificate;
@@ -15,6 +14,7 @@
 
 import webfunds.utils.Debug;
 
+import webfunds.util.Log;
 import webfunds.util.Panic;
 
 import webfunds.comms.*;
@@ -75,7 +75,7 @@
      * @param cert the [operator] certificate which signs the
      *               server's [server] certificate
      */
-    public SmartIssuer(String[] serverURLs, Certificate cert, PrintWriter bug)
+    public SmartIssuer(String[] serverURLs, Certificate cert, Log bug)
         throws SOXIssuerException
     {
         debug(bug, "        I  ");
@@ -98,7 +98,7 @@
      */
     public SmartIssuer(String[] serverURLs, Certificate cert,
                        CommsManager comms,
-                       PrintWriter bug)
+                       Log bug)
         throws SOXIssuerException
     {
         debug(bug, "        I  ");
@@ -163,8 +163,8 @@
             URL url = (URL)urls.elementAt(which % siz);
             logmsg("new Simple at " + url);
 
-            CommsAgent agent = new HttpSocketAgent(url, comms, getDebug());
-            SimpleIssuer simp = new SimpleIssuer(""+i, cert, agent, getDebug());
+            CommsAgent agent = new HttpSocketAgent(url, comms, getLog());
+            SimpleIssuer simp = new SimpleIssuer(""+i, cert, agent, getLog());
 
             servers[i] = simp;
         }