Merge "BUG-1953: fix SAL compatility layer"
[controller.git] / opendaylight / md-sal / samples / l2switch / implementation / src / main / java / org / opendaylight / controller / sample / l2switch / md / flow / FlowWriterService.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.sample.l2switch.md.flow;
9
10 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRef;
12
13 /**
14  * Service that adds packet forwarding flows to configuration data store.
15  */
16 public interface FlowWriterService {
17
18   /**
19    * Writes a flow that forwards packets to destPort if destination mac in packet is destMac and
20    * source Mac in packet is sourceMac. If sourceMac is null then flow would not set any source mac,
21    * resulting in all packets with destMac being forwarded to destPort.
22    *
23    * @param sourceMac
24    * @param destMac
25    * @param destNodeConnectorRef
26    */
27   public void addMacToMacFlow(MacAddress sourceMac, MacAddress destMac, NodeConnectorRef destNodeConnectorRef);
28
29   /**
30    * Writes mac-to-mac flow on all ports that are in the path between given source and destination ports.
31    * It uses path provided by NetworkGraphService{@link org.opendaylight.controller.sample.l2switch.md.topology.NetworkGraphService} to find a links{@link org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Link}
32    * between given ports. And then writes appropriate flow on each port that is covered in that path.
33    *
34    * @param sourceMac
35    * @param sourceNodeConnectorRef
36    * @param destMac
37    * @param destNodeConnectorRef
38    */
39   public void addMacToMacFlowsUsingShortestPath(MacAddress sourceMac, NodeConnectorRef sourceNodeConnectorRef, MacAddress destMac, NodeConnectorRef destNodeConnectorRef);
40
41
42 }