[CORDA-1089]: Correctly display an error message on node startup if RPC settings are invalid (#2592)

* [CORDA-1089]: Correctly produce an error message on node startup if rpc options are invalid.

* [CORDA-1089]: Made RPC settings validation only trigger if address is specified.

* [CORDA-1089]: Fixed outdated deployNodes task in build.gradle.

* [CORDA-1089]: Fixed outdated deployNodes task in build.gradle.
This commit is contained in:
Michele Sollecito
2018-02-21 17:09:13 +00:00
committed by Katelyn Baker
parent 7358e902a5
commit d97a579a2e
3 changed files with 20 additions and 8 deletions

View File

@ -164,15 +164,15 @@ data class NodeConfigurationImpl(
override fun validate(): List<String> {
val errors = mutableListOf<String>()
errors + validateRpcOptions(rpcOptions)
errors += validateRpcOptions(rpcOptions)
return errors
}
private fun validateRpcOptions(options: NodeRpcOptions): List<String> {
val errors = mutableListOf<String>()
if (!options.useSsl) {
if (options.adminAddress == null) {
errors + "'rpcSettings.adminAddress': missing. Property is mandatory when 'rpcSettings.useSsl' is false (default)."
if (options.address != null) {
if (!options.useSsl && options.adminAddress == null) {
errors += "'rpcSettings.adminAddress': missing. Property is mandatory when 'rpcSettings.useSsl' is false (default)."
}
}
return errors