* <p>
* Notify subscribing services
*/
+@SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
public class RicSynchronizationTask {
private static final Logger logger = LoggerFactory.getLogger(RicSynchronizationTask.class);
this.services = services;
}
- @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
+ @SuppressWarnings("squid:S2445") // Blocks should be synchronized on "private final" fields
public void run(Ric ric) {
logger.debug("Handling ric: {}", ric.getConfig().name());
return Flux.concat(recoverTypes, policiesDeletedInRic, policiesRecreatedInRic);
}
- @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
private void onSynchronizationComplete(Ric ric) {
- logger.debug("Synchronization completed for: {}", ric.name());
+ logger.info("Synchronization completed for: {}", ric.name());
ric.setState(RicState.IDLE);
notifyAllServices("Synchronization completed for:" + ric.name());
}
}
}
- @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
private void onSynchronizationError(Ric ric, Throwable t) {
logger.warn("Synchronization failed for ric: {}, reason: {}", ric.name(), t.getMessage());
// If synchronization fails, try to remove all instances
() -> onSynchronizationComplete(ric));
}
- @SuppressWarnings("squid:S2629") // Invoke method(s) only conditionally
private void onRecoveryError(Ric ric, Throwable t) {
logger.warn("Synchronization failure recovery failed for ric: {}, reason: {}", ric.name(), t.getMessage());
ric.setState(RicState.UNDEFINED);