Enabling Code Formatter
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / commons / ssh-lib / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / ssh / BluePrintSshLibConfiguration.kt
index 48e451f..dc10722 100644 (file)
 
 package org.onap.ccsdk.cds.blueprintsprocessor.ssh
 
+import com.fasterxml.jackson.databind.JsonNode
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BluePrintSshLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BlueprintSshClientService
+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
@@ -25,10 +29,23 @@ import org.springframework.context.annotation.Configuration
 @EnableConfigurationProperties
 open class BluePrintSshLibConfiguration
 
+/**
+ * Exposed Dependency Service by this SSH Lib Module
+ */
+fun BluePrintDependencyService.sshLibPropertyService(): BluePrintSshLibPropertyService =
+    instance(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY)
+
+fun BluePrintDependencyService.sshClientService(selector: String): BlueprintSshClientService =
+    sshLibPropertyService().blueprintSshClientService(selector)
+
+fun BluePrintDependencyService.sshClientService(jsonNode: JsonNode): BlueprintSshClientService =
+    sshLibPropertyService().blueprintSshClientService(jsonNode)
+
 class SshLibConstants {
     companion object {
+
         const val SERVICE_BLUEPRINT_SSH_LIB_PROPERTY = "blueprint-ssh-lib-property-service"
         const val PROPERTY_SSH_CLIENT_PREFIX = "blueprintsprocessor.sshclient."
         const val TYPE_BASIC_AUTH = "basic-auth"
     }
-}
\ No newline at end of file
+}