+ // If recovery fails, try to remove all instances
+ deleteAllPolicies(ric);
+ Flux<PolicyType> recoverTypes = this.a1ClientFactory.createA1Client(ric) //
+ .flatMapMany(a1Client -> recoverPolicyTypes(ric, a1Client));
+ Flux<?> deletePoliciesInRic = this.a1ClientFactory.createA1Client(ric) //
+ .flatMapMany(a1Client -> a1Client.deleteAllPolicies());
+
+ Flux.merge(recoverTypes, deletePoliciesInRic) //
+ .subscribe(x -> logger.debug("Brute recover: " + x), //
+ throwable -> onRemoveAllError(ric, throwable), //
+ () -> onRecoveryComplete(ric));
+ }
+
+ private void onRemoveAllError(Ric ric, Throwable t) {
+ logger.warn("Remove all failed for: {}, reason: {}", ric.name(), t.getMessage());