*/
package org.opendaylight.ovsdb.southbound;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FluentFuture;
import java.net.InetAddress;
import java.net.NetworkInterface;
}
public static Optional<OvsdbNodeAugmentation> getManagingNode(DataBroker db, OvsdbBridgeAttributes mn) {
- Preconditions.checkNotNull(mn);
+ requireNonNull(mn);
try {
OvsdbNodeRef ref = mn.getManagedBy();
if (ref != null && ref.getValue() != null) {
// Note: erasure makes this safe in combination with the typecheck below
InstanceIdentifier<Node> path = (InstanceIdentifier<Node>) ref.getValue();
- FluentFuture<Optional<Node>> nf = transaction.read(
- LogicalDatastoreType.OPERATIONAL, path);
+ FluentFuture<Optional<Node>> nf = transaction.read(LogicalDatastoreType.OPERATIONAL, path);
transaction.close();
Optional<Node> optional = nf.get();
if (optional != null && optional.isPresent()) {
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Read Operational/DS for Node failed! {}", connectionIid, e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
return node;
}
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Read Operational/DS for Node failed! {}", connectionIid, e);
- throw new RuntimeException(e);
+ throw new IllegalStateException(e);
}
return node;
}