Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4905 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1

Subject: perfsonar development work

List archive

perfsonar: r4905 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4905 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1
  • Date: Sun, 25 Jan 2009 23:14:55 -0500

Author: michael.bischoff
Date: 2009-01-25 23:14:55 -0500 (Sun, 25 Jan 2009)
New Revision: 4905

Modified:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/RootHintsFileDownloader.java
Log:
Added system property to override default root hint url

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/RootHintsFileDownloader.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/RootHintsFileDownloader.java
2009-01-23 15:36:51 UTC (rev 4904)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/RootHintsFileDownloader.java
2009-01-26 04:14:55 UTC (rev 4905)
@@ -19,15 +19,34 @@
import org.slf4j.LoggerFactory;

public class RootHintsFileDownloader {
- protected final Logger logger = LoggerFactory.getLogger(getClass());

+ protected final Logger logger = LoggerFactory.getLogger(getClass());
+ protected final String rootHints;

+ public RootHintsFileDownloader() {
+ String systemProperty;
+
+ try {
+ systemProperty =
System.getProperty("application.perfsonar.lsclient.rootHints");
+ if(systemProperty == null ||
systemProperty.equals("")) {
+ logger.debug("System property
\"application.perfsonar.lsclient.rootHints\" was undefined or empty");
+ systemProperty =
"http://www.perfsonar.net/gls.root.hints";;
+ }
+ } catch (SecurityException e) {
+ logger.warn("Wasn't allowed to read
\"application.perfsonar.lsclient.rootHints\" falling back to
default(http://www.perfsonar.net/gls.root.hint)");
+ systemProperty =
"http://www.perfsonar.net/gls.root.hints";;
+ }
+
+ rootHints = systemProperty;
+ logger.trace("Root hints url = '"+rootHints+"'");
+ }
+
public Set<LookupService> getGlobalLookupServices() {
logger.trace("Starting retrieval of GLS-es from root.hints");
try {
return readFrom(getRootHintUrl().openConnection());
} catch (IOException e) {
logger.error("Can't retrieve gls-es from root.hints",
e);
- return Collections.emptySet();
+ return Collections.emptySet(); //TODO
}
}

@@ -70,10 +89,10 @@

protected URL getRootHintUrl() {
try {
- return new URL("http", "www.perfsonar.net", 80,
"/gls.root.hint");
+ return new URL(rootHints);
} catch (MalformedURLException e) {
- logger.error("Programmer specified an malformed URL !
this is a bug !", e);
- throw new AssertionError("Programmer specified an
malformed URL, this is a bug.");
+ logger.error("Programmer specified an malformed
URL("+rootHints+") ! this is a bug !", e);
+ throw new AssertionError("Programmer specified an
malformed URL("+rootHints+"), this is a bug.");
}
}




  • perfsonar: r4905 - trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1, svnlog, 01/25/2009

Archive powered by MHonArc 2.6.16.

Top of Page