From: <jko...@hy...> - 2009-12-12 19:13:44
|
Author: jkonicki Date: 2009-12-10 11:01:22 -0800 (Thu, 10 Dec 2009) New Revision: 14064 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14064 Modified: trunk/plugins/netservices/src/org/hyperic/hq/plugin/netservices/NetServicesCollector.java Log: HHQ-3569 No longer require the password to be specified. If the password is null, setting it to empty string. Modified: trunk/plugins/netservices/src/org/hyperic/hq/plugin/netservices/NetServicesCollector.java =================================================================== --- trunk/plugins/netservices/src/org/hyperic/hq/plugin/netservices/NetServicesCollector.java 2009-12-10 18:59:26 UTC (rev 14063) +++ trunk/plugins/netservices/src/org/hyperic/hq/plugin/netservices/NetServicesCollector.java 2009-12-10 19:01:22 UTC (rev 14064) @@ -36,6 +36,8 @@ import javax.net.ssl.SSLSocket; import javax.net.ssl.X509TrustManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hyperic.hq.product.Collector; import org.hyperic.hq.product.PluginException; import org.hyperic.sigar.NetConnection; @@ -46,6 +48,8 @@ public abstract class NetServicesCollector extends Collector { + private static Log log = LogFactory.getLog(NetServicesCollector.class); + private int port = -1; private int defaultPort, defaultSSLPort; private boolean isSSL, enableNetstat; @@ -124,7 +128,10 @@ throw new PluginException("Missing " + PROP_USERNAME); } if (this.pass == null) { - throw new PluginException("Missing " + PROP_PASSWORD); + if (log.isDebugEnabled()){ + log.debug("Password was null, setting to empty string."); + } + this.pass = ""; } } @@ -189,6 +196,10 @@ return this.user; } + /** + * @return The password specified. If no password was specified in the + * properties, an empty string is returned. + */ public String getPassword() { return this.pass; } |