Make Node override configuration and use FullNodeConfiguration so that no casting is needed

This commit is contained in:
Andrius Dagys
2016-10-05 14:49:18 +01:00
parent fac12b4fce
commit 3b187a2171
5 changed files with 19 additions and 25 deletions

View File

@ -72,7 +72,7 @@ import kotlin.reflect.KClass
// TODO: Where this node is the initial network map service, currently no networkMapService is provided.
// In theory the NodeInfo for the node should be passed in, instead, however currently this is constructed by the
// AbstractNode. It should be possible to generate the NodeInfo outside of AbstractNode, so it can be passed in.
abstract class AbstractNode(val configuration: NodeConfiguration, val networkMapService: SingleMessageRecipient?,
abstract class AbstractNode(open val configuration: NodeConfiguration, val networkMapService: SingleMessageRecipient?,
val advertisedServices: Set<ServiceInfo>, val platformClock: Clock) : SingletonSerializeAsToken() {
companion object {
val PRIVATE_KEY_FILE_NAME = "identity-private-key"

View File

@ -9,7 +9,6 @@ import com.r3corda.core.utilities.loggerFor
import com.r3corda.node.serialization.NodeClock
import com.r3corda.node.services.api.MessagingServiceInternal
import com.r3corda.node.services.config.FullNodeConfiguration
import com.r3corda.node.services.config.NodeConfiguration
import com.r3corda.node.services.messaging.ArtemisMessagingServer
import com.r3corda.node.services.messaging.CordaRPCOps
import com.r3corda.node.services.messaging.NodeMessagingClient
@ -60,7 +59,7 @@ class ConfigurationException(message: String) : Exception(message)
* @param messagingServerAddr The address of the Artemis broker instance. If not provided the node will run one locally.
*/
class Node(val p2pAddr: HostAndPort, val webServerAddr: HostAndPort,
configuration: NodeConfiguration, networkMapAddress: SingleMessageRecipient?,
override val configuration: FullNodeConfiguration, networkMapAddress: SingleMessageRecipient?,
advertisedServices: Set<ServiceInfo>, clock: Clock = NodeClock(),
val messagingServerAddr: HostAndPort? = null) : AbstractNode(configuration, networkMapAddress, advertisedServices, clock) {
companion object {
@ -163,7 +162,7 @@ class Node(val p2pAddr: HostAndPort, val webServerAddr: HostAndPort,
val server = Server()
if (configuration is FullNodeConfiguration && configuration.useHTTPS) {
if (configuration.useHTTPS) {
val httpsConfiguration = HttpConfiguration()
httpsConfiguration.outputBufferSize = 32768
httpsConfiguration.addCustomizer(SecureRequestCustomizer())

View File

@ -11,5 +11,6 @@ dataSourceProperties = {
"dataSource.password" = ""
}
devMode = true
hostNotaryServiceLocally = false
certificateSigningService = "https://cordaci-netperm.corda.r3cev.com"
useHTTPS = false