blob: 51dce4341e0b10d74a72a2f38ca09e5e8ac7b116 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.List;
4
Toshio Koided7d550c2014-08-21 16:08:55 -07005import net.onrc.onos.api.flowmanager.FlowBatchOperation.Operator;
6import net.onrc.onos.core.matchaction.MatchActionIdGenerator;
Ray Milkey42ae1b52014-08-15 16:37:06 -07007import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koided7d550c2014-08-21 16:08:55 -07008import net.onrc.onos.core.matchaction.MatchActionOperationsIdGenerator;
Toshio Koided8b077a2014-08-13 10:47:21 -07009import net.onrc.onos.core.matchaction.action.Action;
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070010import net.onrc.onos.core.matchaction.match.PacketMatch;
11import net.onrc.onos.core.matchaction.match.PacketMatchBuilder;
Toshio Koidea03915e2014-07-01 18:39:52 -070012import net.onrc.onos.core.util.PortNumber;
13
14/**
Toshio Koide7894ca02014-08-15 14:30:13 -070015 * Flow object representing an optical path.
Toshio Koidea03915e2014-07-01 18:39:52 -070016 * <p>
17 * TODO: Think this: How do we deal the optical path flow going through the
18 * regenerators? Can we express it with multiple OpticalPathFlow objects?
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070019 * <p>
20 * NOTE: This class is not fully supported for the August release.
Toshio Koidea03915e2014-07-01 18:39:52 -070021 */
22public class OpticalPathFlow extends PathFlow {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070023 private final int lambda;
Toshio Koidea03915e2014-07-01 18:39:52 -070024
25 /**
Toshio Koide2c67a2d2014-08-27 11:30:56 -070026 * Default constructor for Kryo deserialization.
27 */
28 @Deprecated
29 protected OpticalPathFlow() {
30 lambda = 0;
31 }
32
33 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070034 * Constructor.
35 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070036 * @param id the ID for this new Flow object
37 * @param ingressPort the Ingress port number at the ingress edge node
38 * @param path the Path between ingress and egress edge node
39 * @param egressActions the list of Action objects at the egress edge node
40 * @param lambda the lambda to be used throughout the path
Toshio Koidea03915e2014-07-01 18:39:52 -070041 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070042 public OpticalPathFlow(FlowId id,
43 PortNumber ingressPort, Path path, List<Action> egressActions, int lambda) {
44 super(id, ingressPort, path, egressActions);
Toshio Koidea03915e2014-07-01 18:39:52 -070045 this.lambda = lambda;
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070046 }
47
48 /**
Toshio Koide5c5ca102014-08-19 00:49:52 -070049 * Gets lambda which is used throughout the path.
50 *
51 * @return lambda which is used throughout the path
52 */
53 public int getLambda() {
54 return lambda;
55 }
56
57 /**
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070058 * Gets traffic filter for this flow.
59 * <p>
60 * This method only returns wildcard match, because the ingress transponder
61 * port does not have filtering functionality.
62 */
63 @Override
64 public PacketMatch getMatch() {
65 return (new PacketMatchBuilder()).build();
Toshio Koidea03915e2014-07-01 18:39:52 -070066 }
67
Toshio Koidea03915e2014-07-01 18:39:52 -070068 @Override
Toshio Koided7d550c2014-08-21 16:08:55 -070069 public List<MatchActionOperations> compile(Operator op,
70 MatchActionIdGenerator maIdGenerator,
71 MatchActionOperationsIdGenerator maoIdGenerator) {
Toshio Koidea03915e2014-07-01 18:39:52 -070072 // TODO Auto-generated method stub
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070073 return null;
Toshio Koidea03915e2014-07-01 18:39:52 -070074 }
75}