- allNetconfOperations = getAllNetconfOperations(defaultNetconfOperations, netconfOperationServiceSnapshot);
-
- DefaultCommit defaultCommit = new DefaultCommit(commitNotifier, capabilityProvider,
- netconfOperationServiceSnapshot.getNetconfSessionIdForReporting());
- Set<NetconfOperationFilter> defaultFilters = Sets.<NetconfOperationFilter> newHashSet(defaultCommit);
- allSortedFilters = getAllNetconfFilters(defaultFilters, netconfOperationServiceSnapshot);
- }
-
- private static Set<NetconfOperation> getAllNetconfOperations(Set<NetconfOperation> defaultNetconfOperations,
- NetconfOperationServiceSnapshot netconfOperationServiceSnapshot) {
- Set<NetconfOperation> result = new HashSet<>();
- result.addAll(defaultNetconfOperations);
-
- for (NetconfOperationService netconfOperationService : netconfOperationServiceSnapshot.getServices()) {
- final Set<NetconfOperation> netOpsFromService = netconfOperationService.getNetconfOperations();
- for (NetconfOperation netconfOperation : netOpsFromService) {
- Preconditions.checkState(result.contains(netconfOperation) == false,
- "Netconf operation %s already present", netconfOperation);
- result.add(netconfOperation);
- }
- }
- return Collections.unmodifiableSet(result);
- }
-
- private static TreeSet<NetconfOperationFilter> getAllNetconfFilters(Set<NetconfOperationFilter> defaultFilters,
- NetconfOperationServiceSnapshot netconfOperationServiceSnapshot) {
- TreeSet<NetconfOperationFilter> result = new TreeSet<>(defaultFilters);
- for (NetconfOperationService netconfOperationService : netconfOperationServiceSnapshot.getServices()) {
- final Set<NetconfOperationFilter> filtersFromService = netconfOperationService.getFilters();
- for (NetconfOperationFilter filter : filtersFromService) {
- Preconditions.checkState(result.contains(filter) == false,
- "Filter %s already present, all filters so far: %s", filter, result);
- result.add(filter);
- }
- }
- return result;
- }
-
- public CapabilityProvider getCapabilityProvider() {
- return capabilityProvider;