Class SecurityConfig
- java.lang.Object
-
- com.elastisys.autoscaler.metricstreamers.influxdb.config.SecurityConfig
-
public class SecurityConfig extends java.lang.ObjectDescribes security settings needed on the client to connect with the InfluxDB server.- See Also:
InfluxdbMetricStreamerConfig
-
-
Constructor Summary
Constructors Constructor Description SecurityConfig(java.lang.Boolean https, com.elastisys.scale.commons.net.ssl.BasicCredentials auth, java.lang.Boolean verifyCert, java.lang.Boolean verifyHost)Creates aSecurityConfig.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)com.elastisys.scale.commons.net.ssl.BasicCredentialsgetAuth()Basic (username/password) credentials to use if the InfluxDB server requires user authentication.inthashCode()booleanshouldVerifyCert()Set totrueto enable server certificate verification on SSL connections.booleanshouldVerifyHost()Enables/disables hostname verification during SSL handshakes.java.lang.StringtoString()booleanuseHttps()If the InfluxDB server runs with HTTPS enabled, this option istrue.voidvalidate()Validates the configuration.
-
-
-
Constructor Detail
-
SecurityConfig
public SecurityConfig(java.lang.Boolean https, com.elastisys.scale.commons.net.ssl.BasicCredentials auth, java.lang.Boolean verifyCert, java.lang.Boolean verifyHost)Creates aSecurityConfig.- Parameters:
https- If the InfluxDB server runs with HTTPS enabled, this option istrue. A value offalseornullmeans that the server runs plain HTTP.auth- Basic (username/password) credentials to use if the InfluxDB server requires user authentication. May benull, indicating no client authentication.verifyCert- Set totrueto enable server certificate verification on SSL connections. If disabled, the server peer will not be verified, which is similar to using the--insecureflag incurl. This option is only relevant when the server runs HTTPS.verifyHost- Enables/disables hostname verification during SSL handshakes. If verification is enabled, the SSL handshake will only succeed if the URL's hostname and the server's identification hostname match. This option is only relevant when the server runs HTTPS.
-
-
Method Detail
-
useHttps
public boolean useHttps()
If the InfluxDB server runs with HTTPS enabled, this option istrue. A value offalsemeans that the server runs plain HTTP.- Returns:
-
getAuth
public com.elastisys.scale.commons.net.ssl.BasicCredentials getAuth()
Basic (username/password) credentials to use if the InfluxDB server requires user authentication. May benull, indicating no client authentication.- Returns:
-
shouldVerifyCert
public boolean shouldVerifyCert()
Set totrueto enable server certificate verification on SSL connections. If disabled, the server peer will not be verified, which is similar to using the--insecureflag incurl. This option is only relevant when the server runs HTTPS.- Returns:
-
shouldVerifyHost
public boolean shouldVerifyHost()
Enables/disables hostname verification during SSL handshakes. If verification is enabled, the SSL handshaeake will only succeed if the URL's hostname and the server's identification hostname match. This option is only relevant when the server runs HTTPS.- Returns:
-
validate
public void validate() throws java.lang.IllegalArgumentExceptionValidates the configuration. Throws anIllegalArgumentExceptionif validation fails.- Throws:
java.lang.IllegalArgumentException
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-