X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ms%2Fblueprintsprocessor%2Ffunctions%2Fnetconf-executor%2Fsrc%2Fmain%2Fkotlin%2Forg%2Fonap%2Fccsdk%2Fcds%2Fblueprintsprocessor%2Ffunctions%2Fnetconf%2Fexecutor%2FNetconfComponentFunction.kt;h=5e0b4a11754b1bf4f0af4ab2d55abf2f902372fe;hb=d9e690caf3c1c0b6bb5d55dd21fc75508f267f5d;hp=4cec6a2bf7a7566b69ea73f7764aa03265917b74;hpb=a6fae85764a8dfbeba6000a060b8be0f21fb0466;p=ccsdk%2Fcds.git diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt index 4cec6a2bf..5e0b4a117 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/NetconfComponentFunction.kt @@ -17,51 +17,48 @@ package org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor -import com.fasterxml.jackson.databind.JsonNode import kotlinx.coroutines.runBlocking -import org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.api.DeviceInfo import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction -import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils +@Deprecated("Methods defined as extension function of AbstractComponentFunction") abstract class NetconfComponentFunction : AbstractScriptComponentFunction() { + @Deprecated(" Use resourceResolutionService method directly", + replaceWith = ReplaceWith("resourceResolutionService()", + "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resourceResolutionService")) open fun resourceResolutionService(): ResourceResolutionService = functionDependencyInstanceAsType(ResourceResolutionConstants.SERVICE_RESOURCE_RESOLUTION) // Called from python script + @Deprecated(" Use netconfDeviceInfo method directly", + replaceWith = ReplaceWith("netconfDeviceInfo(requirementName)", + "org.onap.ccsdk.cds.blueprintsprocessor.functions.netconf.executor.netconfDeviceInfo")) fun initializeNetconfConnection(requirementName: String): NetconfDevice { - val deviceInfo = deviceProperties(requirementName) + val deviceInfo = netconfDeviceInfo(requirementName) return NetconfDevice(deviceInfo) } + @Deprecated(" Use artifactContent method directly", + replaceWith = ReplaceWith("artifactContent(artifactName)", + "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.artifactContent")) fun generateMessage(artifactName: String): String { return bluePrintRuntimeService.resolveNodeTemplateArtifact(nodeTemplateName, artifactName) } + @Deprecated(" Use storedContentFromResolvedArtifact method directly", + replaceWith = ReplaceWith("storedContentFromResolvedArtifact(resolutionKey, artifactName)", + "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.storedContentFromResolvedArtifact")) fun resolveFromDatabase(resolutionKey: String, artifactName: String): String = runBlocking { resourceResolutionService().resolveFromDatabase(bluePrintRuntimeService, artifactName, resolutionKey) } + @Deprecated(" Use contentFromResolvedArtifact method directly", + replaceWith = ReplaceWith("resolveAndGenerateMessage(artifactPrefix)", + "org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.resolveAndGenerateMessage")) fun resolveAndGenerateMessage(artifactPrefix: String): String = runBlocking { resourceResolutionService().resolveResources(bluePrintRuntimeService, nodeTemplateName, artifactPrefix, mapOf()) } - - private fun deviceProperties(requirementName: String): DeviceInfo { - - val blueprintContext = bluePrintRuntimeService.bluePrintContext() - - val requirement = blueprintContext.nodeTemplateRequirement(nodeTemplateName, requirementName) - - val capabilityProperties = bluePrintRuntimeService.resolveNodeTemplateCapabilityProperties(requirement - .node!!, requirement.capability!!) - - return deviceProperties(capabilityProperties) - } - - private fun deviceProperties(capabilityProperty: MutableMap): DeviceInfo { - return JacksonUtils.getInstanceFromMap(capabilityProperty, DeviceInfo::class.java) - } } \ No newline at end of file