for now, NoPacketProcessingService; figure out openflowplugin later..
authorMichael Vorburger <mike@vorburger.ch>
Wed, 31 Jan 2018 00:44:09 +0000 (01:44 +0100)
committerMichael Vorburger <mike@vorburger.ch>
Wed, 1 Jul 2020 23:30:06 +0000 (01:30 +0200)
Signed-off-by: Michael Vorburger <mike@vorburger.ch>
src/main/java/org/opendaylight/openflowplugin/simple/OpenFlowPluginWiring.java
src/test/java/org/opendaylight/openflowplugin/simple/test/OpenFlowPluginWiringTest.java

index 01e3a602509ea144b8931d5333b957363855e6dc..51a2776f89a125199c637794eb173ef6b5d15154 100644 (file)
@@ -8,26 +8,38 @@
 package org.opendaylight.openflowplugin.simple;
 
 import com.google.inject.AbstractModule;
+import java.util.concurrent.Future;
 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginProviderFactory;
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationServiceFactory;
 import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
 import org.opendaylight.openflowplugin.impl.OpenFlowPluginProviderFactoryImpl;
 import org.opendaylight.openflowplugin.impl.configuration.ConfigurationServiceFactoryImpl;
 import org.opendaylight.openflowplugin.impl.mastership.MastershipChangeServiceManagerImpl;
-import org.opendaylight.openflowplugin.impl.services.sal.PacketProcessingServiceImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.TransmitPacketInput;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public class OpenFlowPluginWiring extends AbstractModule {
 
     @Override
     protected void configure() {
-        // TODO <odl:action-provider interface="org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService"/>
-        bind(PacketProcessingService.class).to(PacketProcessingServiceImpl.class);
+        bind(PacketProcessingService.class).to(NoPacketProcessingService.class);
 
-        // TODO need to use newInstance? But then why does class have public no arg constructor..
         bind(OpenFlowPluginProviderFactory.class).to(OpenFlowPluginProviderFactoryImpl.class);
         bind(ConfigurationServiceFactory.class).to(ConfigurationServiceFactoryImpl.class);
         bind(MastershipChangeServiceManager.class).to(MastershipChangeServiceManagerImpl.class);
     }
 
+    private static class NoPacketProcessingService implements PacketProcessingService {
+
+        // TODO <odl:action-provider
+        // interface="org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService"/>
+        // bind(PacketProcessingService.class).to(PacketProcessingServiceImpl.class);
+
+        @Override
+        public Future<RpcResult<Void>> transmitPacket(TransmitPacketInput input) {
+            throw new UnsupportedOperationException("TODO Implement me...");
+        }
+
+    }
 }
index fcc192c14f66679a81cb21845051fe1a044eafba..10b0837347d25efea593195cb68cb03711213fde 100644 (file)
@@ -8,12 +8,13 @@
 package org.opendaylight.openflowplugin.simple.test;
 
 import org.junit.Rule;
+import org.opendaylight.infrautils.inject.guice.testutils.AnnotationsModule;
 import org.opendaylight.infrautils.inject.guice.testutils.GuiceRule;
 import org.opendaylight.infrautils.simple.testutils.AbstractSimpleDistributionTest;
 import org.opendaylight.openflowplugin.simple.OpenFlowPluginWiring;
 
 public class OpenFlowPluginWiringTest extends AbstractSimpleDistributionTest {
 
-    public @Rule GuiceRule guice = new GuiceRule(OpenFlowPluginWiring.class);
+    public @Rule GuiceRule guice = new GuiceRule(OpenFlowPluginWiring.class, AnnotationsModule.class);
 
 }