Search in sources :

Example 6 with FlowRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved in project openflowplugin by opendaylight.

the class FlowNotificationSupplierImpl method deleteNotification.

@Override
public FlowRemoved deleteNotification(final InstanceIdentifier<Flow> path) {
    Preconditions.checkArgument(path != null);
    final FlowRemovedBuilder builder = new FlowRemovedBuilder();
    builder.setFlowRef(new FlowRef(path));
    builder.setNode(createNodeRef(path));
    return builder.build();
}
Also used : FlowRef(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef) FlowRemovedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder)

Example 7 with FlowRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved in project openflowplugin by opendaylight.

the class FlowRemovedTranslator method translateMatch.

protected MatchBuilder translateMatch(FlowRemoved flowRemoved, DeviceInfo deviceInfo) {
    final VersionDatapathIdConvertorData datapathIdConvertorData = new VersionDatapathIdConvertorData(deviceInfo.getVersion());
    datapathIdConvertorData.setDatapathId(deviceInfo.getDatapathId());
    final Optional<MatchBuilder> matchBuilderOptional = getConvertorExecutor().convert(flowRemoved.getMatch(), datapathIdConvertorData);
    return matchBuilderOptional.orElse(new MatchBuilder());
}
Also used : VersionDatapathIdConvertorData(org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData) MatchBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)

Example 8 with FlowRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved in project openflowplugin by opendaylight.

the class FlowRemovedTranslatorTest method testTranslateV10.

@Test
public void testTranslateV10() throws Exception {
    org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FlowRemoved flowRemovedMessage = buildMessage(true);
    final FlowRemoved flowRemoved = translatorV10.translate(flowRemovedMessage, deviceInfo, null);
    assertEquals(flowRemovedMessage.getCookie(), flowRemoved.getCookie().getValue());
    assertEquals(flowRemovedMessage.getPriority(), flowRemoved.getPriority());
    assertEquals((short) 0, flowRemoved.getTableId().shortValue());
}
Also used : FlowRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)3 FlowRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemoved)3 BigInteger (java.math.BigInteger)2 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)2 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 ArrayList (java.util.ArrayList)1 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)1 FlowEntity (org.opendaylight.genius.mdsalutil.FlowEntity)1 Ipv4Prefix (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix)1 PhysAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.PhysAddress)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1 Flow (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow)1 FlowKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey)1 FlowRemovedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowRemovedBuilder)1 FlowRef (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef)1 RemovedFlowReason (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.RemovedFlowReason)1 IfIndexInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._if.indexes._interface.map.IfIndexInterface)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1