+ private Pattern getIgnoredCapabilitiesProperty(PropertiesProviderBaseImpl propertiesProvider) {
+ String regexProperty = propertiesProvider.getProperty(IGNORED_MISSING_CAPABILITY_REGEX_SUFFIX);
+ String regex;
+ if (regexProperty != null) {
+ regex = regexProperty;
+ } else {
+ regex = DEFAULT_IGNORED_REGEX;
+ }
+ return Pattern.compile(regex);
+ }
+
+ private Optional<Long> getMaxWaitForCapabilitiesProperty(PropertiesProviderBaseImpl propertiesProvider) {
+ String timeoutProperty = propertiesProvider.getProperty(MAX_WAIT_FOR_CAPABILITIES_MILLIS);
+ return Optional.fromNullable(timeoutProperty == null ? null : Long.valueOf(timeoutProperty));
+ }
+
+ private ConfigPusherConfiguration getConfigurationForPusher(BundleContext context,
+ PropertiesProviderBaseImpl propertiesProvider) {
+
+ // If configuration was injected via constructor, use it
+ if(initialConfigForPusher.isPresent())
+ return initialConfigForPusher.get();
+
+ Optional<Long> maxWaitForCapabilitiesMillis = getMaxWaitForCapabilitiesProperty(propertiesProvider);
+ final InetSocketAddress address = NetconfConfigUtil.extractTCPNetconfAddress(context,
+ "Netconf is not configured, persister is not operational", true);
+
+ nettyThreadGroup = new NioEventLoopGroup();
+
+ ConfigPusherConfigurationBuilder configPusherConfigurationBuilder = ConfigPusherConfigurationBuilder.aConfigPusherConfiguration();
+
+ if(maxWaitForCapabilitiesMillis.isPresent())
+ configPusherConfigurationBuilder.withNetconfCapabilitiesWaitTimeoutMs(maxWaitForCapabilitiesMillis.get());
+
+ return configPusherConfigurationBuilder
+ .withEventLoopGroup(nettyThreadGroup)
+ .withNetconfAddress(address)
+ .build();
+ }
+