[java-centralized-discovery COMMIT] /branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Mar 13 10:48:01 GMT 2012
Author: rdw
Date: Tue Mar 13 10:48:00 2012
New Revision: 2211
URL: http://svn.shibboleth.net/view/java-centralized-discovery?rev=2211&view=rev
Log:
Desk check - tidy code/comments/log messages
Modified:
branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet.java
Modified: branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet.java
URL: http://svn.shibboleth.net/view/java-centralized-discovery/branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet.java?rev=2211&r1=2210&r2=2211&view=diff
==============================================================================
--- branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet.java (original)
+++ branches/REL_1/src/main/java/edu/internet2/middleware/shibboleth/wayf/IdPSiteSet.java Tue Mar 13 10:48:00 2012
@@ -104,7 +104,7 @@
private static final Logger LOG = LoggerFactory.getLogger(IdPSiteSet.class.getName());
/**
- * Time for the HTTP loading. This is one of initialized as needed.
+ * Time for the HTTP loading. This is one-off initialized as needed.
*/
private static Timer timer;
@@ -166,7 +166,7 @@
provider = buildHTTPProvider(element, url);
}
} catch (MetadataProviderException e) {
- throw new ShibbolethConfigurationException("could not read " + location, e);
+ throw new ShibbolethConfigurationException("Could not read " + location, e);
} catch (MalformedURLException e) {
throw new ShibbolethConfigurationException("Error configuring " + identifier + ": badly formed url ", e);
}
@@ -213,11 +213,11 @@
private float getRefreshDelayFactor(Element config) {
float delayFactor = 0.75f;
- if (config.hasAttributeNS(null, "refreshDelayFactor")) {
- String factorString = config.getAttributeNS(null, "refreshDelayFactor");
+ if (config.hasAttribute("refreshDelayFactor")) {
+ String factorString = config.getAttribute("refreshDelayFactor");
try {
delayFactor = Float.parseFloat(factorString);
- } catch (IllegalArgumentException e) {
+ } catch (NumberFormatException e) {
LOG.error("Metadata provider '{}' had invalid refreshDelayFactor value '{}', using default value",
identifier, factorString);
}
@@ -310,7 +310,6 @@
*/
private HttpClient buildHttpClient(Element config, URL metadataURL) {
HttpClientBuilder builder = new HttpClientBuilder();
-
int requestTimeout = 5000;
String timeoutString = DatatypeHelper.safeTrimOrNullString(config.getAttribute("requestTimeout"));
String delayString = DatatypeHelper.safeTrimOrNullString(config.getAttribute("timeout"));
@@ -400,8 +399,8 @@
}
LOG.debug("Metadata provider '{}' HTTP proxy host: {}", identifier, proxyHost);
builder.setProxyHost(proxyHost);
+
String proxyPort = DatatypeHelper.safeTrimOrNullString(config.getAttribute("proxyPort"));
-
if (null != proxyPort) {
int port = Integer.parseInt(proxyPort);
LOG.debug("Metadata provider '{}' HTTP proxy port: ", identifier, proxyPort);
@@ -460,7 +459,8 @@
return new FileBackedHTTPMetadataProvider(getTimer(), buildHttpClient(element, metadataURL), location,
spoolSpace);
} catch (MetadataProviderException e) {
- throw new ShibbolethConfigurationException("Error configuring " + identifier);
+ throw new ShibbolethConfigurationException("Error accessing metadataprovider from " + identifier + " at "
+ + location);
}
}
More information about the commits
mailing list