File tree 9 files changed +86
-72
lines changed
java/net/corda/schema/configuration
resources/net/corda/schema/configuration
test/kotlin/net/corda/schema/configuration/provider/impl
9 files changed +86
-72
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ private BootConfig() {
36
36
37
37
public static final String BOOT_SECRETS = "secrets" ;
38
38
39
- public static final String BOOT_STATE_MANAGER = "stateManager" ;
39
+ public static final String BOOT_STATE_MANAGER = StateManagerConfig . STATE_MANAGER ;
40
40
public static final String BOOT_STATE_MANAGER_TYPE = BOOT_STATE_MANAGER + ".type" ;
41
41
public static final String BOOT_STATE_MANAGER_DB_USER = BOOT_STATE_MANAGER + ".database.user" ;
42
42
public static final String BOOT_STATE_MANAGER_DB_PASS = BOOT_STATE_MANAGER + ".database.pass" ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ private ConfigKeys() {
14
14
public static final String FLOW_CONFIG = "corda.flow" ;
15
15
public static final String MESSAGING_CONFIG = "corda.messaging" ;
16
16
public static final String EXTERNAL_MESSAGING_CONFIG = "corda.externalMessaging" ;
17
+ public static final String STATE_MANAGER_CONFIG = "corda." + StateManagerConfig .STATE_MANAGER ;
17
18
public static final String UTXO_LEDGER_CONFIG = "corda.ledger.utxo" ;
18
19
public static final String P2P_LINK_MANAGER_CONFIG = "corda.p2p.linkManager" ;
19
20
public static final String P2P_GATEWAY_CONFIG = "corda.p2p.gateway" ;
Original file line number Diff line number Diff line change @@ -78,31 +78,4 @@ private Publisher() {
78
78
* producers to stay under this limit when publishing messages.
79
79
*/
80
80
public static final String MAX_ALLOWED_MSG_SIZE = "maxAllowedMessageSize" ;
81
-
82
- /**
83
- * State Manager Configuration for connecting to the underlying persistent storage.
84
- */
85
- public static final class StateManager {
86
- private StateManager () {
87
- }
88
-
89
- public static final String STATE_MANAGER = "stateManager" ;
90
- public static final String TYPE = STATE_MANAGER + ".type" ;
91
-
92
- // Database Values
93
- public static final String DB_PROPERTIES = STATE_MANAGER + ".database" ;
94
- public static final String JDBC_USER = DB_PROPERTIES + ".user" ;
95
- public static final String JDBC_PASS = DB_PROPERTIES + ".pass" ;
96
-
97
- public static final String JDBC_URL = DB_PROPERTIES + ".jdbc.url" ;
98
- public static final String JDBC_DRIVER = DB_PROPERTIES + ".jdbc.driver" ;
99
- public static final String JDBC_DRIVER_DIRECTORY = DB_PROPERTIES + ".jdbc.directory" ;
100
- public static final String JDBC_PERSISTENCE_UNIT_NAME = DB_PROPERTIES + ".jdbc.persistenceUnitName" ;
101
- public static final String JDBC_POOL_MAX_SIZE = DB_PROPERTIES + ".pool.maxSize" ;
102
- public static final String JDBC_POOL_MIN_SIZE = DB_PROPERTIES + ".pool.minSize" ;
103
- public static final String JDBC_POOL_IDLE_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.idleTimeoutSeconds" ;
104
- public static final String JDBC_POOL_MAX_LIFETIME_SECONDS = DB_PROPERTIES + ".pool.maxLifetimeSeconds" ;
105
- public static final String JDBC_POOL_KEEP_ALIVE_TIME_SECONDS = DB_PROPERTIES + ".pool.keepAliveTimeSeconds" ;
106
- public static final String JDBC_POOL_VALIDATION_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.validationTimeoutSeconds" ;
107
- }
108
81
}
Original file line number Diff line number Diff line change
1
+ package net .corda .schema .configuration ;
2
+
3
+ /**
4
+ * Configuration keys to access public parts of the configuration under the {@code corda.stateManager} key.
5
+ */
6
+ public final class StateManagerConfig {
7
+ private StateManagerConfig () {
8
+ }
9
+
10
+ public static final String STATE_MANAGER = "stateManager" ;
11
+
12
+ public static final String TYPE = "type" ;
13
+
14
+ // Database Configuration Values
15
+ public static final class Database {
16
+ public static final String DB_PROPERTIES = "database" ;
17
+ public static final String JDBC_USER = DB_PROPERTIES + ".user" ;
18
+ public static final String JDBC_PASS = DB_PROPERTIES + ".pass" ;
19
+
20
+ public static final String JDBC_URL = DB_PROPERTIES + ".jdbc.url" ;
21
+ public static final String JDBC_DRIVER = DB_PROPERTIES + ".jdbc.driver" ;
22
+ public static final String JDBC_DRIVER_DIRECTORY = DB_PROPERTIES + ".jdbc.directory" ;
23
+ public static final String JDBC_POOL_MAX_SIZE = DB_PROPERTIES + ".pool.maxSize" ;
24
+ public static final String JDBC_POOL_MIN_SIZE = DB_PROPERTIES + ".pool.minSize" ;
25
+ public static final String JDBC_POOL_IDLE_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.idleTimeoutSeconds" ;
26
+ public static final String JDBC_POOL_MAX_LIFETIME_SECONDS = DB_PROPERTIES + ".pool.maxLifetimeSeconds" ;
27
+ public static final String JDBC_POOL_KEEP_ALIVE_TIME_SECONDS = DB_PROPERTIES + ".pool.keepAliveTimeSeconds" ;
28
+ public static final String JDBC_POOL_VALIDATION_TIMEOUT_SECONDS = DB_PROPERTIES + ".pool.validationTimeoutSeconds" ;
29
+ }
30
+ }
Original file line number Diff line number Diff line change 109
109
"default" : 972800 ,
110
110
"minimum" : 512000 ,
111
111
"maximum" : 8388608
112
- },
113
- "stateManager" : {
114
- "description" : " Connection details for the underlying persistent storage used by the out of process State Manager." ,
115
- "type" : " object" ,
116
- "properties" : {
117
- "type" : {
118
- "description" : " The type of state manager implementation." ,
119
- "enum" : [
120
- " DATABASE"
121
- ]
122
- },
123
- "additionalProperties" : false
124
- },
125
- "$comment" : " Polymorphic state manager storage connection configuration. The valid section depends on which state manager implementation is in use." ,
126
- "allOf" : [
127
- {
128
- "if" : {
129
- "properties" : { "type" : { "const" : " DATABASE" } },
130
- "required" : [" type" ]
131
- },
132
- "then" : {
133
- "properties" : {
134
- "databaseProperties" : {
135
- "description" : " Settings to connect to the state manager database." ,
136
- "$ref" : " state-manager-db-properties.json"
137
- }
138
- },
139
- "required" : [" type" ," databaseProperties" ]
140
- }
141
- }
142
- ]
143
112
}
144
113
},
145
114
"additionalProperties" : false
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " https://json-schema.org/draft/2019-09/schema" ,
3
+ "$id" : " https://corda.r3.com/net/corda/schema/configuration/stateManager/1.0/corda.stateManager.json" ,
4
+ "title" : " Corda State Manager Configuration Schema" ,
5
+ "description" : " Configuration schema for the State Manager section. This configures the interactions of the workers with the underlying persistent storage used by the out of process State Manager." ,
6
+ "type" : " object" ,
7
+ "properties" : {
8
+ "type" : {
9
+ "description" : " The type of state manager implementation." ,
10
+ "enum" : [
11
+ " DATABASE"
12
+ ]
13
+ },
14
+ "additionalProperties" : false
15
+ },
16
+ "$comment" : " Polymorphic state manager storage connection configuration. The valid section depends on which state manager implementation is in use." ,
17
+ "allOf" : [
18
+ {
19
+ "if" : {
20
+ "properties" : {
21
+ "type" : {
22
+ "const" : " DATABASE"
23
+ }
24
+ },
25
+ "required" : [
26
+ " type"
27
+ ]
28
+ },
29
+ "then" : {
30
+ "properties" : {
31
+ "databaseProperties" : {
32
+ "description" : " Settings to connect to the State Manager Database." ,
33
+ "$ref" : " stateManager-db-properties.json"
34
+ }
35
+ },
36
+ "required" : [
37
+ " type" ,
38
+ " databaseProperties"
39
+ ]
40
+ }
41
+ }
42
+ ],
43
+ "additionalProperties" : false
44
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " https://json-schema.org/draft/2019-09/schema" ,
3
- "$id" : " https://corda.r3.com/net/corda/schema/configuration/db /1.0/corda.db .json" ,
3
+ "$id" : " https://corda.r3.com/net/corda/schema/configuration/stateManager /1.0/stateManager-db-properties .json" ,
4
4
"title" : " State Manager Database Configuration Schema" ,
5
5
"description" : " Configuration schema for the database section. Note that this configuration cannot be updated dynamically through the REST endpoint." ,
6
6
"type" : " object" ,
23
23
"type" : " object" ,
24
24
"default" : {},
25
25
"properties" : {
26
+ "url" : {
27
+ "description" : " The JDBC URL." ,
28
+ "type" : " string" ,
29
+ "default" : " jdbc:postgresql://state-manager-db:5432/state_manager"
30
+ },
26
31
"driver" : {
27
32
"description" : " The JDBC driver." ,
28
33
"type" : " string" ,
32
37
"description" : " The directory that contains the JDBC drivers." ,
33
38
"type" : " string" ,
34
39
"default" : " /opt/jdbc-driver"
35
- },
36
- "url" : {
37
- "description" : " The JDBC URL." ,
38
- "type" : " string" ,
39
- "default" : " jdbc:postgresql://state-manager-db:5432/state_manager"
40
- },
41
- "persistenceUnitName" : {
42
- "description" : " The persistent unit name." ,
43
- "type" : " string" ,
44
- "default" : " corda-state-manager"
45
40
}
46
41
},
47
42
"additionalProperties" : false
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import net.corda.schema.configuration.ConfigKeys.RECONCILIATION_CONFIG
12
12
import net.corda.schema.configuration.ConfigKeys.REST_CONFIG
13
13
import net.corda.schema.configuration.ConfigKeys.SANDBOX_CONFIG
14
14
import net.corda.schema.configuration.ConfigKeys.SECRETS_CONFIG
15
+ import net.corda.schema.configuration.ConfigKeys.STATE_MANAGER_CONFIG
15
16
import net.corda.schema.configuration.ConfigKeys.UTXO_LEDGER_CONFIG
16
17
import net.corda.schema.configuration.provider.ConfigSchemaException
17
18
import net.corda.v5.base.versioning.Version
@@ -42,6 +43,7 @@ class SchemaProviderConfigImplTest {
42
43
SANDBOX_CONFIG ,
43
44
RECONCILIATION_CONFIG ,
44
45
MEMBERSHIP_CONFIG ,
46
+ STATE_MANAGER_CONFIG
45
47
)
46
48
private val VERSIONS = listOf (" 1.0" )
47
49
@@ -99,4 +101,4 @@ class SchemaProviderConfigImplTest {
99
101
provider.getSchemaFile(BAD_SCHEMA_FILE )
100
102
}
101
103
}
102
- }
104
+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0
9
9
# NOTE: update this each time this module contains a breaking change
10
10
# # NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
11
11
# # a per module property in which case module versions can change independently.
12
- cordaApiRevision = 30
12
+ cordaApiRevision = 31
13
13
14
14
# Main
15
15
kotlinVersion = 1.8.21
You can’t perform that action at this time.
0 commit comments