Move Jackson client support into net.corda.client.jackson package

Move Jackson client support into net.corda.client.jackson package to match naming scheme used elsewhere
This commit is contained in:
Ross Nicoll 2017-08-25 15:12:45 +01:00
parent 923fe16392
commit a9f572c366
15 changed files with 25 additions and 20 deletions

View File

@ -1,4 +1,4 @@
package net.corda.jackson
package net.corda.client.jackson
import com.fasterxml.jackson.annotation.JsonIgnore
import com.fasterxml.jackson.annotation.JsonProperty

View File

@ -1,11 +1,11 @@
package net.corda.jackson
package net.corda.client.jackson
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory
import com.google.common.collect.HashMultimap
import com.google.common.collect.Multimap
import net.corda.jackson.StringToMethodCallParser.ParsedMethodCall
import net.corda.client.jackson.StringToMethodCallParser.ParsedMethodCall
import org.slf4j.LoggerFactory
import java.lang.reflect.Constructor
import java.lang.reflect.Method
@ -223,4 +223,4 @@ open class StringToMethodCallParser<in T : Any> @JvmOverloads constructor(
Pair(name, argStr)
}.toMap()
}
}
}

View File

@ -1,4 +1,4 @@
package net.corda.jackson
package net.corda.client.jackson
import com.fasterxml.jackson.databind.SerializationFeature
import net.corda.core.contracts.Amount

View File

@ -1,4 +1,4 @@
package net.corda.jackson
package net.corda.client.jackson
import net.corda.core.crypto.SecureHash
import org.junit.Assert.assertArrayEquals
@ -65,4 +65,4 @@ class StringToMethodCallParserTest {
val args: Array<Any?> = parser.parseArguments(clazz.name, names.zip(ctor.parameterTypes), "alternativeWord: Foo bar!")
assertArrayEquals(args, arrayOf<Any?>("Foo bar!"))
}
}
}

View File

@ -1,3 +1,8 @@
# Package net.corda.finance.utils
A collection of utilities for summing financial states, for example, summing obligations to get total debts.
A collection of utilities for summing financial states, for example, summing obligations to get total debts.
# Package net.corda.client.jackson
Utilities and serialisers for working with JSON representations of basic types. This adds Jackson support for
the java.time API, some core types, and Kotlin data classes.

View File

@ -1,7 +1,7 @@
package net.corda.node.shell;
import net.corda.core.messaging.*;
import net.corda.jackson.*;
import net.corda.client.jackson.*;
import org.crsh.cli.*;
import org.crsh.command.*;

View File

@ -21,8 +21,8 @@ import net.corda.core.internal.*
import net.corda.core.messaging.CordaRPCOps
import net.corda.core.messaging.StateMachineUpdate
import net.corda.core.utilities.loggerFor
import net.corda.jackson.JacksonSupport
import net.corda.jackson.StringToMethodCallParser
import net.corda.client.jackson.JacksonSupport
import net.corda.client.jackson.StringToMethodCallParser
import net.corda.node.internal.Node
import net.corda.node.services.messaging.CURRENT_RPC_CONTEXT
import net.corda.node.services.messaging.RpcContext

View File

@ -10,7 +10,7 @@ import net.corda.core.internal.FlowStateMachine
import net.corda.core.node.ServiceHub
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.UntrustworthyData
import net.corda.jackson.JacksonSupport
import net.corda.client.jackson.JacksonSupport
import net.corda.node.services.identity.InMemoryIdentityService
import net.corda.node.shell.InteractiveShell
import net.corda.testing.DUMMY_CA
@ -94,4 +94,4 @@ class InteractiveShellTest {
override fun flowStackSnapshot(flowClass: Class<out FlowLogic<*>>): FlowStackSnapshot? = null
override fun persistFlowStackSnapshot(flowClass: Class<out FlowLogic<*>>) = Unit
}
}
}

View File

@ -61,7 +61,7 @@ class IRSDemoTest : IntegrationTestCategory {
log.info("All webservers started")
val (_, nodeAApi, nodeBApi) = listOf(controller, nodeA, nodeB).zip(listOf(controllerAddr, nodeAAddr, nodeBAddr)).map {
val mapper = net.corda.jackson.JacksonSupport.createDefaultMapper(it.first.rpc)
val mapper = net.corda.client.jackson.JacksonSupport.createDefaultMapper(it.first.rpc)
registerFinanceJSONMappers(mapper)
HttpApi.fromHostAndPort(it.second, "api/irs", mapper = mapper)
}

View File

@ -20,7 +20,7 @@ import net.corda.finance.flows.TwoPartyDealFlow.Instigator
import net.corda.finance.plugin.registerFinanceJSONMappers
import net.corda.irs.contract.InterestRateSwap
import net.corda.irs.flows.FixingFlow
import net.corda.jackson.JacksonSupport
import net.corda.client.jackson.JacksonSupport
import net.corda.node.services.identity.InMemoryIdentityService
import net.corda.testing.DUMMY_CA
import net.corda.testing.node.InMemoryMessagingNetwork

View File

@ -1,6 +1,7 @@
package net.corda.testing
import co.paralleluniverse.fibers.Suspendable
import net.corda.client.jackson.JacksonSupport
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowStackSnapshot
import net.corda.core.flows.StartableByRPC
@ -10,7 +11,6 @@ import net.corda.core.internal.list
import net.corda.core.internal.read
import net.corda.core.messaging.startFlow
import net.corda.core.serialization.CordaSerializable
import net.corda.jackson.JacksonSupport
import net.corda.node.services.FlowPermissions.Companion.startFlowPermission
import net.corda.nodeapi.User
import net.corda.testing.driver.driver

View File

@ -15,7 +15,7 @@ import net.corda.core.internal.FlowStateMachine
import net.corda.core.internal.div
import net.corda.core.internal.write
import net.corda.core.serialization.SerializeAsToken
import net.corda.jackson.JacksonSupport
import net.corda.client.jackson.JacksonSupport
import net.corda.node.services.statemachine.FlowStackSnapshotFactory
import java.nio.file.Path
import java.time.Instant

View File

@ -30,7 +30,7 @@ class HttpApi(val root: URL, val mapper: ObjectMapper = defaultMapper) {
fun fromHostAndPort(hostAndPort: NetworkHostAndPort, base: String, protocol: String = "http", mapper: ObjectMapper = defaultMapper): HttpApi
= HttpApi(URL("$protocol://$hostAndPort/$base/"), mapper)
private val defaultMapper: ObjectMapper by lazy {
net.corda.jackson.JacksonSupport.createNonRpcMapper()
net.corda.client.jackson.JacksonSupport.createNonRpcMapper()
}
}
}

View File

@ -22,7 +22,7 @@ object HttpUtils {
.readTimeout(60, TimeUnit.SECONDS).build()
}
val defaultMapper: ObjectMapper by lazy {
net.corda.jackson.JacksonSupport.createNonRpcMapper()
net.corda.client.jackson.JacksonSupport.createNonRpcMapper()
}
fun putJson(url: URL, data: String): Boolean {

View File

@ -1,10 +1,10 @@
package net.corda.webserver.internal
import com.google.common.html.HtmlEscapers.htmlEscaper
import net.corda.client.jackson.JacksonSupport
import net.corda.client.rpc.CordaRPCClient
import net.corda.core.messaging.CordaRPCOps
import net.corda.core.utilities.loggerFor
import net.corda.jackson.JacksonSupport
import net.corda.nodeapi.ArtemisMessagingComponent
import net.corda.webserver.WebServerConfig
import net.corda.webserver.services.WebServerPluginRegistry