import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestClientProperties
import org.onap.ccsdk.cds.blueprintsprocessor.rest.RestLibConstants
import org.onap.ccsdk.cds.blueprintsprocessor.rest.utils.WebClientUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintRetryException
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintIOUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintRetryException
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintIOUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
.build()
}
- /** High performance non blocking Retry function, If execution block [block] throws BlueprintRetryException
+ /** High performance non blocking Retry function, If execution block [block] throws BluePrintRetryException
* exception then this will perform wait and retrigger accoring to times [times] with delay [delay]
*/
suspend fun <T> retry(
block: suspend (Int) -> T
): T {
val exceptionBlock = { e: Exception ->
- if (e !is BlueprintRetryException) {
+ if (e !is BluePrintRetryException) {
throw e
}
}
- return BlueprintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock)
+ return BluePrintIOUtils.retry(times, initialDelay, delay, block, exceptionBlock)
}
fun exchangeResource(methodType: String, path: String, request: String): WebClientResponse<String> {
HttpMethod.POST -> post(path, request, convertedHeaders, String::class.java)
HttpMethod.PUT -> put(path, request, convertedHeaders, String::class.java)
HttpMethod.PATCH -> patch(path, request, convertedHeaders, String::class.java)
- else -> throw BlueprintProcessorException(
+ else -> throw BluePrintProcessorException(
"Unsupported methodType($methodType) attempted on path($path)"
)
}
HttpMethod.DELETE -> deleteNB(path, convertedHeaders, responseType)
HttpMethod.PUT -> putNB(path, request, convertedHeaders, responseType)
HttpMethod.PATCH -> patchNB(path, request, convertedHeaders, responseType)
- else -> throw BlueprintProcessorException("Unsupported methodType($methodType)")
+ else -> throw BluePrintProcessorException("Unsupported methodType($methodType)")
}
}
" User-supplied \"additionalHeaders\" cannot contain AUTHORIZATION header with" +
" auth-type \"${RestLibConstants.TYPE_BASIC_AUTH}\""
WebClientUtils.log.error(errMsg)
- throw BlueprintProcessorException(errMsg)
+ throw BluePrintProcessorException(errMsg)
} else {
customHeaders.putAll(it)
}