- final String sessionId = netconfOperationServiceSnapshot.getNetconfSessionIdForReporting();
-
- final Set<NetconfOperation> defaultNetconfOperations = Sets.newHashSet();
- defaultNetconfOperations.add(new DefaultGetSchema(capabilityProvider, sessionId));
- defaultNetconfOperations.add(new DefaultCloseSession(sessionId, router));
- defaultNetconfOperations.add(new DefaultStartExi(sessionId));
- defaultNetconfOperations.add(new DefaultStopExi(sessionId));
- defaultNetconfOperations.add(new DefaultCommit(commitNotifier, capabilityProvider, sessionId, router));
-
- router.initNetconfOperations(getAllNetconfOperations(defaultNetconfOperations, netconfOperationServiceSnapshot));
-
- return router;
- }
-
- 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),
- "Netconf operation %s already present", netconfOperation);
- result.add(netconfOperation);
- }
- }
- return Collections.unmodifiableSet(result);