+ private synchronized void onSnapshotFailure(Bundle bundle, List<URL> addedURLs, Exception failureReason) {
+ // inconsistent state
+ inconsistentBundlesToYangURLs.putAll(bundle, addedURLs);
+
+ logger.debug("Yang store is falling back to last consistent state containing {}, inconsistent yang files {}",
+ consistentBundlesToYangURLs, inconsistentBundlesToYangURLs, failureReason);
+ logger.info("Yang store is falling back to last consistent state containing {} files, keeping {} inconsistent yang files due to {}",
+ consistentBundlesToYangURLs.size(), inconsistentBundlesToYangURLs.size(), failureReason.toString());
+ cache.setInconsistentURLsForReporting(inconsistentBundlesToYangURLs.values());
+ }
+
+ private synchronized void onSnapshotSuccess(Multimap<Bundle, URL> proposedNewState, YangStoreSnapshotImpl snapshot) {
+ // consistent state
+ // merge into
+ consistentBundlesToYangURLs.clear();
+ consistentBundlesToYangURLs.putAll(proposedNewState);
+
+ logger.debug("Yang store updated to new consistent state containing {}", consistentBundlesToYangURLs);
+
+ // If we cleared up some inconsistent models, report that
+ if (!inconsistentBundlesToYangURLs.isEmpty()) {
+ inconsistentBundlesToYangURLs.clear();
+ logger.info("Yang store updated to new consistent state containing {} yang files", consistentBundlesToYangURLs.size());
+ }
+
+ updateCache(snapshot);
+ cache.setInconsistentURLsForReporting(Collections.<URL> emptySet());
+ }
+
+ private synchronized void updateCache(YangStoreSnapshotImpl snapshot) {