[Webfunds-commits] java/webfunds/sox BasicAgent.java SimpleIssuer.java SmartIssuer.java CommsAgent.java HttpAgent.java SOXAgentConnectException.java SOXAgentException.java SOXAgentReplyException.java SOXAgentURLException.java

Ian Grigg iang@cypherpunks.ai
Tue, 20 Mar 2001 19:07:37 -0400 (AST)


iang        01/03/20 19:07:37

  Modified:    webfunds/sox BasicAgent.java SimpleIssuer.java
                        SmartIssuer.java
  Removed:     webfunds/sox CommsAgent.java HttpAgent.java
                        SOXAgentConnectException.java
                        SOXAgentException.java SOXAgentReplyException.java
                        SOXAgentURLException.java
  Log:
  moved all straight COMMS into webfunds.comms in preparation for CommsManager

Revision  Changes    Path
1.15      +9 -9      java/webfunds/sox/BasicAgent.java

Index: BasicAgent.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/BasicAgent.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- BasicAgent.java	2000/08/31 14:17:14	1.14
+++ BasicAgent.java	2001/03/20 23:07:35	1.15
@@ -1,5 +1,5 @@
 /*
- * $Id: BasicAgent.java,v 1.14 2000/08/31 14:17:14 iang Exp $
+ * $Id: BasicAgent.java,v 1.15 2001/03/20 23:07:35 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -12,6 +12,8 @@
 
 import webfunds.utils.Debug;
 
+import webfunds.comms.*;
+
 /**
  * Instances of this class are used to perform basic requests.
  * BasicAgent provides a technology-independant interface.
@@ -64,15 +66,13 @@
         byte[] replyData;
         try {
             replyData = comms.request(brp.encode());
-        } catch (SOXAgentConnectException ex) {
+        } catch (AgentConnectException ex) {
             throw new SOXLaterException(ex.getNumber(), "SOXAconnectE: " + ex);
-        } catch (SOXAgentReplyException ex) {
-            int errno = ex.getNumber();
-            if (errno == SOXException.LATER_DOWN)
-                throw new SOXLaterException(errno, "SOXAreplyE: " + ex);
-            else
-                throw new SOXPacketException(errno, "SOXAreplyE: " + ex);
-        } catch (SOXAgentURLException ex) {
+        } catch (AgentLaterException ex) {
+            throw new SOXLaterException(ex.getNumber(), "SOXALaterE: " + ex);
+        } catch (AgentReplyException ex) {
+            throw new SOXPacketException(ex.getNumber(), "SOXAreplyE: " + ex);
+        } catch (AgentURLException ex) {
             throw new SOXIssuerException(ex.getNumber(), "SOXurlE: " + ex);
         }
         BasicReplyPacket reply = new BasicReplyPacket(replyData);



1.21      +5 -3      java/webfunds/sox/SimpleIssuer.java

Index: SimpleIssuer.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/SimpleIssuer.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- SimpleIssuer.java	2000/11/30 21:01:33	1.20
+++ SimpleIssuer.java	2001/03/20 23:07:36	1.21
@@ -1,5 +1,5 @@
 /*
- * $Id: SimpleIssuer.java,v 1.20 2000/11/30 21:01:33 gelderen Exp $
+ * $Id: SimpleIssuer.java,v 1.21 2001/03/20 23:07:36 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -11,10 +11,12 @@
 import java.security.cert.Certificate;
 import java.util.Date;
 
-import webfunds.utils.Debug;
-
 import cryptix.openpgp.*;
 import cryptix.openpgp.util.PGPArmoury;
+
+import webfunds.utils.Debug;
+
+import webfunds.comms.*;
 
 /**
  * This class is a "SOX Agent" that passes basic requests to the Issuer.



1.17      +5 -7      java/webfunds/sox/SmartIssuer.java

Index: SmartIssuer.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/SmartIssuer.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- SmartIssuer.java	2000/10/14 01:46:54	1.16
+++ SmartIssuer.java	2001/03/20 23:07:37	1.17
@@ -1,5 +1,5 @@
 /*
- * $Id: SmartIssuer.java,v 1.16 2000/10/14 01:46:54 iang Exp $
+ * $Id: SmartIssuer.java,v 1.17 2001/03/20 23:07:37 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -7,7 +7,6 @@
 package webfunds.sox;
 
 import java.io.PrintWriter;
-// import java.io.Serializable;
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.security.cert.Certificate;
@@ -15,10 +14,9 @@
 import java.util.Vector;
 
 import webfunds.utils.Debug;
-import webfunds.utils.RawHttp;
-import webfunds.utils.RawConnectException;
-import webfunds.utils.RawURLException;
 
+import webfunds.comms.*;
+
 /**
  *  Pretend to be a single SOX Server "Issuer", but actually manage through
  *  a list of equivalent entry points into the same virtual server.
@@ -123,8 +121,8 @@
             URL url = (URL)urls.elementAt(which % siz);
             logmsg("new Simple at " + url);
 
-            HttpAgent http = new HttpAgent(url, true, getDebug());
-            SimpleIssuer simp = new SimpleIssuer(""+i, cert, http, getDebug());
+            CommsAgent comms = new HttpSocketAgent(url, getDebug());
+            SimpleIssuer simp = new SimpleIssuer(""+i, cert, comms, getDebug());
 
             servers[i] = simp;
         }