package org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor
-import org.onap.ccsdk.cds.blueprintsprocessor.db.BlueprintDBLibGenericService
+import org.onap.ccsdk.cds.blueprintsprocessor.db.BluePrintDBLibGenericService
import org.onap.ccsdk.cds.blueprintsprocessor.db.PrimaryDBLibGenericService
-import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BlueprintDBLibPropertyService
+import org.onap.ccsdk.cds.blueprintsprocessor.db.primary.BluePrintDBLibPropertyService
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.DatabaseResourceSource
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants.PREFIX_RESOURCE_RESOLUTION_PROCESSOR
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.ExecutionServiceDomains
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.checkNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.isNotEmpty
import org.onap.ccsdk.cds.controllerblueprints.core.nullToEmpty
@Service("${PREFIX_RESOURCE_RESOLUTION_PROCESSOR}source-db")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
open class DatabaseResourceAssignmentProcessor(
- private val bluePrintDBLibPropertyService: BlueprintDBLibPropertyService,
+ private val bluePrintDBLibPropertyService: BluePrintDBLibPropertyService,
private val primaryDBLibGenericService: PrimaryDBLibGenericService
) : ResourceAssignmentProcessor() {
}
// Check the value has populated for mandatory case
ResourceAssignmentUtils.assertTemplateKeyValueNotNull(resourceAssignment)
- } catch (e: BlueprintProcessorException) {
+ } catch (e: BluePrintProcessorException) {
val errorMsg = "Failed to process Database resource resolution in template key ($resourceAssignment) assignments."
throw e.updateErrorMessage(
ExecutionServiceDomains.RESOURCE_RESOLUTION, errorMsg,
)
} catch (e: Exception) {
ResourceAssignmentUtils.setFailedResourceDataValue(resourceAssignment, e.message)
- throw BlueprintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
+ throw BluePrintProcessorException("Failed in template key ($resourceAssignment) assignments with: ${e.message}", e)
}
}
/** Check Resource Assignment has the source definitions, If not get from Resource Definition **/
val resourceSource = resourceAssignment.dictionarySourceDefinition
?: resourceDefinition?.sources?.get(dSource)
- ?: throw BlueprintProcessorException("couldn't get resource definition $dName source($dSource)")
+ ?: throw BluePrintProcessorException("couldn't get resource definition $dName source($dSource)")
val resourceSourceProperties = checkNotNull(resourceSource.properties) {
"failed to get source properties for $dName "
}
populateResource(resourceAssignment, sourceProperties, rows)
}
- private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BlueprintDBLibGenericService {
+ private fun blueprintDBLibService(sourceProperties: DatabaseResourceSource, selector: String): BluePrintDBLibGenericService {
return if (isNotEmpty(sourceProperties.endpointSelector)) {
val dbPropertiesJson = raRuntimeService.resolveDSLExpression(sourceProperties.endpointSelector!!)
bluePrintDBLibPropertyService.JdbcTemplate(dbPropertiesJson)
}
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun validate(resourceAssignment: ResourceAssignment) {
checkNotEmpty(resourceAssignment.name) { "resource assignment template key is not defined" }
checkNotEmpty(resourceAssignment.dictionaryName) {
return namedParameters
}
- @Throws(BlueprintProcessorException::class)
+ @Throws(BluePrintProcessorException::class)
private fun populateResource(
resourceAssignment: ResourceAssignment,
sourceProperties: DatabaseResourceSource,