aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-07-26 12:00:59 -0400
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-07-28 09:06:26 -0400
commit45263f50896a7021cd17d78ce83b29365cb19c29 (patch)
tree0245881b0c3badd2e72144dc29311f4e7df58e38 /ms/blueprintsprocessor/modules/commons/ssh-lib/src/main
parent76cb04c2302c9f8f0395f86d8e8d246fdae0fd28 (diff)
Revert "Renaming Files having BluePrint to have Blueprint"1.1.5
The renaming in CCSDK-3098 caused breaking changes to the grpc api and compile issues for kotlin scripts. Issue-ID: CCSDK-3385 Change-Id: I0d745cb858371678eabcb2284671c1fd76a1ab6d Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/ssh-lib/src/main')
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibConfiguration.kt (renamed from ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibConfiguration.kt)12
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt (renamed from ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibData.kt)0
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt26
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt10
-rw-r--r--ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt (renamed from ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyService.kt)14
5 files changed, 31 insertions, 31 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibConfiguration.kt
index 7b471870b..dc10722cc 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibConfiguration.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibConfiguration.kt
@@ -17,9 +17,9 @@
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.BluePrintSshLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.ssh.service.BlueprintSshClientService
-import org.onap.ccsdk.cds.controllerblueprints.core.service.BlueprintDependencyService
+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,18 +27,18 @@ import org.springframework.context.annotation.Configuration
@Configuration
@ComponentScan
@EnableConfigurationProperties
-open class BlueprintSshLibConfiguration
+open class BluePrintSshLibConfiguration
/**
* Exposed Dependency Service by this SSH Lib Module
*/
-fun BlueprintDependencyService.sshLibPropertyService(): BlueprintSshLibPropertyService =
+fun BluePrintDependencyService.sshLibPropertyService(): BluePrintSshLibPropertyService =
instance(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY)
-fun BlueprintDependencyService.sshClientService(selector: String): BlueprintSshClientService =
+fun BluePrintDependencyService.sshClientService(selector: String): BlueprintSshClientService =
sshLibPropertyService().blueprintSshClientService(selector)
-fun BlueprintDependencyService.sshClientService(jsonNode: JsonNode): BlueprintSshClientService =
+fun BluePrintDependencyService.sshClientService(jsonNode: JsonNode): BlueprintSshClientService =
sshLibPropertyService().blueprintSshClientService(jsonNode)
class SshLibConstants {
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibData.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt
index 295021f21..295021f21 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BlueprintSshLibData.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/BluePrintSshLibData.kt
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
index 256924c5f..a7702d4fb 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/SshPropertiesDSL.kt
@@ -19,8 +19,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor.ssh
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.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
@@ -32,25 +32,25 @@ import org.onap.ccsdk.cds.controllerblueprints.core.dsl.relationshipType
/** Relationships Types DSL for Message Producer */
fun ServiceTemplateBuilder.relationshipTypeConnectsToSshClient() {
- val relationshipType = BlueprintTypes.relationshipTypeConnectsToSshClient()
+ val relationshipType = BluePrintTypes.relationshipTypeConnectsToSshClient()
if (this.relationshipTypes == null) this.relationshipTypes = hashMapOf()
this.relationshipTypes!![relationshipType.id!!] = relationshipType
}
-fun BlueprintTypes.relationshipTypeConnectsToSshClient(): RelationshipType {
+fun BluePrintTypes.relationshipTypeConnectsToSshClient(): RelationshipType {
return relationshipType(
- id = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT,
- version = BlueprintConstants.DEFAULT_VERSION_NUMBER,
- derivedFrom = BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
+ id = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT,
+ version = BluePrintConstants.DEFAULT_VERSION_NUMBER,
+ derivedFrom = BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO,
description = "Relationship connects to through SSH Client."
) {
property(
- BlueprintConstants.PROPERTY_CONNECTION_CONFIG,
- BlueprintConstants.DATA_TYPE_MAP,
+ BluePrintConstants.PROPERTY_CONNECTION_CONFIG,
+ BluePrintConstants.DATA_TYPE_MAP,
true,
"Connection Config details."
)
- validTargetTypes(arrayListOf(BlueprintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
+ validTargetTypes(arrayListOf(BluePrintConstants.MODEL_TYPE_CAPABILITY_TYPE_ENDPOINT))
}
}
@@ -68,15 +68,15 @@ fun TopologyTemplateBuilder.relationshipTemplateSshClient(
open class SshRelationshipTemplateBuilder(name: String, description: String) :
RelationshipTemplateBuilder(
name,
- BlueprintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, description
+ BluePrintConstants.MODEL_TYPE_RELATIONSHIPS_CONNECTS_TO_SSH_CLIENT, description
) {
fun basicAuth(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit) {
- property(BlueprintConstants.PROPERTY_CONNECTION_CONFIG, BlueprintTypes.basicAuthSshProperties(block))
+ property(BluePrintConstants.PROPERTY_CONNECTION_CONFIG, BluePrintTypes.basicAuthSshProperties(block))
}
}
-fun BlueprintTypes.basicAuthSshProperties(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit): JsonNode {
+fun BluePrintTypes.basicAuthSshProperties(block: BasicAuthSshClientPropertiesAssignmentBuilder.() -> Unit): JsonNode {
val sshProperties = BasicAuthSshClientPropertiesAssignmentBuilder().apply(block).build()
sshProperties[SshClientProperties::type.name] = SshLibConstants.TYPE_BASIC_AUTH.asJsonPrimitive()
return sshProperties.asJsonType()
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
index 46756e63a..6ee73c238 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BasicAuthSshClientService.kt
@@ -25,7 +25,7 @@ import org.apache.sshd.client.channel.ClientChannelEvent
import org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier
import org.apache.sshd.client.session.ClientSession
import org.onap.ccsdk.cds.blueprintsprocessor.ssh.BasicAuthSshClientProperties
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.slf4j.LoggerFactory
import java.io.ByteArrayOutputStream
import java.io.IOException
@@ -76,7 +76,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B
channel!!.err = ByteArrayOutputStream()
channel!!.open()
} catch (e: Exception) {
- throw BlueprintProcessorException("Failed to start Shell channel: ${e.message}")
+ throw BluePrintProcessorException("Failed to start Shell channel: ${e.message}")
}
}
@@ -97,7 +97,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B
}
}
} catch (e: Exception) {
- throw BlueprintProcessorException("Failed to execute commands, below the error message : ${e.message}")
+ throw BluePrintProcessorException("Failed to execute commands, below the error message : ${e.message}")
}
return response
}
@@ -111,7 +111,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B
teeOutput!!.flush()
deviceOutput = waitForPrompt(timeOut)
} catch (e: IOException) {
- throw BlueprintProcessorException("Exception during command execution: ${e.message}", e)
+ throw BluePrintProcessorException("Exception during command execution: ${e.message}", e)
}
if (detectFailure(deviceOutput)) {
@@ -130,7 +130,7 @@ open class BasicAuthSshClientService(private val basicAuthSshClientProperties: B
Collections.unmodifiableSet(EnumSet.of(ClientChannelEvent.CLOSED)), timeOut
)
if (channel!!.out.toString().indexOfAny(arrayListOf("$", ">", "#")) <= 0 && waitMask.contains(ClientChannelEvent.TIMEOUT)) {
- throw BlueprintProcessorException("Timeout: Failed to retrieve commands result in $timeOut ms")
+ throw BluePrintProcessorException("Timeout: Failed to retrieve commands result in $timeOut ms")
}
val outputResult = channel!!.out.toString()
channel!!.out.flush()
diff --git a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt
index 4803d5f52..90a1746e8 100644
--- a/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BlueprintSshLibPropertyService.kt
+++ b/ms/blueprintsprocessor/modules/commons/ssh-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/ssh/service/BluePrintSshLibPropertyService.kt
@@ -17,16 +17,16 @@
package org.onap.ccsdk.cds.blueprintsprocessor.ssh.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.ssh.BasicAuthSshClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.ssh.SshLibConstants
-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(SshLibConstants.SERVICE_BLUEPRINT_SSH_LIB_PROPERTY)
-open class BlueprintSshLibPropertyService(private var bluePrintProperties: BlueprintPropertiesService) {
+open class BluePrintSshLibPropertyService(private var bluePrintProperties: BluePrintPropertiesService) {
fun blueprintSshClientService(jsonNode: JsonNode): BlueprintSshClientService {
val restClientProperties = sshClientProperties(jsonNode)
@@ -46,14 +46,14 @@ open class BlueprintSshLibPropertyService(private var bluePrintProperties: Bluep
basicAuthSshClientProperties(prefix)
}
else -> {
- throw BlueprintProcessorException("SSH adaptor($type) is not supported")
+ throw BluePrintProcessorException("SSH adaptor($type) is not supported")
}
}
}
fun sshClientProperties(jsonNode: JsonNode): SshClientProperties {
val type = jsonNode.get("type")?.textValue()
- ?: throw BlueprintProcessorException("missing type field in ssh client properties")
+ ?: throw BluePrintProcessorException("missing type field in ssh client properties")
return when (type) {
SshLibConstants.TYPE_BASIC_AUTH -> {
JacksonUtils.readValue(
@@ -62,7 +62,7 @@ open class BlueprintSshLibPropertyService(private var bluePrintProperties: Bluep
)!!
}
else -> {
- throw BlueprintProcessorException("SSH adaptor($type) is not supported")
+ throw BluePrintProcessorException("SSH adaptor($type) is not supported")
}
}
}
@@ -74,7 +74,7 @@ open class BlueprintSshLibPropertyService(private var bluePrintProperties: Bluep
return BasicAuthSshClientService(sshClientProperties)
}
else -> {
- throw BlueprintProcessorException("couldn't get SSH client service for")
+ throw BluePrintProcessorException("couldn't get SSH client service for")
}
}
}