protected final static String CONNECTION_TYPE = "ovsdbserver.connection";
protected final static String CONNECTION_TYPE_ACTIVE = "active";
protected final static String CONNECTION_TYPE_PASSIVE = "passive";
+ protected final static int CONNECTION_INIT_TIMEOUT = 10000;
protected final static String DEFAULT_SERVER_PORT = "6640";
params.put(ConnectionConstants.PORT, portStr);
return connection.connect(IDENTIFIER, params);
} else if (connectionType.equalsIgnoreCase(CONNECTION_TYPE_PASSIVE)) {
- // Wait for 10 seconds for the Passive connection to be initiated by the ovsdb-server.
- Thread.sleep(10000);
+ // Wait for CONNECTION_INIT_TIMEOUT for the Passive connection to be initiated by the ovsdb-server.
+ Thread.sleep(CONNECTION_INIT_TIMEOUT);
List<Node> nodes = connection.getNodes();
assertNotNull(nodes);
assertTrue(nodes.size() > 0);
}
if (debugit) {
log.debug("Do some debugging because some bundle is unresolved");
+ Thread.sleep(600000);
}
// Assert if true, if false we are good to go!
org.opendaylight.controller.sal.action,
org.opendaylight.ovsdb.plugin,
org.opendaylight.ovsdb.lib.notation,
- org.opendaylight.ovsdb.lib.table,
org.opendaylight.controller.sal.binding.api,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819,
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes,
org.opendaylight.controller.sal.authorization,
org.opendaylight.ovsdb.plugin,
org.opendaylight.ovsdb.lib,
- org.opendaylight.ovsdb.lib.table,
org.opendaylight.ovsdb.lib.jsonrpc,
org.opendaylight.ovsdb.lib.notation,
- org.opendaylight.ovsdb.lib.database,
org.opendaylight.ovsdb.lib.operations,
org.opendaylight.ovsdb.lib.message,
org.opendaylight.ovsdb.lib.schema,
org.opendaylight.controller.sal.connection,
org.opendaylight.controller.clustering.services,
org.opendaylight.controller.sal.networkconfig.bridgedomain,
- org.opendaylight.ovsdb.lib.table,
org.opendaylight.ovsdb.lib.notation,
- org.opendaylight.ovsdb.lib.database,
org.opendaylight.ovsdb.lib.operations,
org.opendaylight.ovsdb.lib.message,
org.opendaylight.ovsdb.schema.openvswitch,
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
-import com.google.common.collect.ImmutableSet;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.sal.utils.Status;
import org.opendaylight.controller.sal.utils.StatusCode;
import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.ovsdb.lib.database.OvsdbType;
import org.opendaylight.ovsdb.lib.notation.Column;
import org.opendaylight.ovsdb.lib.notation.Mutator;
import org.opendaylight.ovsdb.lib.notation.OvsDBSet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.collect.ImmutableSet;
import com.google.common.util.concurrent.ListenableFuture;
public class ConfigurationService implements IPluginInBridgeDomainConfigService, OVSDBConfigService,
if (type != null) {
logger.debug("Port type : " + type);
- if (type.equalsIgnoreCase(OvsdbType.PortType.VLAN.name())) {
+ if (type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.VLAN.name())) {
tags = new HashSet<BigInteger>();
tags.add(BigInteger.valueOf(Integer.parseInt((String)configs.get(ConfigConstants.VLAN))));
}
if (type != null) {
logger.debug("Interface type : " + type);
- if (type.equalsIgnoreCase(OvsdbType.PortType.TUNNEL.name())) {
+ if (type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.TUNNEL.name())) {
interfaceRow.setType((String)configs.get(ConfigConstants.TUNNEL_TYPE));
if (options == null) options = new HashMap<String, String>();
options.put("remote_ip", (String)configs.get(ConfigConstants.DEST_IP));
- } else if (type.equalsIgnoreCase(OvsdbType.PortType.PATCH.name()) ||
- type.equalsIgnoreCase(OvsdbType.PortType.INTERNAL.name())) {
+ } else if (type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.PATCH.name()) ||
+ type.equalsIgnoreCase(OvsVswitchdSchemaConstants.PortType.INTERNAL.name())) {
interfaceRow.setType(type.toLowerCase());
}
}
if (autoConfigureController && databaseName.equals(DATABASE_NAME) && tableName.equals("Bridge")) return true;
return false;
}
+
+ public enum PortType {
+ VLAN("vlan"),
+ TUNNEL("Tunnel"),
+ BONDING("Bonding"),
+ PATCH("patch"),
+ INTERNAL("internal");
+
+ private PortType(String name) {
+ this.name = name;
+ }
+
+ private String name;
+
+ @Override
+ public String toString() {
+ return name;
+ }
+ }
+
}