public static Optional<InetSocketAddress> extractNetconfServerAddress(final BundleContext context,
final InfixProp infixProp) {
final Optional<String> address = getProperty(context, getNetconfServerAddressKey(infixProp));
final Optional<String> port = getProperty(context, PREFIX_PROP + infixProp + PORT_SUFFIX_PROP);
if (address.isPresent() && port.isPresent()) {
try {
return Optional.of(parseAddress(address, port));
} catch (final RuntimeException e) {
LOG.warn("Unable to parse {} netconf address from {}:{}, fallback to default",
infixProp, address, port, e);
}
}
return Optional.absent();
}