import org.opendaylight.openflowjava.protocol.api.connection.ConnectionAdapter;
import org.opendaylight.openflowjava.protocol.api.connection.ConnectionReadyListener;
import org.opendaylight.openflowplugin.openflow.md.core.session.OFSessionUtil;
+import org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil;
import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
import org.opendaylight.openflowplugin.openflow.md.core.session.SessionManager;
import org.opendaylight.openflowplugin.openflow.md.queue.QueueKeeper;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OpenflowProtocolListener;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PacketInMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestDescBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestGroupFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestMeterFeaturesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortDescBuilder;
private HandshakeManager handshakeManager;
private boolean firstHelloProcessed;
+
+ private PortFeaturesUtil portFeaturesUtils;
/**
* @param connectionAdapter
ConnectionConductor.versionOrder.get(0), ConnectionConductor.versionOrder);
handshakeManager.setUseVersionBitmap(isBitmapNegotiationEnable);
handshakeManager.setHandshakeListener(this);
+ portFeaturesUtils = PortFeaturesUtil.getInstance();
}
@Override
@Override
public void onPortStatusMessage(PortStatusMessage message) {
- this.getSessionContext().processPortStatusMsg(message);
+ processPortStatusMsg(message);
queueKeeper.push(message, this);
}
+
+ protected void processPortStatusMsg(PortStatus msg) {
+ if (msg.getReason().getIntValue() == 2) {
+ updatePort(msg);
+ } else if (msg.getReason().getIntValue() == 0) {
+ updatePort(msg);
+ } else if (msg.getReason().getIntValue() == 1) {
+ deletePort(msg);
+ }
+ }
+
+ protected void updatePort(PortStatus msg) {
+ Long portNumber = msg.getPortNo();
+ Boolean portBandwidth = portFeaturesUtils.getPortBandwidth(msg);
+
+ if(portBandwidth == null) {
+ LOG.warn("can't get bandwidth info from port: {}, aborting port update", msg.toString());
+ } else {
+ this.getSessionContext().getPhysicalPorts().put(portNumber, msg);
+ this.getSessionContext().getPortsBandwidth().put(portNumber, portBandwidth);
+ }
+ }
+
+ protected void deletePort(Port port) {
+ Long portNumber = port.getPortNo();
+
+ this.getSessionContext().getPhysicalPorts().remove(portNumber);
+ this.getSessionContext().getPortsBandwidth().remove(portNumber);
+ }
@Override
public void onSwitchIdleEvent(SwitchIdleEvent notification) {
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.session;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
+
+/**
+ *
+ * @author jsebin
+ *
+ * Singleton for extracting port features for OF 1.0
+ */
+public class FeaturesV10Bandwidth implements IGetBandwith {
+
+ private static FeaturesV10Bandwidth instance = new FeaturesV10Bandwidth();
+
+ private FeaturesV10Bandwidth() {}
+
+ /**
+ *
+ * @return instance of class
+ */
+ public static FeaturesV10Bandwidth getInstance(){
+ return instance;
+ }
+
+ @Override
+ public boolean getBandwidth(Port port) {
+ return (port.getCurrentFeaturesV10().is_100mbFd() | port.getCurrentFeaturesV10().is_100mbHd() | port.getCurrentFeaturesV10().is_10gbFd() |
+ port.getCurrentFeaturesV10().is_10mbFd() | port.getCurrentFeaturesV10().is_10mbHd() | port.getCurrentFeaturesV10().is_1gbFd() |
+ port.getCurrentFeaturesV10().is_1gbHd() | port.getCurrentFeaturesV10().isAutoneg() | port.getCurrentFeaturesV10().isCopper() |
+ port.getCurrentFeaturesV10().isFiber() | port.getCurrentFeaturesV10().isPause() | port.getCurrentFeaturesV10().isPauseAsym());
+ }
+
+
+
+}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.session;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
+
+/**
+ *
+ * @author jsebin
+ *
+ * Singleton for extracting port features for OF 1.3
+ */
+public class FeaturesV13Bandwidth implements IGetBandwith {
+
+ private static FeaturesV13Bandwidth instance = new FeaturesV13Bandwidth();
+
+ private FeaturesV13Bandwidth() {}
+
+ /**
+ *
+ * @return instance of class
+ */
+ public static FeaturesV13Bandwidth getInstance(){
+ return instance;
+ }
+
+ @Override
+ public boolean getBandwidth(Port port) {
+ return (port.getCurrentFeatures().is_100gbFd() | port.getCurrentFeatures().is_100mbFd() | port.getCurrentFeatures().is_100mbHd() |
+ port.getCurrentFeatures().is_10gbFd() | port.getCurrentFeatures().is_10mbFd() | port.getCurrentFeatures().is_10mbHd() |
+ port.getCurrentFeatures().is_1gbFd() | port.getCurrentFeatures().is_1gbHd() | port.getCurrentFeatures().is_1tbFd() |
+ port.getCurrentFeatures().is_40gbFd() | port.getCurrentFeatures().isAutoneg() | port.getCurrentFeatures().isCopper() |
+ port.getCurrentFeatures().isFiber() | port.getCurrentFeatures().isOther() | port.getCurrentFeatures().isPause() |
+ port.getCurrentFeatures().isPauseAsym());
+ }
+
+}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.session;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
+
+/**
+ * Utility for extracting bandwith from port according to port version
+ *
+ * @author jsebin
+ *
+ */
+public interface IGetBandwith {
+
+ /**
+ *
+ * @param port
+ * @return port bandwidth
+ */
+ public boolean getBandwidth(Port port);
+}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.session;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Wrapper for bandwidth extracting utilities
+ *
+ * @author jsebin
+ *
+ */
+public class PortFeaturesUtil {
+
+ private static PortFeaturesUtil instance = new PortFeaturesUtil();
+
+ private final Map<Short, IGetBandwith> portVersionBandwidth;
+ protected static final Logger LOG = LoggerFactory.getLogger(PortFeaturesUtil.class);
+
+ private PortFeaturesUtil() {
+ this.portVersionBandwidth = new HashMap<>();
+
+ portVersionBandwidth.put((short) 1, FeaturesV10Bandwidth.getInstance());
+ portVersionBandwidth.put((short) 4, FeaturesV13Bandwidth.getInstance());
+ }
+
+ /**
+ *
+ * @return instance
+ */
+ public static PortFeaturesUtil getInstance() {
+ return instance;
+ }
+
+ /**
+ *
+ * @param msg {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus}
+ * @return port bandwidth
+ */
+ public Boolean getPortBandwidth(PortStatus msg) {
+
+ if(portVersionBandwidth.containsKey(msg.getVersion()) == true) {
+ try {
+ return portVersionBandwidth.get(msg.getVersion()).getBandwidth(msg);
+ } catch (NullPointerException e) {
+ LOG.error("error while getting port features {}", e);
+ }
+ }
+ else {
+ LOG.warn("unknown port version: {}", msg.getVersion());
+ }
+
+ return null;
+ }
+
+}
* @return The Map of OFPhysicalPort
*/
public Map<Long, Port> getPhysicalPorts();
+
+ /**
+ * Returns a map containing all bandwidths for all OFPorts of this switch.
+ * @return The Map of bandwidths for all OFPorts
+ */
+ public Map<Long, Boolean> getPortsBandwidth();
/**
* Returns a Set containing all port IDs of this switch.
*/
public List<Port> getEnabledPorts();
- public void processPortStatusMsg(PortStatus arg0);
-
-
// TODO:: add listeners here, manager will set them and conductor use them
/**
import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.GetFeaturesOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Port;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatus;
/**
* @author mirehak
public Map<Long, Port> getPhysicalPorts() {
return this.physicalPorts;
}
+
+ @Override
+ public Map<Long, Boolean> getPortsBandwidth() {
+ return this.portBandwidth;
+ }
@Override
public Set<Long> getPorts() {
}
return result;
}
-
- @Override
- public void processPortStatusMsg(PortStatus msg) {
- Port port = msg;
- if (msg.getReason().getIntValue() == 2) {
- updatePhysicalPort(port);
- } else if (msg.getReason().getIntValue() == 0) {
- updatePhysicalPort(port);
- } else if (msg.getReason().getIntValue() == 1) {
- deletePhysicalPort(port);
- }
-
- }
-
- private void updatePhysicalPort(Port port) {
- Long portNumber = port.getPortNo();
- physicalPorts.put(portNumber, port);
- portBandwidth
- .put(portNumber,
- ( (port.getCurrentFeatures().is_100gbFd())
- |(port.getCurrentFeatures().is_100mbFd()) | (port.getCurrentFeatures().is_100mbHd())
- | (port.getCurrentFeatures().is_10gbFd()) | (port.getCurrentFeatures().is_10mbFd())
- | (port.getCurrentFeatures().is_10mbHd()) | (port.getCurrentFeatures().is_1gbFd())
- | (port.getCurrentFeatures().is_1gbHd()) | (port.getCurrentFeatures().is_1tbFd())
- | (port.getCurrentFeatures().is_40gbFd()) | (port.getCurrentFeatures().isAutoneg())
- | (port.getCurrentFeatures().isCopper()) | (port.getCurrentFeatures().isFiber())
- | (port.getCurrentFeatures().isOther()) | (port.getCurrentFeatures().isPause())
- | (port.getCurrentFeatures().isPauseAsym()) ) );
- }
-
- private void deletePhysicalPort(Port port) {
- Long portNumber = port.getPortNo();
- physicalPorts.remove(portNumber);
- portBandwidth.remove(portNumber);
- }
}
import org.opendaylight.openflowplugin.openflow.md.core.plan.EventFactory;
import org.opendaylight.openflowplugin.openflow.md.core.plan.SwitchTestEvent;
import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
+import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContextOFImpl;
import org.opendaylight.openflowplugin.openflow.md.queue.PopListener;
import org.opendaylight.openflowplugin.openflow.md.queue.QueueKeeperLightImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.Capabilities;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ErrorType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.HelloElementType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortReason;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoRequestMessageBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage;
return translatorMapping;
}
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.ConnectionConductorImpl#processPortStatusMsg(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessage)}
+ * <br><br>
+ * Tests for getting features from port status message by port version
+ * <ul>
+ * <li>features are malformed - one of them is null</li>
+ * <li>mismatch between port version and port features</li>
+ * <li>mismatch between port version and port features</li>
+ * <li>non-existing port version</li>
+ * <li>port version OF 1.0</li>
+ * <li>port version OF 1.3</li>
+ * </ul>
+ *
+ */
+ @Test
+ public void testProcessPortStatusMsg() {
+ SessionContextOFImpl ctx = new SessionContextOFImpl();
+ connectionConductor.setSessionContext(ctx);
+
+ long portNumber = 90L;
+ long portNumberV10 = 91L;
+ PortStatusMessage msg;
+
+ PortStatusMessageBuilder builder = new PortStatusMessageBuilder();
+ PortFeatures features = new PortFeatures(true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false);
+ PortFeatures featuresMal = new PortFeatures(true,false,false,false,null,false,false,false,false,false,false,false,false,false,false,false);
+ PortFeaturesV10 featuresV10 = new PortFeaturesV10(true,false,false,false,false,false,false,false,false,false,false,false);
+
+ //Malformed features
+ builder.setVersion((short) 1).setPortNo(portNumber).setReason(PortReason.OFPPRADD).setCurrentFeatures(featuresMal);
+ connectionConductor.processPortStatusMsg(builder.build());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPortsBandwidth().isEmpty());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPhysicalPorts().isEmpty());
+
+ //Version-features mismatch
+ builder.setCurrentFeatures(features);
+ connectionConductor.processPortStatusMsg(builder.build());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPortsBandwidth().isEmpty());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPhysicalPorts().isEmpty());
+
+ //Non existing version
+ builder.setVersion((short) 0);
+ connectionConductor.processPortStatusMsg(builder.build());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPortsBandwidth().isEmpty());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPhysicalPorts().isEmpty());
+
+ //Version OF 1.3
+ builder.setVersion((short) 4);
+ msg = builder.build();
+ connectionConductor.processPortStatusMsg(builder.build());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPortBandwidth(portNumber));
+ Assert.assertEquals(connectionConductor.getSessionContext().getPhysicalPort(portNumber), msg);
+
+ //Version OF 1.0
+ builder.setVersion((short) 1).setPortNo(portNumberV10).setCurrentFeatures(null).setCurrentFeaturesV10(featuresV10);
+ msg = builder.build();
+ connectionConductor.processPortStatusMsg(builder.build());
+ Assert.assertTrue(connectionConductor.getSessionContext().getPortBandwidth(portNumberV10));
+ Assert.assertEquals(connectionConductor.getSessionContext().getPhysicalPort(portNumberV10), msg);
+ }
}
}
@Override
- public void processPortStatusMsg(PortStatus arg0) {
+ public Map<Long, Boolean> getPortsBandwidth() {
// TODO Auto-generated method stub
-
+ return null;
}
}
--- /dev/null
+/**
+ * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.openflowplugin.openflow.md.core.session;
+
+import junit.framework.Assert;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeatures;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortFeaturesV10;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortReason;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder;
+
+/**
+ * @author jsebin
+ */
+public class PortFeaturesUtilTest {
+
+ private PortStatusMessageBuilder portStatusMessageBuilder;
+ private PortFeaturesUtil portUtil;
+
+
+ /**
+ * initialization of {@link org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortStatusMessageBuilder.PortStatusMessageBuilder}
+ * and {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil}
+ * @throws Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ portStatusMessageBuilder = new PortStatusMessageBuilder();
+ portUtil = PortFeaturesUtil.getInstance();
+ }
+
+ /**
+ * @throws Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ portStatusMessageBuilder = null;
+ portUtil = null;
+ }
+
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil#getPortBandwidth()} for OF 1.0 version
+ * and features
+ * .
+ */
+ @Test
+ public void testFeaturesV10() {
+ PortFeaturesV10 features = new PortFeaturesV10(true, true, true, false, true, false, true, true, true, false, true, false);
+ portStatusMessageBuilder.setReason(PortReason.OFPPRMODIFY).setVersion((short) 1).setCurrentFeaturesV10(features);
+
+ Assert.assertNotNull(portUtil.getPortBandwidth(portStatusMessageBuilder.build()));
+ }
+
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil#getPortBandwidth()} for OF 1.3 version
+ * and features
+ * .
+ */
+ @Test
+ public void testFeaturesV13() {
+ PortFeatures features = new PortFeatures(true, true, true, false, true, false, true, true, true, false, true, false, false, true, false, false);
+ portStatusMessageBuilder.setReason(PortReason.OFPPRMODIFY).setVersion((short) 4).setCurrentFeatures(features);
+
+ Assert.assertNotNull(portUtil.getPortBandwidth(portStatusMessageBuilder.build()));
+ }
+
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil#getPortBandwidth()} for malformed features
+ * - at least one feature is null
+ * .
+ */
+ @Test
+ public void testFeaturesMalformed() {
+ PortFeaturesV10 features = new PortFeaturesV10(true, true, true, true, true, true, false, false, false, false, true, null);
+ portStatusMessageBuilder.setReason(PortReason.OFPPRMODIFY).setVersion((short) 1).setCurrentFeaturesV10(features);
+
+ Assert.assertNull(portUtil.getPortBandwidth(portStatusMessageBuilder.build()));
+ }
+
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil#getPortBandwidth()} for mismatch between
+ * port version and port features
+ * .
+ */
+ @Test
+ public void testFeaturesVersionMismatch() {
+ PortFeatures features = new PortFeatures(true, true, true, false, true, false, true, true, true, false, true, false, false, true, false, false);
+ portStatusMessageBuilder.setReason(PortReason.OFPPRMODIFY).setVersion((short) 1).setCurrentFeatures(features);
+
+ Assert.assertNull(portUtil.getPortBandwidth(portStatusMessageBuilder.build()));
+ }
+
+ /**
+ * Test method for
+ * {@link org.opendaylight.openflowplugin.openflow.md.core.session.PortFeaturesUtil#getPortBandwidth()} for nonexisting port version
+ * .
+ */
+ @Test
+ public void testFeaturesNonexistingVersion() {
+ PortFeatures features = new PortFeatures(true, true, true, false, true, false, true, true, true, false, true, false, false, true, false, false);
+ portStatusMessageBuilder.setReason(PortReason.OFPPRMODIFY).setVersion((short) 0).setCurrentFeatures(features);
+
+ Assert.assertNull(portUtil.getPortBandwidth(portStatusMessageBuilder.build()));
+ }
+
+}
import java.util.List;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.DropActionCaseBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.InstructionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ApplyActionsCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
ret.setMatch(match.build());
- DropAction dropAction = new DropActionBuilder().build();
+ DropActionCase dropAction = new DropActionCaseBuilder().build();
ActionBuilder action = new ActionBuilder();
action.setAction(dropAction);
List<Action> actions = Collections.singletonList(action.build());
//
- ApplyActionsBuilder aaBldr = new ApplyActionsBuilder();
- aaBldr.setAction(actions);
+ ApplyActionsCaseBuilder aaBldr = new ApplyActionsCaseBuilder();
+ aaBldr.setApplyActions(new ApplyActionsBuilder().setAction(actions).build());
InstructionBuilder instructionBldr = new InstructionBuilder();
instructionBldr.setInstruction(aaBldr.build());