Changeset 2178
- Timestamp:
- 2001-03-14T15:15:38+13:00 (23 years ago)
- Location:
- trunk/java-client/org/nzdl/gsdl
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/java-client/org/nzdl/gsdl/SimpleClient.java
r2148 r2178 111 111 */ 112 112 protected SimpleClient() { 113 nzdl = NzdlIORs.findIOR(null, URLFromCommandLine, 114 IORFileName, IORFromCommandLine); 113 nzdl = NzdlIORs.createNzdlService(null, 114 System.getProperties(), 115 URLFromCommandLine, 116 IORFileName, 117 IORFromCommandLine); 115 118 if (nzdl == null) 116 119 throw new Error("URK! unable to find an IOR..."); … … 123 126 SimpleClient(String [] args) { 124 127 parseArgs(args); 125 nzdl = NzdlIORs.findIOR(args, URLFromCommandLine, 126 IORFileName, IORFromCommandLine); 128 nzdl = NzdlIORs.createNzdlService(args, 129 System.getProperties(), 130 URLFromCommandLine, 131 IORFileName, 132 IORFromCommandLine); 127 133 if (nzdl == null) 128 134 throw new Error("URK! unable to find an IOR..."); -
trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/SimpleGraphicalClient.java
r2159 r2178 95 95 */ 96 96 void init(String [] args) { 97 nzdl = NzdlIORs.findIOR(null, null, 98 IORFileName, IORFromCommandLine); 97 nzdl = NzdlIORs.createNzdlService(args, 98 System.getProperties(), 99 null, 100 IORFileName, 101 IORFromCommandLine); 99 102 if (nzdl == null) 100 103 throw new Error("URK! unable to find an IOR..."); -
trunk/java-client/org/nzdl/gsdl/service/Makefile
r2157 r2178 25 25 NzdlLogWrapper.class \ 26 26 NzdlDocSaveWrapper.class \ 27 NzdlMultiWayWrapper.class \ 27 28 NzdlCacheWrapper.class 28 29 -
trunk/java-client/org/nzdl/gsdl/service/NzdlCollectionInfo.java
r2163 r2178 69 69 */ 70 70 public String getHTTPPrefix() { 71 return NzdlCorbaFactory.toString( m_Info.httpprefix) ; 71 //return m_Info.httpprefix.text.toString(); 72 return NzdlCorbaFactory.toString( m_Info.httpprefix ) ; 72 73 } 73 74 … … 76 77 */ 77 78 public String getHTTPDomain() { 78 return NzdlCorbaFactory.toString( m_Info.httpdomain) ; 79 return NzdlCorbaFactory.toString( m_Info.httpdomain ) ; 80 } 81 82 /** 83 * Returns reseptionist 84 */ 85 public String getReceptionist() { 86 return NzdlCorbaFactory.toString( m_Info.receptionist ) ; 79 87 } 80 88 -
trunk/java-client/org/nzdl/gsdl/service/NzdlWrapper.java
r2157 r2178 51 51 */ 52 52 public NzdlWrapper(NzdlService service) { 53 if (service == null)54 throw new Error("null service");55 53 this.service = service; 56 54 } -
trunk/java-client/org/nzdl/gsdl/util/NzdlCorbaFactory.java
r2163 r2178 59 59 return text.toString(); 60 60 } 61 61 62 62 63 public static corbaComErrorHolder createComErrorHolder() { -
trunk/java-client/org/nzdl/gsdl/util/NzdlIORs.java
r2163 r2178 44 44 import java.util.Set; 45 45 import java.util.Vector; 46 import java.util.Hashtable; 46 47 47 48 // local libraries … … 56 57 import org.nzdl.gsdl.service.NzdlLogWrapper; 57 58 import org.nzdl.gsdl.service.NzdlDocSaveWrapper; 59 import org.nzdl.gsdl.service.NzdlMultiWayWrapper; 58 60 59 61 /** … … 108 110 /** Are we saving documents ? */ 109 111 static public boolean saveDocs = true; 112 /** Are we trying for multiple servers ? */ 113 static public boolean doMultiple = true; 110 114 111 115 /** … … 194 198 */ 195 199 public static NzdlService findIOR(String [] _args, 200 Properties _props, 196 201 String _URL, 197 202 String _filename, … … 235 240 } 236 241 return client; 242 } 243 244 /** 245 * Connect for as many servers as possible 246 * @param _args the command line arguments 247 * @param _URL a URL to look for an IOR in 248 * @param _filename a local filename to look for an IOR in 249 * @param _IOR a string to look for an IOR in 250 * @see org.omg.CORBA.ORB 251 */ 252 public static Hashtable findIORs(String [] _args, 253 Properties _props, 254 String _URL, 255 String _filename, 256 String _IOR) { 257 // the object we're filling ... 258 Hashtable result = new Hashtable(); 259 260 // read our prevously seed IORs ... 261 String IOR = null; 262 NzdlService client = null; 263 264 // try a URL from the command line 265 if ( _URL != null) { 266 IOR = NzdlIORs.getIORfromURL(_URL); 267 client = attemptToInitialise(_args, null, IOR); 268 if (client != null) 269 result.put(IOR,client); 270 } 271 272 // try an IOR from the command line 273 if (_IOR != null) { 274 IOR = NzdlIORs.registerIOR(_IOR); 275 client = attemptToInitialise(_args, null, IOR); 276 if (client != null) 277 result.put(IOR,client); 278 } 279 280 // try an IOR from a file (the filename may have been 281 // given from the commandline 282 283 IOR = NzdlIORs.getIORfromFile(_filename); 284 client = attemptToInitialise(_args, null, IOR); 285 if (client != null) 286 result.put(IOR,client); 287 288 289 // try the compiled-in URLs 290 for (int i=0;( i<urlsCompiledIn.length && client == null );i++) { 291 IOR = NzdlIORs.getIORfromURL(urlsCompiledIn[i]); 292 client = attemptToInitialise(_args, null,IOR); 293 if (client != null) 294 result.put(IOR,client); 295 } 296 297 // the knownIORs is the last resort 298 IOR = NzdlIORs.getFirstValid(); 299 client = attemptToInitialise(_args, null, IOR); 300 if (client != null) 301 result.put(IOR,client); 302 303 return result; 237 304 } 238 305 … … 328 395 String ior = null; 329 396 if (file == null || file.equals("")) 330 return "";397 file = IORFileName; 331 398 file = file.trim(); 332 399 try { … … 395 462 return null; 396 463 } 464 return nzdl; 465 } 466 467 static public NzdlService createNzdlService(String [] _args, 468 Properties _props, 469 String _URL, 470 String _filename, 471 String _IOR) { 472 if (_props == null) 473 _props = System.getProperties(); 474 475 NzdlService nzdl = null; 476 477 if (doMultiple) 478 nzdl = new NzdlMultiWayWrapper(_args,_props,_URL,_filename,_IOR); 479 else 480 nzdl = findIOR(_args,_props,_URL,_filename,_IOR); 481 397 482 if (saveDocs) 398 483 nzdl = new NzdlDocSaveWrapper(nzdl); 399 484 400 485 if (logAfter) 401 486 nzdl = new NzdlLogWrapper(nzdl, "log.file.after.cache", "AFTER: "); 402 487 403 488 if (caching) 404 489 nzdl = new NzdlCacheWrapper(nzdl); … … 406 491 if (logBefore) 407 492 nzdl = new NzdlLogWrapper(nzdl, "log.file.before.cache", "BEFORE: "); 493 408 494 return nzdl; 409 495 } 410 496 411 497 /** 412 498 * Write the System properties to a file called "System.properties" in
Note:
See TracChangeset
for help on using the changeset viewer.