@Override
public ListenableFuture<Boolean> startup() {
LOGGER.debug("Startup summoned");
- serverFacade = createAndConfigureServer();
-
- LOGGER.debug("Starting ..");
ListenableFuture<Boolean> result = null;
try {
- if (serverFacade == null) {
- throw new IllegalStateException("No server configured");
- }
- if (serverFacade.getIsOnlineFuture().isDone()) {
- throw new IllegalStateException("Server already running");
- }
+ serverFacade = createAndConfigureServer();
if (switchConnectionHandler == null) {
- throw new IllegalStateException("switchConnectionHandler is not set");
+ throw new IllegalStateException("SwitchConnectionHandler is not set");
}
new Thread(serverFacade).start();
result = serverFacade.getIsOnlineFuture();
if (transportProtocol.equals(TransportProtocol.TCP) || transportProtocol.equals(TransportProtocol.TLS)) {
server = new TcpHandler(connConfig.getAddress(), connConfig.getPort());
((TcpHandler) server).setChannelInitializer(factory.createPublishingChannelInitializer());
- } else {
+ } else if (transportProtocol.equals(TransportProtocol.UDP)){
server = new UdpHandler(connConfig.getAddress(), connConfig.getPort());
((UdpHandler) server).setChannelInitializer(factory.createUdpChannelInitializer());
+ } else {
+ throw new IllegalStateException("Unknown transport protocol received: " + transportProtocol);
}
server.setThreadConfig(connConfig.getThreadConfiguration());
return server;
package org.opendaylight.openflowjava.protocol.impl.serialization;\r
\r
import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;\r
+import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.BarrierInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.EchoInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.EchoReplyInputMessageFactory;\r
+import org.opendaylight.openflowjava.protocol.impl.serialization.factories.ExperimenterInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.GetAsyncRequestMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.GetConfigInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.SetConfigMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.serialization.factories.TableModInputMessageFactory;\r
import org.opendaylight.openflowjava.protocol.impl.util.CommonMessageRegistryHelper;\r
-import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;\r
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowModInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetAsyncInput;\r
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetConfigInput;\r
registryHelper.registerSerializer(BarrierInput.class, new OF10BarrierInputMessageFactory());\r
registryHelper.registerSerializer(EchoInput.class, new EchoInputMessageFactory());\r
registryHelper.registerSerializer(EchoReplyInput.class, new EchoReplyInputMessageFactory());\r
+ registryHelper.registerSerializer(ExperimenterInput.class, new ExperimenterInputMessageFactory());\r
registryHelper.registerSerializer(FlowModInput.class, new OF10FlowModInputMessageFactory());\r
registryHelper.registerSerializer(GetConfigInput.class, new GetConfigInputMessageFactory());\r
registryHelper.registerSerializer(GetFeaturesInput.class, new GetFeaturesInputMessageFactory());\r
registryHelper.registerSerializer(BarrierInput.class, new BarrierInputMessageFactory());\r
registryHelper.registerSerializer(EchoInput.class, new EchoInputMessageFactory());\r
registryHelper.registerSerializer(EchoReplyInput.class, new EchoReplyInputMessageFactory());\r
+ registryHelper.registerSerializer(ExperimenterInput.class, new ExperimenterInputMessageFactory());\r
registryHelper.registerSerializer(FlowModInput.class, new FlowModInputMessageFactory());\r
registryHelper.registerSerializer(GetAsyncInput.class, new GetAsyncRequestMessageFactory());\r
registryHelper.registerSerializer(GetConfigInput.class, new GetConfigInputMessageFactory());\r