mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
Address PR 379 comments
This commit is contained in:
@ -1,17 +1,19 @@
|
||||
package net.corda.node
|
||||
package net.corda.nodeapi
|
||||
|
||||
import com.google.common.net.HostAndPort
|
||||
import net.corda.config.SSLConfiguration
|
||||
import net.corda.nodeapi.config.SSLConfiguration
|
||||
import org.apache.activemq.artemis.api.core.TransportConfiguration
|
||||
import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory
|
||||
import org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory
|
||||
import org.apache.activemq.artemis.core.remoting.impl.netty.TransportConstants
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Path
|
||||
|
||||
sealed class ConnectionDirection {
|
||||
object Inbound : ConnectionDirection()
|
||||
class Outbound(val expectedCommonName: String? = null) : ConnectionDirection()
|
||||
class Inbound(val acceptorFactoryClassName: String) : ConnectionDirection()
|
||||
class Outbound(
|
||||
val expectedCommonName: String? = null,
|
||||
val connectorFactoryClassName: String = NettyConnectorFactory::class.java.name
|
||||
) : ConnectionDirection()
|
||||
}
|
||||
|
||||
class ArtemisTcpTransport {
|
||||
@ -35,8 +37,6 @@ class ArtemisTcpTransport {
|
||||
direction: ConnectionDirection,
|
||||
hostAndPort: HostAndPort,
|
||||
config: SSLConfiguration?,
|
||||
acceptorFactoryClassName: String = NettyAcceptorFactory::class.java.name,
|
||||
connectorFactoryClassName: String = NettyConnectorFactory::class.java.name,
|
||||
enableSSL: Boolean = true
|
||||
): TransportConfiguration {
|
||||
val options = mutableMapOf<String, Any?>(
|
||||
@ -72,8 +72,8 @@ class ArtemisTcpTransport {
|
||||
options.putAll(tlsOptions)
|
||||
}
|
||||
val factoryName = when (direction) {
|
||||
is ConnectionDirection.Inbound -> acceptorFactoryClassName
|
||||
is ConnectionDirection.Outbound -> connectorFactoryClassName
|
||||
is ConnectionDirection.Inbound -> direction.acceptorFactoryClassName
|
||||
is ConnectionDirection.Outbound -> direction.connectorFactoryClassName
|
||||
}
|
||||
return TransportConfiguration(factoryName, options)
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
package net.corda.config
|
||||
package net.corda.nodeapi.config
|
||||
|
||||
import com.google.common.net.HostAndPort
|
||||
import com.typesafe.config.Config
|
||||
import java.net.URL
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import java.time.Instant
|
@ -1,4 +1,4 @@
|
||||
package net.corda.config
|
||||
package net.corda.nodeapi.config
|
||||
|
||||
import net.corda.core.div
|
||||
import java.nio.file.Path
|
Reference in New Issue
Block a user