extraAdvertisedServiceIds config is now a list of strings, rather than a comma separated string

This commit is contained in:
Shams Asari
2017-02-21 13:57:09 +00:00
parent 33717259bd
commit 7181b697a3
13 changed files with 16 additions and 16 deletions

View File

@ -147,7 +147,9 @@ Corda will now exit...""")
}
private fun printPluginsAndServices(node: Node) {
node.configuration.extraAdvertisedServiceIds.let { if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it) }
node.configuration.extraAdvertisedServiceIds.let {
if (it.isNotEmpty()) printBasicNodeInfo("Providing network services", it.joinToString())
}
val plugins = node.pluginRegistries
.map { it.javaClass.name }
.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") }

View File

@ -352,7 +352,7 @@ open class DriverDSL(
"myLegalName" to name,
"artemisAddress" to messagingAddress.toString(),
"webAddress" to apiAddress.toString(),
"extraAdvertisedServiceIds" to advertisedServices.joinToString(","),
"extraAdvertisedServiceIds" to advertisedServices.map { it.toString() },
"networkMapService" to mapOf(
"address" to networkMapAddress.toString(),
"legalName" to networkMapLegalName
@ -463,7 +463,6 @@ open class DriverDSL(
// node port numbers to be shifted, so all demos and docs need to be updated accordingly.
"webAddress" to apiAddress,
"artemisAddress" to networkMapAddress.toString(),
"extraAdvertisedServiceIds" to "",
"useTestClock" to useTestClock
)
)

View File

@ -69,7 +69,7 @@ class FullNodeConfiguration(override val baseDirectory: Path, val config: Config
// TODO This field is slightly redundant as artemisAddress is sufficient to hold the address of the node's MQ broker.
// Instead this should be a Boolean indicating whether that broker is an internal one started by the node or an external one
val messagingServerAddress: HostAndPort? by config.getOrElse { null }
val extraAdvertisedServiceIds: String by config
val extraAdvertisedServiceIds: List<String> = config.getListOrElse<String>("extraAdvertisedServiceIds") { emptyList() }
val useTestClock: Boolean by config.getOrElse { false }
val notaryNodeAddress: HostAndPort? by config.getOrElse { null }
val notaryClusterAddresses: List<HostAndPort> = config
@ -81,7 +81,6 @@ class FullNodeConfiguration(override val baseDirectory: Path, val config: Config
require(!useTestClock || devMode) { "Cannot use test clock outside of dev mode" }
val advertisedServices = extraAdvertisedServiceIds
.split(",")
.filter(String::isNotBlank)
.map { ServiceInfo.parse(it) }
.toMutableSet()