blob: a352f05c449fd4100f95652c98c777867a6afda2 [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;
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -07006import net.onrc.onos.core.matchaction.MatchActionId;
Ray Milkey42ae1b52014-08-15 16:37:06 -07007import net.onrc.onos.core.matchaction.MatchActionOperations;
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -07008import net.onrc.onos.core.matchaction.MatchActionOperationsId;
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;
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -070012import net.onrc.onos.core.util.IdGenerator;
Toshio Koidea03915e2014-07-01 18:39:52 -070013import net.onrc.onos.core.util.PortNumber;
14
15/**
Toshio Koide7894ca02014-08-15 14:30:13 -070016 * Flow object representing an optical path.
Toshio Koidea03915e2014-07-01 18:39:52 -070017 * <p>
18 * TODO: Think this: How do we deal the optical path flow going through the
19 * regenerators? Can we express it with multiple OpticalPathFlow objects?
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070020 * <p>
21 * NOTE: This class is not fully supported for the August release.
Toshio Koidea03915e2014-07-01 18:39:52 -070022 */
23public class OpticalPathFlow extends PathFlow {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070024 private final int lambda;
Toshio Koidea03915e2014-07-01 18:39:52 -070025
26 /**
Toshio Koide2c67a2d2014-08-27 11:30:56 -070027 * Default constructor for Kryo deserialization.
28 */
29 @Deprecated
30 protected OpticalPathFlow() {
31 lambda = 0;
32 }
33
34 /**
Toshio Koidea03915e2014-07-01 18:39:52 -070035 * Constructor.
36 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070037 * @param id the ID for this new Flow object
38 * @param ingressPort the Ingress port number at the ingress edge node
39 * @param path the Path between ingress and egress edge node
40 * @param egressActions the list of Action objects at the egress edge node
41 * @param lambda the lambda to be used throughout the path
Toshio Koidea03915e2014-07-01 18:39:52 -070042 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070043 public OpticalPathFlow(FlowId id,
44 PortNumber ingressPort, Path path, List<Action> egressActions, int lambda) {
45 super(id, ingressPort, path, egressActions);
Toshio Koidea03915e2014-07-01 18:39:52 -070046 this.lambda = lambda;
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070047 }
48
49 /**
Toshio Koide5c5ca102014-08-19 00:49:52 -070050 * Gets lambda which is used throughout the path.
51 *
52 * @return lambda which is used throughout the path
53 */
54 public int getLambda() {
55 return lambda;
56 }
57
58 /**
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070059 * Gets traffic filter for this flow.
60 * <p>
61 * This method only returns wildcard match, because the ingress transponder
62 * port does not have filtering functionality.
63 */
64 @Override
65 public PacketMatch getMatch() {
66 return (new PacketMatchBuilder()).build();
Toshio Koidea03915e2014-07-01 18:39:52 -070067 }
68
Toshio Koidea03915e2014-07-01 18:39:52 -070069 @Override
Toshio Koided7d550c2014-08-21 16:08:55 -070070 public List<MatchActionOperations> compile(Operator op,
Sho SHIMIZU7cd8a422014-08-27 16:05:21 -070071 IdGenerator<MatchActionId> maIdGenerator,
72 IdGenerator<MatchActionOperationsId> maoIdGenerator) {
Toshio Koidea03915e2014-07-01 18:39:52 -070073 // TODO Auto-generated method stub
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070074 return null;
Toshio Koidea03915e2014-07-01 18:39:52 -070075 }
76}