Enabling Code Formatter
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / rest-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / rest / BluePrintRestLibConfiguration.kt
index fa4ff23..6e9e4b5 100644 (file)
 
 package org.onap.ccsdk.cds.blueprintsprocessor.rest
 
+import com.fasterxml.jackson.databind.JsonNode
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BluePrintRestLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
+import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
 import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.context.annotation.ComponentScan
 import org.springframework.context.annotation.Configuration
@@ -27,16 +31,31 @@ import org.springframework.context.annotation.Configuration
 @EnableConfigurationProperties
 open class BluePrintRestLibConfiguration
 
+/**
+ * Exposed Dependency Service by this Rest Lib Module
+ */
+fun BluePrintDependencyService.restLibPropertyService(): BluePrintRestLibPropertyService =
+    instance(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY)
+
+fun BluePrintDependencyService.restClientService(selector: String): BlueprintWebClientService {
+    return restLibPropertyService().blueprintWebClientService(selector)
+}
+
+fun BluePrintDependencyService.restClientService(jsonNode: JsonNode): BlueprintWebClientService {
+    return restLibPropertyService().blueprintWebClientService(jsonNode)
+}
 
 class RestLibConstants {
     companion object {
+
         const val SERVICE_BLUEPRINT_REST_LIB_PROPERTY = "blueprint-rest-lib-property-service"
+        const val PROPERTY_REST_CLIENT_PREFIX = "blueprintsprocessor.restclient."
+        const val PROPERTY_TYPE = "type"
         const val TYPE_TOKEN_AUTH = "token-auth"
         const val TYPE_BASIC_AUTH = "basic-auth"
         const val TYPE_SSL_BASIC_AUTH = "ssl-basic-auth"
         const val TYPE_SSL_TOKEN_AUTH = "ssl-token-auth"
         const val TYPE_SSL_NO_AUTH = "ssl-no-auth"
-        const val TYPE_DME2_PROXY = "dme2-proxy"
         const val TYPE_POLICY_MANAGER = "policy-manager"
     }
-}
\ No newline at end of file
+}