private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceFactory.class);
@Override
- public ConfigurationService newInstance(final OpenflowProviderConfig providerConfig, final BundleContext bundleContext) {
+ public ConfigurationService newInstance(
+ final OpenflowProviderConfig providerConfig,
+ final BundleContext bundleContext) {
return new ConfigurationServiceImpl(providerConfig, bundleContext);
}
.build());
LOG.info("Loading configuration from '{}' configuration file", OFConstants.CONFIG_FILE_ID);
- Optional.ofNullable(bundleContext.getServiceReference(ConfigurationAdmin.class)).ifPresent(serviceReference -> {
- final ConfigurationAdmin configurationAdmin = bundleContext.getService(serviceReference);
-
- try {
- final Configuration configuration = configurationAdmin.getConfiguration(OFConstants.CONFIG_FILE_ID);
-
- Optional.ofNullable(configuration.getProperties()).ifPresent(properties -> {
- final Enumeration<String> keys = properties.keys();
- final Map<String, String> mapProperties = new HashMap<>(properties.size());
-
- while (keys.hasMoreElements()) {
- final String key = keys.nextElement();
- final String value = properties.get(key).toString();
- mapProperties.put(key, value);
+ Optional.ofNullable(bundleContext.getServiceReference(ConfigurationAdmin.class))
+ .ifPresent(serviceReference -> {
+ final ConfigurationAdmin configurationAdmin = bundleContext.getService(serviceReference);
+
+ try {
+ final Configuration configuration
+ = configurationAdmin.getConfiguration(OFConstants.CONFIG_FILE_ID);
+
+ Optional.ofNullable(configuration.getProperties()).ifPresent(properties -> {
+ final Enumeration<String> keys = properties.keys();
+ final Map<String, String> mapProperties = new HashMap<>(properties.size());
+
+ while (keys.hasMoreElements()) {
+ final String key = keys.nextElement();
+ final String value = properties.get(key).toString();
+ mapProperties.put(key, value);
+ }
+
+ update(mapProperties);
+ });
+ } catch (IOException e) {
+ LOG.debug("Failed to load {} configuration file. Error {}", OFConstants.CONFIG_FILE_ID, e);
}
-
- update(mapProperties);
});
- } catch (IOException e) {
- LOG.debug("Failed to load {} configuration file. Error {}", OFConstants.CONFIG_FILE_ID, e);
- }
- });
}
@Override
return;
}
- LOG.info("{} configuration property was changed from '{}' to '{}'", propertyName, originalValue, newValue);
+ LOG.info("{} configuration property was changed from '{}' to '{}'",
+ propertyName,
+ originalValue,
+ newValue);
} else {
if (Objects.isNull(newValue)) {
return;