[Webfunds-commits] java/webfunds/sox/value SSDStore.java

Ian Grigg iang@cypherpunks.ai
Wed, 11 Apr 2001 15:36:23 -0400 (AST)


iang        01/04/11 15:36:23

  Modified:    webfunds/sox/value SSDStore.java
  Log:
  use the actual SSD name to start the SmartServer

Revision  Changes    Path
1.2       +11 -4     java/webfunds/sox/value/SSDStore.java

Index: SSDStore.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/value/SSDStore.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SSDStore.java	2001/04/06 22:51:45	1.1
+++ SSDStore.java	2001/04/11 19:36:23	1.2
@@ -1,5 +1,5 @@
 /*
- * $Id: SSDStore.java,v 1.1 2001/04/06 22:51:45 iang Exp $
+ * $Id: SSDStore.java,v 1.2 2001/04/11 19:36:23 iang Exp $
  *
  * Copyright (c) 1995-2000 Systemics Inc. on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -97,9 +97,10 @@
             throw new SOXServerException(SOXServerException.NO_CONTRACT,
                                          "cannot point to server " +
                                          "without contract for " + id);
-        logmsg("Obtained contract: " + con);
         String[] locs = SSDFields.getLocation(con);
         String name = SSDFields.getName(con);
+        logmsg("Obtained contract: " + con +
+               " uses " + name + " (" + locs.length + " urls)");
 
         SSD ssd;
         try {
@@ -109,8 +110,14 @@
         }
 
         if (ssd == null)
-            throw new SOXServerException("none found for " + name);
+            throw new SOXServerException("no SSD '" + name + "' for " + con);
 
+        String realname = ssd.getName();
+        if (!name.equals(realname))
+            logmsg("warning:  contract's name " + name +
+                   " is not correct for SSD " + realname +
+                   "\nWho knows whether this is the right thing to do?!?");
+
         Certificate cert;
         try {
             cert = con.getServerCert();
@@ -120,7 +127,7 @@
                                          con + "\n" + ex);
         }
 
-        Server server = new SmartServer(name, (DirSSDStore)this,
+        Server server = new SmartServer(realname, (DirSSDStore)this,
                                         cert, comms, getDebug());
         return server;
     }