if (DEBUG) { System.out.println( "opened query connection = "+ myConnection.toString());
InputStream is; try { is = myConnection.getInputStream(); } catch (ConnectionException ce) {  try { Thread.sleep(5000); } catch (InterruptedException ie) { } try { is = myConnection.getInputStream(); } catch (ConnectionException anotherCE) {  throw new RuntimeException( "Unable to contact host "+myURL+": "+ anotherCE); anotherCE.printStackTrace(); }
  private void getChildrenRelationships(      PrintStream out,      MyPSPState myState)  {    Vector urls = new Vector();    Vector names = new Vector();    myState.psc.getAllURLsAndNames(urls, names);    if (myState.htmlFlag) {      if (!myState.suppressFlag) {        out.println("<HTML><BODY>");       }      if (myState.unexpandedHtmlFlag) {        out.println(          "<P>The following are the Clusters in this society.  Select on");        out.println(" Cluster to drill-down and inspect Cluster");        out.println(" relationships. Note that all requests are proxied by");        out.println(" the LPS to which you are conversing <B>(");        out.println(myState.clusterID);        out.println(").</B></P>");        out.println(          "<TABLE align=center border=1 cellPadding=1 cellSpacing=1");        out.println(          "width=75% bordercolordark=#660000 bordercolorlight=#cc9966>");      }    }    int sz = urls.size();    for (int i = 0; i < sz; i++) {      String u = (String)urls.elementAt(i);      String n = (String)names.elementAt(i);      if (DEBUG) {        System.out.println(          "Attempting to OPEN PSP_ClusterRelationship Child URL("+ u +")");      }      try {        // EXPANDED HTML        if (!myState.unexpandedHtmlFlag) {          // yuck -- this PSP calling other PSPs!          //          // would rather have PSPs come in two types:          //   1) logplan access with no outside connections          //   2) no logplan access with outside connections (i.e. PSPs)          // i.e. this PSP split into two PSPs, a (1) and a (2).          //          // this.getPath() => resource path of this PSP...          //          URL myURL = new URL(u+myState.psp_path+"?MODE=2?SUPPRESS?HTML");          if (DEBUG) {            System.out.println(              "[PSP_ClusterRelationships] child URL: " + myURL.toString());          }          URLConnection myConnection = myURL.openConnection();          if (DEBUG) {            System.out.println(              "opened query connection = "+ myConnection.toString());          }          InputStream is = myConnection.getInputStream();          BufferedInputStream bis = new BufferedInputStream(is);          byte buf[] = new byte[512];          int sz2;          while ((sz2 = bis.read(buf,0,512)) != -1) {            out.write(buf,0,sz2);          }        } else {          // UNEXPANDED HTML          out.println("<TR>");          //          // Request will come back thru this LPS and get redirected using "$"          //          out.println(            "<TD><A HREF=\"/$"+n+myState.psp_path+"?MODE=2?HTML\""+            ">" + n + "</A></TD>");          out.println("</TR>");        }      } catch (Exception e) {        e.printStackTrace();      }    } // for()    if (myState.htmlFlag) {      if (myState.unexpandedHtmlFlag) {         out.println("</TABLE>");        }      if (!myState.suppressFlag) {        out.println("</BODY></HTML>");       }    }  }