aboutsummaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor
diff options
context:
space:
mode:
authorDan Timoney <dt5972@att.com>2018-09-04 14:44:49 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-04 14:44:49 +0000
commita588733135be56351be5f66e38716e66e75e3186 (patch)
tree0634a97e30b9c0bd247f08202ca459aa714156ee /ms/blueprintsprocessor
parent177fed2b13cd518ead2f6ca0f8db00330e1b4f4f (diff)
parent630d6dd18bcac71566d81fc560379cf7c1418eb2 (diff)
Merge "Blueprints Processor Service"
Diffstat (limited to 'ms/blueprintsprocessor')
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt61
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt47
-rw-r--r--ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt39
-rw-r--r--ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt40
-rw-r--r--ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt40
5 files changed, 227 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt
new file mode 100644
index 000000000..f42613cc0
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ComponentNodeFactory.kt
@@ -0,0 +1,61 @@
+/*
+ * 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.factory
+
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import org.springframework.context.ApplicationContext
+import org.springframework.context.ApplicationContextAware
+import org.springframework.stereotype.Service
+
+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?>)
+}
+
+@Service
+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/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt
new file mode 100644
index 000000000..8104c104b
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/factory/ResourceAssignmentProcessorFactory.kt
@@ -0,0 +1,47 @@
+/*
+ * 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.factory
+
+import com.att.eelf.configuration.EELFManager
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor
+import org.slf4j.Logger
+import org.slf4j.LoggerFactory
+import org.springframework.context.ApplicationContext
+import org.springframework.context.ApplicationContextAware
+import org.springframework.stereotype.Service
+
+@Service
+class ResourceAssignmentProcessorFactory : ApplicationContextAware {
+
+ private val log = EELFManager.getInstance().getLogger(ResourceAssignmentProcessorFactory::class.java)
+
+ var resourceAssignmentProcessors: MutableMap<String, ResourceAssignmentProcessor> = hashMapOf()
+
+ fun getInstance(instanceName: String): ResourceAssignmentProcessor? {
+ log.trace("looking for Resource Assignment Processor : {}", instanceName)
+ return resourceAssignmentProcessors.get(instanceName)
+ }
+
+ fun injectInstance(instanceName: String, resourceAssignmentProcessor: ResourceAssignmentProcessor) {
+ this.resourceAssignmentProcessors[instanceName] = resourceAssignmentProcessor
+ }
+
+ override fun setApplicationContext(context: ApplicationContext) {
+ resourceAssignmentProcessors = context.getBeansOfType(ResourceAssignmentProcessor::class.java)
+ log.info("Injected Resource Assignment Processor : {}", resourceAssignmentProcessors)
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt
new file mode 100644
index 000000000..ff1a01d58
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/ResourceResolutionComponent.kt
@@ -0,0 +1,39 @@
+/*
+ * 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.services.resolution
+
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode
+import org.springframework.stereotype.Component
+
+@Component("component-resource-resolution")
+open class ResourceResolutionComponent : ComponentNode {
+ override fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt
new file mode 100644
index 000000000..396ca1d79
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/DefaultResourceAssignmentProcessor.kt
@@ -0,0 +1,40 @@
+/*
+ * 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.services.resolution.processor
+
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor
+import org.springframework.stereotype.Service
+
+@Service("resource-assignment-processor-default")
+open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor {
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt
new file mode 100644
index 000000000..9d0734e6b
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/services/resolution-service/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/services/resolution/processor/InputResourceAssignmentProcessor.kt
@@ -0,0 +1,40 @@
+/*
+ * 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.services.resolution.processor
+
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor
+import org.springframework.stereotype.Service
+
+@Service("resource-assignment-processor-input")
+open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor {
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+} \ No newline at end of file