mirror of
https://github.com/corda/corda.git
synced 2025-01-24 05:18:24 +00:00
Change public constant values to Kotlin constants (#1588)
* Make string constants into Kotlin constants * Add JvmName annotation to KeyStoreUtilities
This commit is contained in:
parent
c108637df6
commit
c05e482c8f
@ -30,7 +30,7 @@ import java.util.*
|
|||||||
@CordaSerializable
|
@CordaSerializable
|
||||||
class CompositeKey private constructor(val threshold: Int, children: List<NodeAndWeight>) : PublicKey {
|
class CompositeKey private constructor(val threshold: Int, children: List<NodeAndWeight>) : PublicKey {
|
||||||
companion object {
|
companion object {
|
||||||
val KEY_ALGORITHM = "COMPOSITE"
|
const val KEY_ALGORITHM = "COMPOSITE"
|
||||||
/**
|
/**
|
||||||
* Build a composite key from a DER encoded form.
|
* Build a composite key from a DER encoded form.
|
||||||
*/
|
*/
|
||||||
|
@ -10,7 +10,7 @@ import net.corda.finance.contracts.FixOf
|
|||||||
import java.math.BigDecimal
|
import java.math.BigDecimal
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
val UNIVERSAL_PROGRAM_ID = "net.corda.finance.contracts.universal.UniversalContract"
|
const val UNIVERSAL_PROGRAM_ID = "net.corda.finance.contracts.universal.UniversalContract"
|
||||||
|
|
||||||
class UniversalContract : Contract {
|
class UniversalContract : Contract {
|
||||||
data class State(override val participants: List<AbstractParty>,
|
data class State(override val participants: List<AbstractParty>,
|
||||||
|
@ -25,7 +25,7 @@ import kotlin.concurrent.withLock
|
|||||||
class CashSelectionH2Impl : CashSelection {
|
class CashSelectionH2Impl : CashSelection {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val JDBC_DRIVER_NAME = "H2 JDBC Driver"
|
const val JDBC_DRIVER_NAME = "H2 JDBC Driver"
|
||||||
val log = loggerFor<CashSelectionH2Impl>()
|
val log = loggerFor<CashSelectionH2Impl>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import java.util.*
|
|||||||
class CashSelectionMySQLImpl : CashSelection {
|
class CashSelectionMySQLImpl : CashSelection {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val JDBC_DRIVER_NAME = "MySQL JDBC Driver"
|
const val JDBC_DRIVER_NAME = "MySQL JDBC Driver"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isCompatible(metadata: DatabaseMetaData): Boolean {
|
override fun isCompatible(metadata: DatabaseMetaData): Boolean {
|
||||||
|
@ -8,11 +8,11 @@ import org.apache.activemq.artemis.api.core.client.ClientMessage
|
|||||||
import org.apache.activemq.artemis.reader.MessageUtil
|
import org.apache.activemq.artemis.reader.MessageUtil
|
||||||
|
|
||||||
object VerifierApi {
|
object VerifierApi {
|
||||||
val VERIFIER_USERNAME = "SystemUsers/Verifier"
|
const val VERIFIER_USERNAME = "SystemUsers/Verifier"
|
||||||
val VERIFICATION_REQUESTS_QUEUE_NAME = "verifier.requests"
|
const val VERIFICATION_REQUESTS_QUEUE_NAME = "verifier.requests"
|
||||||
val VERIFICATION_RESPONSES_QUEUE_NAME_PREFIX = "verifier.responses"
|
const val VERIFICATION_RESPONSES_QUEUE_NAME_PREFIX = "verifier.responses"
|
||||||
private val VERIFICATION_ID_FIELD_NAME = "id"
|
private const val VERIFICATION_ID_FIELD_NAME = "id"
|
||||||
private val RESULT_EXCEPTION_FIELD_NAME = "result-exception"
|
private const val RESULT_EXCEPTION_FIELD_NAME = "result-exception"
|
||||||
|
|
||||||
data class VerificationRequest(
|
data class VerificationRequest(
|
||||||
val verificationId: Long,
|
val verificationId: Long,
|
||||||
|
@ -18,9 +18,9 @@ import net.corda.nodeapi.internal.serialization.carpenter.Field as CarpenterFiel
|
|||||||
import net.corda.nodeapi.internal.serialization.carpenter.Schema as CarpenterSchema
|
import net.corda.nodeapi.internal.serialization.carpenter.Schema as CarpenterSchema
|
||||||
|
|
||||||
// TODO: get an assigned number as per AMQP spec
|
// TODO: get an assigned number as per AMQP spec
|
||||||
val DESCRIPTOR_TOP_32BITS: Long = 0xc0da0000
|
const val DESCRIPTOR_TOP_32BITS: Long = 0xc0da0000
|
||||||
|
|
||||||
val DESCRIPTOR_DOMAIN: String = "net.corda"
|
const val DESCRIPTOR_DOMAIN: String = "net.corda"
|
||||||
|
|
||||||
// "corda" + majorVersionByte + minorVersionMSB + minorVersionLSB
|
// "corda" + majorVersionByte + minorVersionMSB + minorVersionLSB
|
||||||
val AmqpHeaderV1_0: OpaqueBytes = OpaqueBytes("corda\u0001\u0000\u0000".toByteArray())
|
val AmqpHeaderV1_0: OpaqueBytes = OpaqueBytes("corda\u0001\u0000\u0000".toByteArray())
|
||||||
|
@ -62,15 +62,15 @@ interface NetworkMapService {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val DEFAULT_EXPIRATION_PERIOD: Period = Period.ofWeeks(4)
|
val DEFAULT_EXPIRATION_PERIOD: Period = Period.ofWeeks(4)
|
||||||
val FETCH_TOPIC = "platform.network_map.fetch"
|
const val FETCH_TOPIC = "platform.network_map.fetch"
|
||||||
val QUERY_TOPIC = "platform.network_map.query"
|
const val QUERY_TOPIC = "platform.network_map.query"
|
||||||
val REGISTER_TOPIC = "platform.network_map.register"
|
const val REGISTER_TOPIC = "platform.network_map.register"
|
||||||
val SUBSCRIPTION_TOPIC = "platform.network_map.subscribe"
|
const val SUBSCRIPTION_TOPIC = "platform.network_map.subscribe"
|
||||||
// Base topic used when pushing out updates to the network map. Consumed, for example, by the map cache.
|
// Base topic used when pushing out updates to the network map. Consumed, for example, by the map cache.
|
||||||
// When subscribing to these updates, remember they must be acknowledged
|
// When subscribing to these updates, remember they must be acknowledged
|
||||||
val PUSH_TOPIC = "platform.network_map.push"
|
const val PUSH_TOPIC = "platform.network_map.push"
|
||||||
// Base topic for messages acknowledging pushed updates
|
// Base topic for messages acknowledging pushed updates
|
||||||
val PUSH_ACK_TOPIC = "platform.network_map.push_ack"
|
const val PUSH_ACK_TOPIC = "platform.network_map.push_ack"
|
||||||
|
|
||||||
val type = ServiceType.networkMap
|
val type = ServiceType.networkMap
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
@file:JvmName("KeyStoreUtilities")
|
||||||
|
|
||||||
package net.corda.node.utilities
|
package net.corda.node.utilities
|
||||||
|
|
||||||
import net.corda.core.crypto.Crypto
|
import net.corda.core.crypto.Crypto
|
||||||
@ -14,7 +16,7 @@ import java.security.cert.Certificate
|
|||||||
import java.security.cert.CertificateFactory
|
import java.security.cert.CertificateFactory
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
|
|
||||||
val KEYSTORE_TYPE = "JKS"
|
const val KEYSTORE_TYPE = "JKS"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to either open an existing keystore for modification, or create a new blank keystore.
|
* Helper method to either open an existing keystore for modification, or create a new blank keystore.
|
||||||
|
@ -44,12 +44,12 @@ object X509Utilities {
|
|||||||
val DEFAULT_TLS_SIGNATURE_SCHEME = Crypto.ECDSA_SECP256R1_SHA256
|
val DEFAULT_TLS_SIGNATURE_SCHEME = Crypto.ECDSA_SECP256R1_SHA256
|
||||||
|
|
||||||
// Aliases for private keys and certificates.
|
// Aliases for private keys and certificates.
|
||||||
val CORDA_ROOT_CA = "cordarootca"
|
const val CORDA_ROOT_CA = "cordarootca"
|
||||||
val CORDA_INTERMEDIATE_CA = "cordaintermediateca"
|
const val CORDA_INTERMEDIATE_CA = "cordaintermediateca"
|
||||||
val CORDA_CLIENT_TLS = "cordaclienttls"
|
const val CORDA_CLIENT_TLS = "cordaclienttls"
|
||||||
val CORDA_CLIENT_CA = "cordaclientca"
|
const val CORDA_CLIENT_CA = "cordaclientca"
|
||||||
|
|
||||||
val CORDA_CLIENT_CA_CN = "Corda Client CA Certificate"
|
const val CORDA_CLIENT_CA_CN = "Corda Client CA Certificate"
|
||||||
|
|
||||||
private val DEFAULT_VALIDITY_WINDOW = Pair(0.millis, 3650.days)
|
private val DEFAULT_VALIDITY_WINDOW = Pair(0.millis, 3650.days)
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +50,7 @@ class InMemoryMessagingNetwork(
|
|||||||
private val messagesInFlight: ReusableLatch = ReusableLatch()
|
private val messagesInFlight: ReusableLatch = ReusableLatch()
|
||||||
) : SingletonSerializeAsToken() {
|
) : SingletonSerializeAsToken() {
|
||||||
companion object {
|
companion object {
|
||||||
val MESSAGES_LOG_NAME = "messages"
|
const val MESSAGES_LOG_NAME = "messages"
|
||||||
private val log = LoggerFactory.getLogger(MESSAGES_LOG_NAME)
|
private val log = LoggerFactory.getLogger(MESSAGES_LOG_NAME)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user