Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / message-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / message / MessagePropertiesDSL.kt
1 /*
2  * Copyright © 2018-2019 AT&T Intellectual Property.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.ccsdk.cds.blueprintsprocessor.message
18
19 import com.fasterxml.jackson.databind.JsonNode
20 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
21 import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
22 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
23 import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
24 import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType
25 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuilder
26 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.RelationshipTemplateBuilder
27 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.ServiceTemplateBuilder
28 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.TopologyTemplateBuilder
29 import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType
30
31 /** Relationships Types DSL for Message Producer */
32 fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageProducer() {
33     val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageProducer()
34     if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
35     this.relationshipTypes!![relationshipType.id!!] = relationshipType
36 }
37
38 fun BluePrintTypes.relationshipTypeConnectsToMessageProducer(): RelationshipType {
39     return relationshipType(
40         id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER,
41         version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
42         derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
43         description = "Relationship connects to through message producer."
44     ) {
45         property(
46             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
47             BluePrintConstants.DATA_TYPE_MAP,
48             true,
49             "Connection Config details."
50         )
51         validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
52     }
53 }
54
55 fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageConsumer() {
56     val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageConsumer()
57     if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
58     this.relationshipTypes!![relationshipType.id!!] = relationshipType
59 }
60
61 fun BluePrintTypes.relationshipTypeConnectsToMessageConsumer(): RelationshipType {
62     return relationshipType(
63         id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER,
64         version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
65         derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
66         description = "Relationship type connects to message consumer."
67     ) {
68         property(
69             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
70             BluePrintConstants.DATA_TYPE_MAP,
71             true,
72             "Connection Config details."
73         )
74         validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
75     }
76 }
77
78 /** Relationships Templates DSL for Message Producer */
79 fun TopologyTemplateBuilder.relationshipTemplateMessageProducer(
80     name: String,
81     description: String,
82     block: MessageProducerRelationshipTemplateBuilder.() -> Unit
83 ) {
84     if (relationshipTemplates == null) relationshipTemplates = hashMapOf()
85     val relationshipTemplate =
86         MessageProducerRelationshipTemplateBuilder(name, description).apply(block).build()
87     relationshipTemplates!![relationshipTemplate.id!!] = relationshipTemplate
88 }
89
90 class MessageProducerRelationshipTemplateBuilder(name: String, description: String) :
91     RelationshipTemplateBuilder(
92         name,
93         BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, description
94     ) {
95
96     fun kafkaBasicAuth(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
97         property(
98             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
99             BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block)
100         )
101     }
102
103     fun kafkaSslAuth(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
104         property(
105             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
106             BluePrintTypes.kafkaSslAuthMessageProducerProperties(block)
107         )
108     }
109
110     fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
111         property(
112             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
113             BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block)
114         )
115     }
116 }
117
118 fun BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
119     val assignments = KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
120     assignments[KafkaBasicAuthMessageProducerProperties::type.name] =
121         MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive()
122     return assignments.asJsonType()
123 }
124
125 fun BluePrintTypes.kafkaSslAuthMessageProducerProperties(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
126     val assignments = KafkaSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
127     assignments[KafkaSslAuthMessageProducerProperties::type.name] =
128         MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
129     return assignments.asJsonType()
130 }
131
132 fun BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
133     val assignments = KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
134     assignments[KafkaScramSslAuthMessageProducerProperties::type.name] =
135         MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
136     return assignments.asJsonType()
137 }
138
139 open class MessageProducerPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()
140
141 open class KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder : MessageProducerPropertiesAssignmentBuilder() {
142
143     fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())
144
145     fun bootstrapServers(bootstrapServers: JsonNode) =
146         property(KafkaBasicAuthMessageProducerProperties::bootstrapServers, bootstrapServers)
147
148     fun topic(topic: String) = topic(topic.asJsonPrimitive())
149
150     fun topic(topic: JsonNode) =
151         property(KafkaBasicAuthMessageProducerProperties::topic, topic)
152
153     fun clientId(clientId: String) = bootstrapServers(clientId.asJsonPrimitive())
154
155     fun clientId(clientId: JsonNode) =
156         property(KafkaBasicAuthMessageProducerProperties::clientId, clientId)
157
158     fun acks(acks: String) = acks(acks.asJsonPrimitive())
159
160     fun acks(acks: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::acks, acks)
161
162     fun maxBlockMs(maxBlockMs: Int) = maxBlockMs(maxBlockMs.asJsonPrimitive())
163
164     fun maxBlockMs(maxBlockMs: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::maxBlockMs, maxBlockMs)
165
166     fun reconnectBackOffMs(reconnectBackOffMs: Int) = reconnectBackOffMs(reconnectBackOffMs.asJsonPrimitive())
167
168     fun reconnectBackOffMs(reconnectBackOffMs: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::reconnectBackOffMs, reconnectBackOffMs)
169
170     fun enableIdempotence(enableIdempotence: Boolean) = enableIdempotence(enableIdempotence.asJsonPrimitive())
171
172     fun enableIdempotence(enableIdempotence: JsonNode) =
173         property(KafkaBasicAuthMessageProducerProperties::enableIdempotence, enableIdempotence)
174 }
175
176 open class KafkaSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder() {
177
178     fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
179
180     fun truststore(truststore: JsonNode) =
181         property(KafkaSslAuthMessageProducerProperties::truststore, truststore)
182
183     fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
184
185     fun truststorePassword(truststorePassword: JsonNode) =
186         property(KafkaSslAuthMessageProducerProperties::truststorePassword, truststorePassword)
187
188     fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
189
190     fun truststoreType(truststoreType: JsonNode) =
191         property(KafkaSslAuthMessageProducerProperties::truststoreType, truststoreType)
192
193     fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
194
195     fun keystore(keystore: JsonNode) =
196         property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
197
198     fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
199
200     fun keystorePassword(keystorePassword: JsonNode) =
201         property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
202
203     fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
204
205     fun keystoreType(keystoreType: JsonNode) =
206         property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
207
208     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
209         sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
210
211     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
212         property(KafkaSslAuthMessageProducerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
213 }
214
215 class KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaSslAuthMessageProducerPropertiesAssignmentBuilder() {
216
217     fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
218
219     fun saslMechanism(saslMechanism: JsonNode) =
220         property(KafkaScramSslAuthMessageProducerProperties::saslMechanism, saslMechanism)
221
222     fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
223
224     fun scramUsername(scramUsername: JsonNode) =
225         property(KafkaScramSslAuthMessageProducerProperties::scramUsername, scramUsername)
226
227     fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
228
229     fun scramPassword(scramPassword: JsonNode) =
230         property(KafkaScramSslAuthMessageProducerProperties::scramPassword, scramPassword)
231 }
232
233 /** Relationships Templates DSL for Message Consumer */
234 fun TopologyTemplateBuilder.relationshipTemplateMessageConsumer(
235     name: String,
236     description: String,
237     block: MessageConsumerRelationshipTemplateBuilder.() -> Unit
238 ) {
239     if (relationshipTemplates == null) relationshipTemplates = hashMapOf()
240     val relationshipTemplate =
241         MessageConsumerRelationshipTemplateBuilder(name, description).apply(block).build()
242     relationshipTemplates!![relationshipTemplate.id!!] = relationshipTemplate
243 }
244
245 class MessageConsumerRelationshipTemplateBuilder(name: String, description: String) :
246     RelationshipTemplateBuilder(
247         name,
248         BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, description
249     ) {
250
251     fun kafkaBasicAuth(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
252         property(
253             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
254             BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block)
255         )
256     }
257
258     fun kafkaSslAuth(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
259         property(
260             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
261             BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block)
262         )
263     }
264
265     fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
266         property(
267             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
268             BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block)
269         )
270     }
271
272     fun kafkaStreamsBasicAuth(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
273         property(
274             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
275             BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block)
276         )
277     }
278
279     fun kafkaStreamsSslAuth(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
280         property(
281             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
282             BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block)
283         )
284     }
285
286     fun kafkaStreamsScramSslAuth(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
287         property(
288             BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
289             BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block)
290         )
291     }
292 }
293
294 fun BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
295     val assignments = KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
296     assignments[KafkaBasicAuthMessageConsumerProperties::type.name] =
297         MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive()
298     return assignments.asJsonType()
299 }
300
301 fun BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
302     val assignments = KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
303     assignments[KafkaSslAuthMessageConsumerProperties::type.name] =
304         MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
305     return assignments.asJsonType()
306 }
307
308 fun BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
309     val assignments = KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
310     assignments[KafkaScramSslAuthMessageConsumerProperties::type.name] =
311         MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
312     return assignments.asJsonType()
313 }
314
315 fun BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
316     val assignments = KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
317     assignments[KafkaStreamsBasicAuthConsumerProperties::type.name] =
318         MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH.asJsonPrimitive()
319     return assignments.asJsonType()
320 }
321
322 fun BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
323     val assignments = KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
324     assignments[KafkaStreamsSslAuthConsumerProperties::type.name] =
325         MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH.asJsonPrimitive()
326     return assignments.asJsonType()
327 }
328
329 fun BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
330     val assignments = KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
331     assignments[KafkaStreamsScramSslAuthConsumerProperties::type.name] =
332         MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH.asJsonPrimitive()
333     return assignments.asJsonType()
334 }
335
336 open class MessageConsumerPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()
337
338 /** KafkaBasicAuthMessageConsumerProperties assignment builder */
339 open class KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder : MessageConsumerPropertiesAssignmentBuilder() {
340
341     fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())
342
343     fun bootstrapServers(bootstrapServers: JsonNode) =
344         property(KafkaBasicAuthMessageConsumerProperties::bootstrapServers, bootstrapServers)
345
346     fun groupId(groupId: String) = groupId(groupId.asJsonPrimitive())
347
348     fun groupId(groupId: JsonNode) =
349         property(KafkaBasicAuthMessageConsumerProperties::groupId, groupId)
350
351     fun clientId(clientId: String) = clientId(clientId.asJsonPrimitive())
352
353     fun clientId(clientId: JsonNode) =
354         property(KafkaBasicAuthMessageConsumerProperties::clientId, clientId)
355
356     fun topic(topic: String) = topic(topic.asJsonPrimitive())
357
358     fun topic(topic: JsonNode) =
359         property(KafkaBasicAuthMessageConsumerProperties::topic, topic)
360
361     fun autoCommit(autoCommit: Boolean) = autoCommit(autoCommit.asJsonPrimitive())
362
363     fun autoCommit(autoCommit: JsonNode) =
364         property(KafkaBasicAuthMessageConsumerProperties::autoCommit, autoCommit)
365
366     fun autoOffsetReset(autoOffsetReset: String) = autoOffsetReset(autoOffsetReset.asJsonPrimitive())
367
368     fun autoOffsetReset(autoOffsetReset: JsonNode) =
369         property(KafkaBasicAuthMessageConsumerProperties::autoOffsetReset, autoOffsetReset)
370
371     fun pollMillSec(pollMillSec: Int) = pollMillSec(pollMillSec.asJsonPrimitive())
372
373     fun pollMillSec(pollMillSec: JsonNode) =
374         property(KafkaBasicAuthMessageConsumerProperties::pollMillSec, pollMillSec)
375
376     fun pollRecords(pollRecords: Int) = pollRecords(pollRecords.asJsonPrimitive())
377
378     fun pollRecords(pollRecords: JsonNode) =
379         property(KafkaBasicAuthMessageConsumerProperties::pollRecords, pollRecords)
380 }
381
382 open class KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder() {
383
384     fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
385
386     fun truststore(truststore: JsonNode) =
387         property(KafkaSslAuthMessageConsumerProperties::truststore, truststore)
388
389     fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
390
391     fun truststorePassword(truststorePassword: JsonNode) =
392         property(KafkaSslAuthMessageConsumerProperties::truststorePassword, truststorePassword)
393
394     fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
395
396     fun truststoreType(truststoreType: JsonNode) =
397         property(KafkaSslAuthMessageConsumerProperties::truststoreType, truststoreType)
398
399     fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
400
401     fun keystore(keystore: JsonNode) =
402         property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
403
404     fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
405
406     fun keystorePassword(keystorePassword: JsonNode) =
407         property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
408
409     fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
410
411     fun keystoreType(keystoreType: JsonNode) =
412         property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
413
414     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
415         sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
416
417     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
418         property(KafkaSslAuthMessageConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
419 }
420
421 class KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder() {
422
423     fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
424
425     fun saslMechanism(saslMechanism: JsonNode) =
426         property(KafkaScramSslAuthMessageConsumerProperties::saslMechanism, saslMechanism)
427
428     fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
429
430     fun scramUsername(scramUsername: JsonNode) =
431         property(KafkaScramSslAuthMessageConsumerProperties::scramUsername, scramUsername)
432
433     fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
434
435     fun scramPassword(scramPassword: JsonNode) =
436         property(KafkaScramSslAuthMessageConsumerProperties::scramPassword, scramPassword)
437 }
438
439 /** KafkaStreamsConsumerProperties assignment builder */
440 open class KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder : MessageConsumerPropertiesAssignmentBuilder() {
441
442     fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())
443
444     fun bootstrapServers(bootstrapServers: JsonNode) =
445         property(KafkaStreamsBasicAuthConsumerProperties::bootstrapServers, bootstrapServers)
446
447     fun applicationId(applicationId: String) = bootstrapServers(applicationId.asJsonPrimitive())
448
449     fun applicationId(applicationId: JsonNode) =
450         property(KafkaStreamsBasicAuthConsumerProperties::applicationId, applicationId)
451
452     fun topic(topic: String) = topic(topic.asJsonPrimitive())
453
454     fun topic(topic: JsonNode) =
455         property(KafkaStreamsBasicAuthConsumerProperties::topic, topic)
456
457     fun autoOffsetReset(autoOffsetReset: String) = autoOffsetReset(autoOffsetReset.asJsonPrimitive())
458
459     fun autoOffsetReset(autoOffsetReset: JsonNode) =
460         property(KafkaStreamsBasicAuthConsumerProperties::autoOffsetReset, autoOffsetReset)
461
462     fun processingGuarantee(processingGuarantee: String) = processingGuarantee(processingGuarantee.asJsonPrimitive())
463
464     fun processingGuarantee(processingGuarantee: JsonNode) =
465         property(KafkaStreamsBasicAuthConsumerProperties::processingGuarantee, processingGuarantee)
466 }
467
468 open class KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder() {
469
470     fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())
471
472     fun truststore(truststore: JsonNode) =
473         property(KafkaStreamsSslAuthConsumerProperties::truststore, truststore)
474
475     fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())
476
477     fun truststorePassword(truststorePassword: JsonNode) =
478         property(KafkaStreamsSslAuthConsumerProperties::truststorePassword, truststorePassword)
479
480     fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())
481
482     fun truststoreType(truststoreType: JsonNode) =
483         property(KafkaStreamsSslAuthConsumerProperties::truststoreType, truststoreType)
484
485     fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())
486
487     fun keystore(keystore: JsonNode) =
488         property(KafkaSslAuthMessageProducerProperties::keystore, keystore)
489
490     fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())
491
492     fun keystorePassword(keystorePassword: JsonNode) =
493         property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)
494
495     fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())
496
497     fun keystoreType(keystoreType: JsonNode) =
498         property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)
499
500     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
501         sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())
502
503     fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
504         property(KafkaStreamsSslAuthConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
505 }
506
507 class KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder() {
508
509     fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())
510
511     fun saslMechanism(saslMechanism: JsonNode) =
512         property(KafkaStreamsScramSslAuthConsumerProperties::saslMechanism, saslMechanism)
513
514     fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())
515
516     fun scramUsername(scramUsername: JsonNode) =
517         property(KafkaStreamsScramSslAuthConsumerProperties::scramUsername, scramUsername)
518
519     fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())
520
521     fun scramPassword(scramPassword: JsonNode) =
522         property(KafkaStreamsScramSslAuthConsumerProperties::scramPassword, scramPassword)
523 }