import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import java.net.ConnectException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
LOG.trace("HwvtepConnectionManager exit disconnected client: {}", client);
}
- public OvsdbClient connect(InstanceIdentifier<Node> iid, HwvtepGlobalAugmentation hwvtepGlobal) throws UnknownHostException {
+ public OvsdbClient connect(InstanceIdentifier<Node> iid,
+ HwvtepGlobalAugmentation hwvtepGlobal) throws UnknownHostException, ConnectException {
LOG.info("Connecting to {}", HwvtepSouthboundUtil.connectionInfoToString(hwvtepGlobal.getConnectionInfo()));
InetAddress ip = HwvtepSouthboundMapper.createInetAddress(hwvtepGlobal.getConnectionInfo().getRemoteIp());
OvsdbClient client = OvsdbConnectionService.getService()
package org.opendaylight.ovsdb.hwvtepsouthbound;
+import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
} else {
try {
OvsdbClient client = hcm.connect(key, hwvtepGlobal);
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Failed to connect to HWVTEP node", e);
}
}
if (newClient == null) {
hcm.reconcileConnection(key, hgUpdated);
}
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Failed to update connection on HWVTEP Node", e);
}
}
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicInteger;
LOG.warn("Connection retry({}) failed for {}.",
connectionAttempt.get(), hwvtepNode.getConnectionInfo());
}
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Connection retry({}) failed with exception. ",connectionAttempt.get(), e);
}
return result;
OvsdbRPC rpc = factory.getClient(channel, OvsdbRPC.class);
OvsdbClientImpl client = new OvsdbClientImpl(rpc, channel, type, socketConnType);
+ client.setConnectionPublished(true);
connections.put(client, channel);
ChannelFuture closeFuture = channel.closeFuture();
closeFuture.addListener(new ChannelConnectionHandler(client));
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
+
+import java.net.ConnectException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
}
public OvsdbClient connect(InstanceIdentifier<Node> iid,
- OvsdbNodeAugmentation ovsdbNode) throws UnknownHostException {
+ OvsdbNodeAugmentation ovsdbNode) throws UnknownHostException, ConnectException {
LOG.info("Connecting to {}", SouthboundUtil.connectionInfoToString(ovsdbNode.getConnectionInfo()));
// TODO handle case where we already have a connection
package org.opendaylight.ovsdb.southbound;
+import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.HashMap;
InstanceIdentifier<Node> instanceIdentifier = change.getRootPath().getRootIdentifier();
cm.connect(instanceIdentifier, ovsdbNode);
LOG.info("OVSDB node has been connected: {}",ovsdbNode);
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Failed to connect to ovsdbNode", e);
}
}
cm.disconnect(ovsdbNodeModification.getDataBefore());
cm.connect(change.getRootPath().getRootIdentifier(), ovsdbNodeModification
.getDataAfter());
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Error disconnecting from or connecting to ovsdbNode", e);
}
}
*/
package org.opendaylight.ovsdb.southbound.reconciliation.connection;
+import java.net.ConnectException;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicInteger;
import org.opendaylight.ovsdb.lib.OvsdbClient;
LOG.warn("Connection retry({}) failed for {}.",
connectionAttempt.get(), ovsdbNode.getConnectionInfo());
}
- } catch (UnknownHostException e) {
+ } catch (UnknownHostException | ConnectException e) {
LOG.warn("Connection retry({}) failed with exception. ",connectionAttempt.get(), e);
}
return result;