Formatting Code base with ktlint
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / dmaap-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / dmaap / BluePrintDmaapLibPropertyService.kt
index cde4987..a3eed15 100644 (file)
@@ -36,7 +36,7 @@ import org.springframework.core.env.ConfigurableEnvironment
 import org.springframework.core.env.Environment
 import org.springframework.core.io.support.ResourcePropertySource
 import org.springframework.stereotype.Service
-import java.util.*
+import java.util.Properties
 
 /**
  * Representation of DMAAP lib property service to load the properties
@@ -52,8 +52,10 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi
      * Static variable for logging.
      */
     companion object {
+
         var log = LoggerFactory.getLogger(
-                BluePrintDmaapLibPropertyService::class.java)!!
+            BluePrintDmaapLibPropertyService::class.java
+        )!!
     }
 
     /**
@@ -90,25 +92,30 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi
      */
     fun dmaapClientProperties(prefix: String): DmaapClientProperties {
         val type = bluePrintPropertiesService.propertyBeanType(
-                "$prefix.type", String::class.java)
+            "$prefix.type", String::class.java
+        )
         val clientProps: DmaapClientProperties
 
         when (type) {
             TYPE_HTTP_NO_AUTH -> {
                 clientProps = bluePrintPropertiesService.propertyBeanType(
-                        prefix, HttpNoAuthDmaapClientProperties::class.java)
+                    prefix, HttpNoAuthDmaapClientProperties::class.java
+                )
                 clientProps.props = parseEventProps()
             }
 
             TYPE_HTTP_AAF_AUTH -> {
                 clientProps = bluePrintPropertiesService.propertyBeanType(
-                        prefix, AafAuthDmaapClientProperties::class.java)
+                    prefix, AafAuthDmaapClientProperties::class.java
+                )
                 clientProps.props = parseEventProps()
             }
 
             else -> {
-                throw BluePrintProcessorException("DMAAP adaptor($type) is " +
-                        "not supported")
+                throw BluePrintProcessorException(
+                    "DMAAP adaptor($type) is " +
+                            "not supported"
+                )
             }
         }
         return clientProps
@@ -124,20 +131,26 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi
 
         when (type) {
             TYPE_HTTP_NO_AUTH -> {
-                clientProps = JacksonUtils.readValue(jsonNode,
-                        HttpNoAuthDmaapClientProperties::class.java)!!
+                clientProps = JacksonUtils.readValue(
+                    jsonNode,
+                    HttpNoAuthDmaapClientProperties::class.java
+                )!!
                 clientProps.props = parseEventProps()
             }
 
             TYPE_HTTP_AAF_AUTH -> {
-                clientProps = JacksonUtils.readValue(jsonNode,
-                        AafAuthDmaapClientProperties::class.java)!!
+                clientProps = JacksonUtils.readValue(
+                    jsonNode,
+                    AafAuthDmaapClientProperties::class.java
+                )!!
                 clientProps.props = parseEventProps()
             }
 
             else -> {
-                throw BluePrintProcessorException("DMAAP adaptor($type) is " +
-                        "not supported")
+                throw BluePrintProcessorException(
+                    "DMAAP adaptor($type) is " +
+                            "not supported"
+                )
             }
         }
         return clientProps
@@ -158,8 +171,10 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi
             }
 
             else -> {
-                throw BluePrintProcessorException("Unable to get the DMAAP " +
-                        "client")
+                throw BluePrintProcessorException(
+                    "Unable to get the DMAAP " +
+                            "client"
+                )
             }
         }
     }
@@ -171,7 +186,8 @@ open class BluePrintDmaapLibPropertyService(private var bluePrintPropertiesServi
     private fun parseEventProps(): Properties {
         val prodProps = Properties()
         val proProps = (env as ConfigurableEnvironment).propertySources.get(
-                "class path resource [event.properties]")
+            "class path resource [event.properties]"
+        )
 
         if (proProps != null) {
             val entries = (proProps as ResourcePropertySource).source.entries