- contexts.forEach((instanceIdentifier, netconfTopologyContext) -> {
- try {
- netconfTopologyContext.closeFinal();
- } catch (final Exception e) {
- LOG.error("Error at closing topology context. InstanceIdentifier: " + instanceIdentifier, e);
- }
- });
- clusterRegistrations.forEach((instanceIdentifier, clusterSingletonServiceRegistration) -> {
- try {
- clusterSingletonServiceRegistration.close();
- } catch (final Exception e) {
- LOG.error("Error at unregistering from cluster. InstanceIdentifier: " + instanceIdentifier, e);
- }
- });
+
+ contexts.values().forEach(netconfTopologyContext -> close(netconfTopologyContext));
+
+ clusterRegistrations.values().forEach(
+ clusterSingletonServiceRegistration -> close(clusterSingletonServiceRegistration));
+