summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/processor-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/processor-core/src/main')
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt49
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt29
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt123
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt68
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/utils/PayloadUtils.kt47
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/resources/application.properties16
6 files changed, 0 insertions, 332 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
deleted file mode 100644
index 07e494a1..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.blueprintsprocessor.core
-
-import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.beans.factory.annotation.Value
-import org.springframework.boot.context.properties.bind.Binder
-import org.springframework.boot.context.properties.source.ConfigurationPropertySources
-import org.springframework.context.annotation.Bean
-import org.springframework.context.annotation.Configuration
-import org.springframework.core.env.Environment
-
-
-@Configuration
-open class BluePrintCoreConfiguration {
-
- @Value("\${blueprintsprocessor.blueprintDeployPath}")
- lateinit var deployPath: String
-
- @Value("\${blueprintsprocessor.blueprintArchivePath}")
- lateinit var archivePath: String
-
-}
-
-@Configuration
-open class BlueprintPropertyConfiguration {
- @Autowired
- lateinit var environment: Environment
-
- @Bean
- open fun bluePrintPropertyBinder(): Binder {
- val configurationPropertySource = ConfigurationPropertySources.get(environment)
- return Binder(configurationPropertySource)
- }
-} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt
deleted file mode 100644
index 10b8ceb5..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/BluePrintProperties.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.blueprintsprocessor.core
-
-import org.springframework.boot.context.properties.bind.Bindable
-import org.springframework.boot.context.properties.bind.Binder
-import org.springframework.stereotype.Service
-
-@Service
-open class BluePrintProperties(var bluePrintPropertyBinder: Binder) {
-
- fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
- return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
- }
-} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt
deleted file mode 100644
index 41bbd1df..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.blueprintsprocessor.core.api.data
-
-import com.fasterxml.jackson.annotation.JsonFormat
-import com.fasterxml.jackson.databind.node.ObjectNode
-import io.swagger.annotations.ApiModelProperty
-import java.util.*
-
-/**
- * BlueprintProcessorData
- * @author Brinda Santh
- * DATE : 8/15/2018
- */
-
-open class ExecutionServiceInput {
- @get:ApiModelProperty(required = true)
- lateinit var commonHeader: CommonHeader
- @get:ApiModelProperty(required = true)
- lateinit var actionIdentifiers: ActionIdentifiers
- @get:ApiModelProperty(required = true)
- lateinit var payload: ObjectNode
-}
-
-open class ExecutionServiceOutput {
- @get:ApiModelProperty(required = true)
- lateinit var commonHeader: CommonHeader
- @get:ApiModelProperty(required = true)
- lateinit var actionIdentifiers: ActionIdentifiers
- @get:ApiModelProperty(required = true)
- var status: Status = Status()
- @get:ApiModelProperty(required = true)
- lateinit var payload: ObjectNode
-}
-
-const val ACTION_MODE_ASYNC = "async"
-const val ACTION_MODE_SYNC = "sync"
-
-open class ActionIdentifiers {
- @get:ApiModelProperty(required = false)
- lateinit var blueprintName: String
- @get:ApiModelProperty(required = false)
- lateinit var blueprintVersion: String
- @get:ApiModelProperty(required = true)
- lateinit var actionName: String
- @get:ApiModelProperty(required = true, allowableValues = "sync, async")
- lateinit var mode: String
-}
-
-open class CommonHeader {
- @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z")
- @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
- var timestamp: Date = Date()
- @get:ApiModelProperty(required = true)
- lateinit var originatorId: String
- @get:ApiModelProperty(required = true)
- lateinit var requestId: String
- @get:ApiModelProperty(required = true)
- lateinit var subRequestId: String
- @get:ApiModelProperty(required = false)
- var flags: Flags? = null
-}
-
-open class Flags {
- var isForce: Boolean = false
- @get:ApiModelProperty(value = "3600")
- var ttl: Int = 3600
-}
-
-open class Status {
- @get:ApiModelProperty(required = true)
- var code: Int = 200
- @get:ApiModelProperty(required = true)
- var eventType: String = "EVENT-ACTION-RESPONSE"
- @get:ApiModelProperty(required = true, example = "2012-04-23T18:25:43.511Z")
- @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
- var timestamp: Date = Date()
- @get:ApiModelProperty(required = false)
- var errorMessage: String? = null
- @get:ApiModelProperty(required = true)
- var message: String = "success"
-}
-
-open class BluePrintManagementInput {
- @get:ApiModelProperty(required = true)
- lateinit var commonHeader: CommonHeader
- @get:ApiModelProperty(required = false)
- lateinit var blueprintName: String
- @get:ApiModelProperty(required = false)
- lateinit var blueprintVersion: String
- @get:ApiModelProperty(required = true)
- lateinit var fileChunk: FileChunk
-}
-
-open class FileChunk {
- @get:ApiModelProperty(required = true)
- lateinit var chunk: ByteArray
-}
-
-open class BluePrintManagementOutput {
- @get:ApiModelProperty(required = true)
- lateinit var commonHeader: CommonHeader
- @get:ApiModelProperty(required = true)
- var status: Status = Status()
-}
-
-
-
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt
deleted file mode 100644
index 9c6e5075..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.blueprintsprocessor.core.factory
-
-import com.att.eelf.configuration.EELFManager
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
-import org.springframework.context.ApplicationContext
-import org.springframework.context.ApplicationContextAware
-
-/**
- * ComponentNode
- *
- * @author Brinda Santh
- */
-interface ComponentNode {
-
- @Throws(BluePrintProcessorException::class)
- fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)
-
- @Throws(BluePrintProcessorException::class)
- fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)
-
- @Throws(BluePrintProcessorException::class)
- fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)
-
- @Throws(BluePrintProcessorException::class)
- fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)
-}
-
-/**
- * ComponentNodeFactory
- *
- * @author Brinda Santh
- */
-open class ComponentNodeFactory : ApplicationContextAware {
- private val log = EELFManager.getInstance().getLogger(ComponentNodeFactory::class.java)
-
- var componentNodes: MutableMap<String, ComponentNode> = hashMapOf()
-
- fun getInstance(instanceName: String): ComponentNode? {
- log.trace("looking for Component Nodes : {}", instanceName)
- return componentNodes.get(instanceName)
- }
-
- fun injectInstance(instanceName: String, componentNode: ComponentNode) {
- this.componentNodes[instanceName] = componentNode
- }
-
- override fun setApplicationContext(context: ApplicationContext) {
- componentNodes = context.getBeansOfType(ComponentNode::class.java)
- log.info("Injected Component Nodes : {}", componentNodes)
- }
-} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/utils/PayloadUtils.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/utils/PayloadUtils.kt
deleted file mode 100644
index 31dca33b..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/utils/PayloadUtils.kt
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.ccsdk.apps.blueprintsprocessor.core.utils
-
-import com.fasterxml.jackson.databind.JsonNode
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
-import org.onap.ccsdk.apps.controllerblueprints.core.service.BluePrintRuntimeService
-
-
-class PayloadUtils {
-
- companion object {
-
- fun prepareInputsFromWorkflowPayload(bluePrintRuntimeService: BluePrintRuntimeService<*>, payload: JsonNode, workflowName: String) {
- val input = payload.get("$workflowName-request")
- bluePrintRuntimeService.assignWorkflowInputs(workflowName, input)
- }
-
- fun prepareDynamicInputsFromWorkflowPayload(bluePrintRuntimeService: BluePrintRuntimeService<*>, payload: JsonNode, workflowName: String) {
- val input = payload.get("$workflowName-request")
- val propertyFields = input.get("$workflowName-properties")
- prepareDynamicInputsFromComponentPayload(bluePrintRuntimeService, propertyFields)
- }
-
- fun prepareDynamicInputsFromComponentPayload(bluePrintRuntimeService: BluePrintRuntimeService<*>, payload: JsonNode) {
- payload.fields().forEach { property ->
- val path = StringBuilder(BluePrintConstants.PATH_INPUTS)
- .append(BluePrintConstants.PATH_DIVIDER).append(property.key).toString()
- bluePrintRuntimeService.put(path, property.value)
- }
- }
- }
-} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/resources/application.properties b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/resources/application.properties
deleted file mode 100644
index c10e96ee..00000000
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/resources/application.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Copyright © 2017-2018 AT&T Intellectual Property.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-