summaryrefslogtreecommitdiffstats
path: root/dgbuilder/pom.xml
blob: 1deefad88a2d2eaf3e89593a4da6833040c7b39b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
            <groupId>org.onap.ccsdk.distribution</groupId>
            <artifactId>distribution-root</artifactId>
            <version>0.5.0-SNAPSHOT</version>
        </parent>

	<groupId>org.onap.ccsdk.distribution</groupId>
	<artifactId>distribution-dgbuilder</artifactId>
	<version>0.5.0-SNAPSHOT</version>
	<packaging>pom</packaging>

	<name>ccsdk-distribution :: dgbuilder</name>
	<description>Directed Graph Builder</description>
	<organization>
		<name>ONAP</name>
	</organization>

	<properties>
		<application.name>dgbuilder</application.name>
		<skip.SWM>true</skip.SWM>
		<adm.base>/opt/app/dgbuilder</adm.base>
		<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
		<build.number>${maven.build.timestamp}</build.number>
		<SWM_VERSION>${project.version}-${build.number}</SWM_VERSION>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.onap.ccsdk.sli.core</groupId>
			<artifactId>sli-common</artifactId>
			<version>${sdnctl.sli.version}</version>
		</dependency>
		<dependency>
  <groupId>org.mariadb.jdbc</groupId>
  <artifactId>mariadb-java-client</artifactId>
  <version>${mariadb.connector.version}</version>
		</dependency>
		<dependency>
			<groupId>org.antlr</groupId>
			<artifactId>antlr4</artifactId>
			<version>${antlr.version}</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.7.5</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${commons.lang3.version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>create-zip</id>
						<goals>
							<goal>single</goal>
						</goals>
						<phase>package</phase>
						<configuration>
							<finalName>${application.name}.${project.version}</finalName>
							<attach>true</attach>
							<descriptors>
								<descriptor>src/assembly/assemble_zip.xml</descriptor>
							</descriptors>
							<appendAssemblyId>false</appendAssemblyId>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<phase>prepare-package</phase>
						<configuration>
							<transitive>false</transitive>
							<outputDirectory>${project.build.directory}/svclogic/lib</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
							<useRepositoryLayout>false</useRepositoryLayout>
							<addParentPoms>false</addParentPoms>
							<copyPom>false</copyPom>
							<scope>provided</scope>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
					<phase>generate-sources</phase>
					<configuration>
					<tasks>
						<exec executable="${project.basedir}/build_pom_for_yang_compile">
							<!--<arg value="${odlparent-carbon-sr1-version}"/>-->
						</exec>
					</tasks>
					</configuration>
					<goals>
						<goal>run</goal>
				</goals>
				</execution>
			</executions>
			</plugin>
		</plugins>
	</build>
</project>
d.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * Copyright © 2018-2019 AT&T Intellectual Property.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.onap.ccsdk.cds.blueprintsprocessor.message

import com.fasterxml.jackson.databind.JsonNode
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintConstants
import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintTypes
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonType
import org.onap.ccsdk.cds.controllerblueprints.core.data.RelationshipType
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.PropertiesAssignmentBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.RelationshipTemplateBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.ServiceTemplateBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.TopologyTemplateBuilder
import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType

/** Relationships Types DSL for Message Producer */
fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageProducer() {
    val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageProducer()
    if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
    this.relationshipTypes!![relationshipType.id!!] = relationshipType
}

fun BluePrintTypes.relationshipTypeConnectsToMessageProducer(): RelationshipType {
    return relationshipType(
        id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER,
        version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
        derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
        description = "Relationship connects to through message producer."
    ) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintConstants.DATA_TYPE_MAP,
            true,
            "Connection Config details."
        )
        validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
    }
}

fun ServiceTemplateBuilder.relationshipTypeConnectsToMessageConsumer() {
    val relationshipType = BluePrintTypes.relationshipTypeConnectsToMessageConsumer()
    if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
    this.relationshipTypes!![relationshipType.id!!] = relationshipType
}

fun BluePrintTypes.relationshipTypeConnectsToMessageConsumer(): RelationshipType {
    return relationshipType(
        id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER,
        version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
        derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
        description = "Relationship type connects to message consumer."
    ) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintConstants.DATA_TYPE_MAP,
            true,
            "Connection Config details."
        )
        validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
    }
}

/** Relationships Templates DSL for Message Producer */
fun TopologyTemplateBuilder.relationshipTemplateMessageProducer(
    name: String,
    description: String,
    block: MessageProducerRelationshipTemplateBuilder.() -> Unit
) {
    if (relationshipTemplates == null) relationshipTemplates = hashMapOf()
    val relationshipTemplate =
        MessageProducerRelationshipTemplateBuilder(name, description).apply(block).build()
    relationshipTemplates!![relationshipTemplate.id!!] = relationshipTemplate
}

class MessageProducerRelationshipTemplateBuilder(name: String, description: String) :
    RelationshipTemplateBuilder(
        name,
        BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_PRODUCER, description
    ) {

    fun kafkaBasicAuth(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block)
        )
    }

    fun kafkaSslAuth(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaSslAuthMessageProducerProperties(block)
        )
    }

    fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block)
        )
    }
}

fun BluePrintTypes.kafkaBasicAuthMessageProducerProperties(block: KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaBasicAuthMessageProducerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaSslAuthMessageProducerProperties(block: KafkaSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaSslAuthMessageProducerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaScramSslAuthMessageProducerProperties(block: KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaScramSslAuthMessageProducerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

open class MessageProducerPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()

open class KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder : MessageProducerPropertiesAssignmentBuilder() {

    fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())

    fun bootstrapServers(bootstrapServers: JsonNode) =
        property(KafkaBasicAuthMessageProducerProperties::bootstrapServers, bootstrapServers)

    fun topic(topic: String) = topic(topic.asJsonPrimitive())

    fun topic(topic: JsonNode) =
        property(KafkaBasicAuthMessageProducerProperties::topic, topic)

    fun clientId(clientId: String) = bootstrapServers(clientId.asJsonPrimitive())

    fun clientId(clientId: JsonNode) =
        property(KafkaBasicAuthMessageProducerProperties::clientId, clientId)

    fun acks(acks: String) = acks(acks.asJsonPrimitive())

    fun acks(acks: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::acks, acks)

    fun maxBlockMs(maxBlockMs: Int) = maxBlockMs(maxBlockMs.asJsonPrimitive())

    fun maxBlockMs(maxBlockMs: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::maxBlockMs, maxBlockMs)

    fun reconnectBackOffMs(reconnectBackOffMs: Int) = reconnectBackOffMs(reconnectBackOffMs.asJsonPrimitive())

    fun reconnectBackOffMs(reconnectBackOffMs: JsonNode) = property(KafkaBasicAuthMessageProducerProperties::reconnectBackOffMs, reconnectBackOffMs)

    fun enableIdempotence(enableIdempotence: Boolean) = enableIdempotence(enableIdempotence.asJsonPrimitive())

    fun enableIdempotence(enableIdempotence: JsonNode) =
        property(KafkaBasicAuthMessageProducerProperties::enableIdempotence, enableIdempotence)
}

open class KafkaSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaBasicAuthMessageProducerPropertiesAssignmentBuilder() {

    fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())

    fun truststore(truststore: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::truststore, truststore)

    fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())

    fun truststorePassword(truststorePassword: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::truststorePassword, truststorePassword)

    fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())

    fun truststoreType(truststoreType: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::truststoreType, truststoreType)

    fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())

    fun keystore(keystore: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystore, keystore)

    fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())

    fun keystorePassword(keystorePassword: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)

    fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())

    fun keystoreType(keystoreType: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
        sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}

class KafkaScramSslAuthMessageProducerPropertiesAssignmentBuilder : KafkaSslAuthMessageProducerPropertiesAssignmentBuilder() {

    fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())

    fun saslMechanism(saslMechanism: JsonNode) =
        property(KafkaScramSslAuthMessageProducerProperties::saslMechanism, saslMechanism)

    fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())

    fun scramUsername(scramUsername: JsonNode) =
        property(KafkaScramSslAuthMessageProducerProperties::scramUsername, scramUsername)

    fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())

    fun scramPassword(scramPassword: JsonNode) =
        property(KafkaScramSslAuthMessageProducerProperties::scramPassword, scramPassword)
}

/** Relationships Templates DSL for Message Consumer */
fun TopologyTemplateBuilder.relationshipTemplateMessageConsumer(
    name: String,
    description: String,
    block: MessageConsumerRelationshipTemplateBuilder.() -> Unit
) {
    if (relationshipTemplates == null) relationshipTemplates = hashMapOf()
    val relationshipTemplate =
        MessageConsumerRelationshipTemplateBuilder(name, description).apply(block).build()
    relationshipTemplates!![relationshipTemplate.id!!] = relationshipTemplate
}

class MessageConsumerRelationshipTemplateBuilder(name: String, description: String) :
    RelationshipTemplateBuilder(
        name,
        BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_MESSAGE_CONSUMER, description
    ) {

    fun kafkaBasicAuth(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block)
        )
    }

    fun kafkaSslAuth(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block)
        )
    }

    fun kafkaScramSslAuth(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block)
        )
    }

    fun kafkaStreamsBasicAuth(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block)
        )
    }

    fun kafkaStreamsSslAuth(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block)
        )
    }

    fun kafkaStreamsScramSslAuth(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit) {
        property(
            BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
            BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block)
        )
    }
}

fun BluePrintTypes.kafkaBasicAuthMessageConsumerProperties(block: KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaBasicAuthMessageConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_BASIC_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaSslAuthMessageConsumerProperties(block: KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaSslAuthMessageConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaScramSslAuthMessageConsumerProperties(block: KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaScramSslAuthMessageConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_SCRAM_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaStreamsBasicAuthConsumerProperties(block: KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaStreamsBasicAuthConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_STREAMS_BASIC_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaStreamsSslAuthConsumerProperties(block: KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaStreamsSslAuthConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_STREAMS_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

fun BluePrintTypes.kafkaStreamsScramSslAuthConsumerProperties(block: KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder.() -> Unit): JsonNode {
    val assignments = KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder().apply(block).build()
    assignments[KafkaStreamsScramSslAuthConsumerProperties::type.name] =
        MessageLibConstants.TYPE_KAFKA_STREAMS_SCRAM_SSL_AUTH.asJsonPrimitive()
    return assignments.asJsonType()
}

open class MessageConsumerPropertiesAssignmentBuilder : PropertiesAssignmentBuilder()

/** KafkaBasicAuthMessageConsumerProperties assignment builder */
open class KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder : MessageConsumerPropertiesAssignmentBuilder() {

    fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())

    fun bootstrapServers(bootstrapServers: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::bootstrapServers, bootstrapServers)

    fun groupId(groupId: String) = groupId(groupId.asJsonPrimitive())

    fun groupId(groupId: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::groupId, groupId)

    fun clientId(clientId: String) = clientId(clientId.asJsonPrimitive())

    fun clientId(clientId: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::clientId, clientId)

    fun topic(topic: String) = topic(topic.asJsonPrimitive())

    fun topic(topic: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::topic, topic)

    fun autoCommit(autoCommit: Boolean) = autoCommit(autoCommit.asJsonPrimitive())

    fun autoCommit(autoCommit: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::autoCommit, autoCommit)

    fun autoOffsetReset(autoOffsetReset: String) = autoOffsetReset(autoOffsetReset.asJsonPrimitive())

    fun autoOffsetReset(autoOffsetReset: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::autoOffsetReset, autoOffsetReset)

    fun pollMillSec(pollMillSec: Int) = pollMillSec(pollMillSec.asJsonPrimitive())

    fun pollMillSec(pollMillSec: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::pollMillSec, pollMillSec)

    fun pollRecords(pollRecords: Int) = pollRecords(pollRecords.asJsonPrimitive())

    fun pollRecords(pollRecords: JsonNode) =
        property(KafkaBasicAuthMessageConsumerProperties::pollRecords, pollRecords)
}

open class KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaBasicAuthMessageConsumerPropertiesAssignmentBuilder() {

    fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())

    fun truststore(truststore: JsonNode) =
        property(KafkaSslAuthMessageConsumerProperties::truststore, truststore)

    fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())

    fun truststorePassword(truststorePassword: JsonNode) =
        property(KafkaSslAuthMessageConsumerProperties::truststorePassword, truststorePassword)

    fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())

    fun truststoreType(truststoreType: JsonNode) =
        property(KafkaSslAuthMessageConsumerProperties::truststoreType, truststoreType)

    fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())

    fun keystore(keystore: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystore, keystore)

    fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())

    fun keystorePassword(keystorePassword: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)

    fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())

    fun keystoreType(keystoreType: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
        sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
        property(KafkaSslAuthMessageConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}

class KafkaScramSslAuthMessageConsumerPropertiesAssignmentBuilder : KafkaSslAuthMessageConsumerPropertiesAssignmentBuilder() {

    fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())

    fun saslMechanism(saslMechanism: JsonNode) =
        property(KafkaScramSslAuthMessageConsumerProperties::saslMechanism, saslMechanism)

    fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())

    fun scramUsername(scramUsername: JsonNode) =
        property(KafkaScramSslAuthMessageConsumerProperties::scramUsername, scramUsername)

    fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())

    fun scramPassword(scramPassword: JsonNode) =
        property(KafkaScramSslAuthMessageConsumerProperties::scramPassword, scramPassword)
}

/** KafkaStreamsConsumerProperties assignment builder */
open class KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder : MessageConsumerPropertiesAssignmentBuilder() {

    fun bootstrapServers(bootstrapServers: String) = bootstrapServers(bootstrapServers.asJsonPrimitive())

    fun bootstrapServers(bootstrapServers: JsonNode) =
        property(KafkaStreamsBasicAuthConsumerProperties::bootstrapServers, bootstrapServers)

    fun applicationId(applicationId: String) = bootstrapServers(applicationId.asJsonPrimitive())

    fun applicationId(applicationId: JsonNode) =
        property(KafkaStreamsBasicAuthConsumerProperties::applicationId, applicationId)

    fun topic(topic: String) = topic(topic.asJsonPrimitive())

    fun topic(topic: JsonNode) =
        property(KafkaStreamsBasicAuthConsumerProperties::topic, topic)

    fun autoOffsetReset(autoOffsetReset: String) = autoOffsetReset(autoOffsetReset.asJsonPrimitive())

    fun autoOffsetReset(autoOffsetReset: JsonNode) =
        property(KafkaStreamsBasicAuthConsumerProperties::autoOffsetReset, autoOffsetReset)

    fun processingGuarantee(processingGuarantee: String) = processingGuarantee(processingGuarantee.asJsonPrimitive())

    fun processingGuarantee(processingGuarantee: JsonNode) =
        property(KafkaStreamsBasicAuthConsumerProperties::processingGuarantee, processingGuarantee)
}

open class KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsBasicAuthConsumerPropertiesAssignmentBuilder() {

    fun truststore(truststore: String) = truststore(truststore.asJsonPrimitive())

    fun truststore(truststore: JsonNode) =
        property(KafkaStreamsSslAuthConsumerProperties::truststore, truststore)

    fun truststorePassword(truststorePassword: String) = truststorePassword(truststorePassword.asJsonPrimitive())

    fun truststorePassword(truststorePassword: JsonNode) =
        property(KafkaStreamsSslAuthConsumerProperties::truststorePassword, truststorePassword)

    fun truststoreType(truststoreType: String) = truststoreType(truststoreType.asJsonPrimitive())

    fun truststoreType(truststoreType: JsonNode) =
        property(KafkaStreamsSslAuthConsumerProperties::truststoreType, truststoreType)

    fun keystore(keystore: String) = keystore(keystore.asJsonPrimitive())

    fun keystore(keystore: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystore, keystore)

    fun keystorePassword(keystorePassword: String) = keystorePassword(keystorePassword.asJsonPrimitive())

    fun keystorePassword(keystorePassword: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystorePassword, keystorePassword)

    fun keystoreType(keystoreType: String) = keystoreType(keystoreType.asJsonPrimitive())

    fun keystoreType(keystoreType: JsonNode) =
        property(KafkaSslAuthMessageProducerProperties::keystoreType, keystoreType)

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: String) =
        sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm.asJsonPrimitive())

    fun sslEndpointIdentificationAlgorithm(sslEndpointIdentificationAlgorithm: JsonNode) =
        property(KafkaStreamsSslAuthConsumerProperties::sslEndpointIdentificationAlgorithm, sslEndpointIdentificationAlgorithm)
}

class KafkaStreamsScramSslAuthConsumerPropertiesAssignmentBuilder : KafkaStreamsSslAuthConsumerPropertiesAssignmentBuilder() {

    fun saslMechanism(saslMechanism: String) = saslMechanism(saslMechanism.asJsonPrimitive())

    fun saslMechanism(saslMechanism: JsonNode) =
        property(KafkaStreamsScramSslAuthConsumerProperties::saslMechanism, saslMechanism)

    fun scramUsername(scramUsername: String) = scramUsername(scramUsername.asJsonPrimitive())

    fun scramUsername(scramUsername: JsonNode) =
        property(KafkaStreamsScramSslAuthConsumerProperties::scramUsername, scramUsername)

    fun scramPassword(scramPassword: String) = scramPassword(scramPassword.asJsonPrimitive())

    fun scramPassword(scramPassword: JsonNode) =
        property(KafkaStreamsScramSslAuthConsumerProperties::scramPassword, scramPassword)
}