summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/rest-lib/src
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh <brindasanth@in.ibm.com>2019-02-18 15:10:25 -0500
committerAlexis de Talhouët <adetalhouet89@gmail.com>2019-02-20 21:02:05 +0000
commit0613ae8f927834f7621011fda3f0cb1b7f8e07ad (patch)
tree79010a222bfb62ad2cb61d88cccfea8f76dfc186 /ms/blueprintsprocessor/modules/commons/rest-lib/src
parent183e2b48ceb4ae58b85f76f9bf182a5958fc92e6 (diff)
Add component function scripting service
Change-Id: I7c5b49617823dd623566fb4be4d431012420e17c Issue-ID: CCSDK-959 Signed-off-by: Muthuramalingam, Brinda Santh <brindasanth@in.ibm.com>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/rest-lib/src')
-rw-r--r--ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt2
-rw-r--r--ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt26
2 files changed, 20 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt
index 50d69aee4..f63e39f39 100644
--- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt
+++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/BluePrintRestLibConfiguration.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +29,7 @@ open class BluePrintRestLibConfiguration
class RestLibConstants {
companion object {
+ const val SERVICE_BLUEPRINT_REST_LIB_PROPERTY = "blueprint-rest-lib-property-service"
const val TYPE_BASIC_AUTH = "basic-auth"
const val TYPE_SSL_BASIC_AUTH = "ssl-basic-auth"
const val TYPE_DME2_PROXY = "dme2-proxy"
diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt
index 21d080d5a..47577b39e 100644
--- a/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt
+++ b/ms/blueprintsprocessor/modules/commons/rest-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/BluePrintRestLibPropertyService.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2017-2018 AT&T Intellectual Property.
+ * Modifications Copyright © 2019 IBM.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,7 +22,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.rest.*
import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
import org.springframework.stereotype.Service
-@Service
+@Service(RestLibConstants.SERVICE_BLUEPRINT_REST_LIB_PROPERTY)
open class BluePrintRestLibPropertyService(private var bluePrintProperties: BluePrintProperties) {
@Throws(BluePrintProcessorException::class)
@@ -49,22 +50,31 @@ open class BluePrintRestLibPropertyService(private var bluePrintProperties: Blue
@Throws(BluePrintProcessorException::class)
fun blueprintWebClientService(selector: String): BlueprintWebClientService {
val prefix = "blueprintsprocessor.restclient.$selector"
- val beanProperties = restClientProperties(prefix)
- when (beanProperties) {
+ val restClientProperties = restClientProperties(prefix)
+ return blueprintWebClientService(restClientProperties)
+ }
+
+
+ fun blueprintDynamicWebClientService(sourceType: String, selector: String): BlueprintWebClientService {
+ TODO()
+ }
+
+ @Throws(BluePrintProcessorException::class)
+ fun blueprintWebClientService(restClientProperties: RestClientProperties): BlueprintWebClientService {
+ when (restClientProperties) {
is BasicAuthRestClientProperties -> {
- return BasicAuthRestClientService(beanProperties)
+ return BasicAuthRestClientService(restClientProperties)
}
is SSLBasicAuthRestClientProperties -> {
- return SSLBasicAuthRestClientService(beanProperties)
+ return SSLBasicAuthRestClientService(restClientProperties)
}
is DME2RestClientProperties -> {
- return DME2ProxyRestClientService(beanProperties)
+ return DME2ProxyRestClientService(restClientProperties)
}
else -> {
- throw BluePrintProcessorException("couldn't get rest service for selector($selector)")
+ throw BluePrintProcessorException("couldn't get rest service for")
}
}
-
}
fun basicAuthRestClientProperties(prefix: String): BasicAuthRestClientProperties {