use of org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils in project azure-tools-for-java by Microsoft.
the class FunctionDeploymentState method listFunctions.
// todo: Move to toolkit lib as shared task
private List<FunctionEntity> listFunctions(final IFunctionApp functionApp) {
final int[] count = { 0 };
final IAzureMessager azureMessager = AzureMessager.getMessager();
return Mono.fromCallable(() -> {
final AzureString message = count[0]++ == 0 ? AzureString.fromString(SYNCING_TRIGGERS) : AzureString.format(SYNCING_TRIGGERS_WITH_RETRY, count[0], LIST_TRIGGERS_MAX_RETRY);
azureMessager.info(message);
return Optional.ofNullable(functionApp.listFunctions(true)).filter(CollectionUtils::isNotEmpty).orElseThrow(() -> new AzureToolkitRuntimeException(NO_TRIGGERS_FOUNDED));
}).subscribeOn(Schedulers.boundedElastic()).retryWhen(Retry.fixedDelay(LIST_TRIGGERS_MAX_RETRY - 1, Duration.ofSeconds(LIST_TRIGGERS_RETRY_PERIOD_IN_SECONDS))).block();
}
Aggregations