--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.ccsdk.apps.blueprintsprocessor.core.factory\r
+\r
+import com.att.eelf.configuration.EELFManager\r
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException\r
+import org.slf4j.Logger\r
+import org.slf4j.LoggerFactory\r
+import org.springframework.context.ApplicationContext\r
+import org.springframework.context.ApplicationContextAware\r
+import org.springframework.stereotype.Service\r
+\r
+interface ComponentNode {\r
+\r
+ @Throws(BluePrintProcessorException::class)\r
+ fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)\r
+\r
+ @Throws(BluePrintProcessorException::class)\r
+ fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)\r
+\r
+ @Throws(BluePrintProcessorException::class)\r
+ fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)\r
+\r
+ @Throws(BluePrintProcessorException::class)\r
+ fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>)\r
+}\r
+\r
+@Service\r
+class ComponentNodeFactory : ApplicationContextAware {\r
+ private val log = EELFManager.getInstance().getLogger(ComponentNodeFactory::class.java)\r
+\r
+ var componentNodes: MutableMap<String, ComponentNode> = hashMapOf()\r
+\r
+ fun getInstance(instanceName: String): ComponentNode? {\r
+ log.trace("looking for Component Nodes : {}", instanceName)\r
+ return componentNodes.get(instanceName)\r
+ }\r
+\r
+ fun injectInstance(instanceName: String, componentNode: ComponentNode) {\r
+ this.componentNodes[instanceName] = componentNode\r
+ }\r
+\r
+ override fun setApplicationContext(context: ApplicationContext) {\r
+ componentNodes = context.getBeansOfType(ComponentNode::class.java)\r
+ log.info("Injected Component Nodes : {}", componentNodes)\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.ccsdk.apps.blueprintsprocessor.core.factory\r
+\r
+import com.att.eelf.configuration.EELFManager\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
+import org.slf4j.Logger\r
+import org.slf4j.LoggerFactory\r
+import org.springframework.context.ApplicationContext\r
+import org.springframework.context.ApplicationContextAware\r
+import org.springframework.stereotype.Service\r
+\r
+@Service\r
+class ResourceAssignmentProcessorFactory : ApplicationContextAware {\r
+\r
+ private val log = EELFManager.getInstance().getLogger(ResourceAssignmentProcessorFactory::class.java)\r
+\r
+ var resourceAssignmentProcessors: MutableMap<String, ResourceAssignmentProcessor> = hashMapOf()\r
+\r
+ fun getInstance(instanceName: String): ResourceAssignmentProcessor? {\r
+ log.trace("looking for Resource Assignment Processor : {}", instanceName)\r
+ return resourceAssignmentProcessors.get(instanceName)\r
+ }\r
+\r
+ fun injectInstance(instanceName: String, resourceAssignmentProcessor: ResourceAssignmentProcessor) {\r
+ this.resourceAssignmentProcessors[instanceName] = resourceAssignmentProcessor\r
+ }\r
+\r
+ override fun setApplicationContext(context: ApplicationContext) {\r
+ resourceAssignmentProcessors = context.getBeansOfType(ResourceAssignmentProcessor::class.java)\r
+ log.info("Injected Resource Assignment Processor : {}", resourceAssignmentProcessors)\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution\r
+\r
+import org.onap.ccsdk.apps.blueprintsprocessor.core.factory.ComponentNode\r
+import org.springframework.stereotype.Component\r
+\r
+@Component("component-resource-resolution")\r
+open class ResourceResolutionComponent : ComponentNode {\r
+ override fun validate(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun process(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun errorHandle(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun reTrigger(context: MutableMap<String, Any>, componentContext: MutableMap<String, Any?>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor\r
+\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
+import org.springframework.stereotype.Service\r
+\r
+@Service("resource-assignment-processor-default")\r
+open class DefaultResourceAssignmentProcessor : ResourceAssignmentProcessor {\r
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright © 2017-2018 AT&T Intellectual Property.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.onap.ccsdk.apps.blueprintsprocessor.services.resolution.processor\r
+\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment\r
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignmentProcessor\r
+import org.springframework.stereotype.Service\r
+\r
+@Service("resource-assignment-processor-input")\r
+open class InputResourceAssignmentProcessor : ResourceAssignmentProcessor {\r
+ override fun errorHandle(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun process(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun reTrigger(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+\r
+ override fun validate(resourceAssignment: ResourceAssignment, context: MutableMap<String, Any>) {\r
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.\r
+ }\r
+}
\ No newline at end of file