[Webfunds-commits] java/webfunds/ricardian DirSOXStore.java

Ian Grigg iang@cypherpunks.ai
Fri, 6 Apr 2001 18:41:07 -0400 (AST)


iang        01/04/06 18:41:07

  Modified:    webfunds/ricardian DirSOXStore.java
  Log:
  short term fix up to use CommsManager
  (this module deprecated by webfunds.sox.server.SSDStore)

Revision  Changes    Path
1.16      +22 -6     java/webfunds/ricardian/DirSOXStore.java

Index: DirSOXStore.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/ricardian/DirSOXStore.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DirSOXStore.java	2001/03/27 01:41:13	1.15
+++ DirSOXStore.java	2001/04/06 22:41:06	1.16
@@ -1,5 +1,5 @@
 /*
- * $Id: DirSOXStore.java,v 1.15 2001/03/27 01:41:13 iang Exp $
+ * $Id: DirSOXStore.java,v 1.16 2001/04/06 22:41:06 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -17,13 +17,17 @@
 import java.net.URL;
 import java.net.MalformedURLException;
 
+import webfunds.utils.Debug;
+
+import webfunds.comms.CommsManager;
+
 import webfunds.sox.Issuer;
 import webfunds.sox.SOXIssuerException;
 import webfunds.sox.SOXLaterException;
 import webfunds.sox.ItemId;
-import webfunds.utils.Debug;
 
 
+
 /**
  * A Store for SOXServers.
  * Provides access to SOXServer files, and caches the ones it gets.
@@ -54,6 +58,12 @@
 
     protected String postfix = "     Ss: ";
 
+    /**
+     *  Only way we are allowed onto the net is via this CommsManager.
+     */
+    protected CommsManager comms = null;
+    public void setCommsManager(CommsManager comms)   { this.comms = comms; }
+
 
 
 
@@ -204,12 +214,15 @@
 ////////  Main Caller Access ////////////////////////////////////
 
     /**
-     * Request an Issuer for contract.
-     * @return the issuer that handles the contract
+     *  Request an Issuer for contract.
+     *  This is not quite an IssuerFinder as it doesn't do it for an ItemId.
+     *  @return the issuer that handles the contract
      */
     public Issuer getIssuer(Contract contract)
         throws SOXIssuerException, SOXLaterException
     {
+        if (comms == null)
+            throw new SOXIssuerException("no CommsManager");
 
         logmsg("Issuer requested: " + contract.getName());
         SOXServer sox;
@@ -220,7 +233,7 @@
                                          "\n" + ex);
         }
         // logmsg("Issuer from: " + sox.getName());
-        Issuer is = sox.getIssuer(contract);
+        Issuer is = sox.getIssuer(contract, comms);
         return is ;
     }
 
@@ -362,6 +375,9 @@
     protected SOXServer getSOXServerFromNet(String[] urls)
         throws SOXServerException, SOXLaterException
     {
+        // only used locally I think
+        if (comms == null)
+            throw new SOXServerException("no CommsManager?");
 
         SOXServer sox;
 
@@ -382,7 +398,7 @@
             if (url == null)
                 continue ;
 
-            sox = SOXServer.getInstance(url, getDebug());
+            sox = SOXServer.getInstance(url, comms, getDebug());
             if (sox != null)
                 return sox ;
             // might want to keep searching here, if we are refreshing