Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-1234

API that returns source list and model information

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Medium Medium
    • Frankfurt Release
    • Dublin Release
    • None
    • None

      https://github.com/onap/ccsdk-cds/blob/c90edac236dffb7c495e266dd04991de7e8f04b7/ms/controllerblueprints/modules/resource-dict/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/resource/dict/factory/ResourceSourceMappingFactory.kt

       

      object ResourceSourceMappingFactory {
         
        private val resourceSourceMappings: MutableMap<String, String> = hashMapOf()
         
        fun registerSourceMapping(sourceInstance: String, nodeTypeName: String) {| | |resourceSourceMappings[sourceInstance] = nodeTypeName| | |}
         
        fun getRegisterSourceMapping(sourceInstance: String): String {
        return resourceSourceMappings[sourceInstance]
        ?: throw BluePrintException(format("failed to get source({}) mapping", sourceInstance))
        }
         
        fun getRegisterSourceMapping(): ResourceSourceMapping {| | |val resourceSourceMapping = ResourceSourceMapping()| | |resourceSourceMapping.resourceSourceMappings = resourceSourceMappings| | |return resourceSourceMapping| | |}
        }

       

       

       

       

      https://github.com/onap/ccsdk-cds/blob/ea8fd6be7ad470d398ce029f2866e1ce3e44474b/ms/controllerblueprints/modules/service/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/service/handler/ModelTypeHandler.kt

       

       

      /**
       
      • This is a getModelTypeByName service
        *
       
      • @param modelTypeName modelTypeName
       
      • @return ModelType
        */
        suspend fun getModelTypeByName(modelTypeName: String): ModelType {
        log.info("Searching : $modelTypeName")
        check(modelTypeName.isNotBlank()) { "Model Name Information is missing." }
        val modelType = modelTypeRepository.findByModelName(modelTypeName)
        return if (modelType != null) {| | |modelType| | |}

      else

      {| | |throw BluePrintException("couldn't get modelType($modelTypeName)")| | |}
        }
         
         
        /**
       
      • This is a searchModelTypes service
        *
       
      • @param tags tags
       
      • @return List<ModelType>
        </ModelType> */
        suspend fun searchModelTypes(tags: String): List<ModelType> {
        check(tags.isNotBlank()) { "No Search Information provide" }
        return modelTypeRepository.findByTagsContainingIgnoreCase(tags)
        }

            Unassigned Unassigned
            ym9479 ym9479
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: