import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo;
import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo.ConnectionType;
import org.opendaylight.ovsdb.lib.OvsdbConnectionInfo.SocketConnectionType;
+import org.opendaylight.ovsdb.lib.error.ParsingException;
import org.opendaylight.ovsdb.lib.jsonrpc.Params;
import org.opendaylight.ovsdb.lib.message.MonitorRequest;
import org.opendaylight.ovsdb.lib.message.OvsdbRPC;
} else if (schema.size() == 1) {
sfuture.set(schema);
}
- } catch (Exception e) {
+ } catch (ParsingException e) {
LOG.warn("Failed to populate schema {}:{}", dbNames, schema, e);
sfuture.setException(e);
}
Channel channel = future.channel();
return getChannelClient(channel, ConnectionType.ACTIVE, SocketConnectionType.SSL);
} catch (InterruptedException e) {
- LOG.warn("Thread was interrupted during connect", e);
- } catch (Exception e) {
- LOG.warn("bootstrap.connect failed", e);
+ LOG.warn("Failed to connect {}:{}", address, port, e);
}
return null;
}
public final Channel channel;
private int retryTimes;
- public HandleNewPassiveSslRunner(Channel channel, SslHandler sslHandler) {
+ HandleNewPassiveSslRunner(Channel channel, SslHandler sslHandler) {
this.channel = channel;
this.sslHandler = sslHandler;
this.retryTimes = 3;
return Reflection.newProxy(klazz, new InvocationHandler() {
@Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
if (method.getName().equals(OvsdbRPC.REGISTER_CALLBACK_METHOD)) {
if ((args == null) || args.length != 1 || !(args[0] instanceof OvsdbRPC.Callback)) {
return false;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.reflect.Invokable;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
Invokable<E, E> invokable = Invokable.from(declaredConstructor);
try {
return invokable.invoke(null, table);
- } catch (Exception e) {
+ } catch (InvocationTargetException | IllegalAccessException e) {
String message = String.format("Not able to create instance of class %s using public constructor "
+ "that accepts TableSchema object", clazz);
throw new IllegalArgumentException(message, e);
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
try {
Constructor<E> instance = clazz.getConstructor(TableSchema.class);
return instance.newInstance(this);
- } catch (Exception e) {
+ } catch (InstantiationException | IllegalAccessException
+ | InvocationTargetException | NoSuchMethodException e) {
throw new RuntimeException("exception constructing instance of clazz " + clazz, e);
}
}
}
@Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
+ public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
if (isGetTableSchema(method)) {
return processGetTableSchema();
} else if (isGetRow(method)) {
@Override public String toString() {
String tableName;
- try {
- TableSchema<?> schema = (TableSchema<?>)processGetTableSchema();
+ TableSchema<?> schema = (TableSchema<?>)processGetTableSchema();
+ if (schema != null) {
tableName = schema.getName();
- } catch (Exception e) {
+ } else {
tableName = "";
}
if (row == null) {