package org.onap.ccsdk.cds.blueprintsprocessor.nats.service
import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
+import org.onap.ccsdk.cds.blueprintsprocessor.core.BlueprintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsConnectionProperties
import org.onap.ccsdk.cds.blueprintsprocessor.nats.NatsLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.nats.TLSAuthNatsConnectionProperties
import org.onap.ccsdk.cds.blueprintsprocessor.nats.TokenAuthNatsConnectionProperties
-import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.stereotype.Service
@Service(NatsLibConstants.SERVICE_BLUEPRINT_NATS_LIB_PROPERTY)
-open class BluePrintNatsLibPropertyService(private var bluePrintPropertiesService: BluePrintPropertiesService) {
+open class BlueprintNatsLibPropertyService(private var bluePrintPropertiesService: BlueprintPropertiesService) {
- fun bluePrintNatsService(jsonNode: JsonNode): BluePrintNatsService {
+ fun bluePrintNatsService(jsonNode: JsonNode): BlueprintNatsService {
val natsConnectionProperties = natsConnectionProperties(jsonNode)
return bluePrintNatsService(natsConnectionProperties)
}
- fun bluePrintNatsService(selector: String): BluePrintNatsService {
+ fun bluePrintNatsService(selector: String): BlueprintNatsService {
val prefix = "${NatsLibConstants.PROPERTY_NATS_PREFIX}$selector"
val natsConnectionProperties = natsConnectionProperties(prefix)
return bluePrintNatsService(natsConnectionProperties)
JacksonUtils.readValue(jsonNode, TLSAuthNatsConnectionProperties::class.java)!!
}
else -> {
- throw BluePrintProcessorException("NATS type($type) not supported")
+ throw BlueprintProcessorException("NATS type($type) not supported")
}
}
}
tlsAuthNatsConnectionProperties(prefix)
}
else -> {
- throw BluePrintProcessorException("NATS type($type) not supported")
+ throw BlueprintProcessorException("NATS type($type) not supported")
}
}
}
}
fun bluePrintNatsService(natsConnectionProperties: NatsConnectionProperties):
- BluePrintNatsService {
+ BlueprintNatsService {
return when (natsConnectionProperties) {
is TokenAuthNatsConnectionProperties -> {
TokenAuthNatsService(natsConnectionProperties)
TLSAuthNatsService(natsConnectionProperties)
}
else -> {
- throw BluePrintProcessorException("couldn't get NATS service for properties $natsConnectionProperties")
+ throw BlueprintProcessorException("couldn't get NATS service for properties $natsConnectionProperties")
}
}
}