Register flow-manager and match-action related classes to KryoFactory.
- The following classes are now registered and available on KryoFactory:
-- FlowId
-- Path
-- Tree
-- FlowLink
-- OpticalPathFlow
-- PacketPathFlow
-- SingleDstTreeFlow
-- PacketMatch
-- OutputAction
-- ModifyDstMacAction
-- ModifyDstMacAction
- This task is a preperation for ONOS-1736 and ONOS-1842.
Change-Id: If438f5175e68672e0ce02f56681c35c3be87f0bc
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
index 6fbed8a..0caef51 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleDstTreeFlow.java
@@ -7,11 +7,15 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
import net.onrc.onos.api.flowmanager.FlowBatchOperation.Operator;
import net.onrc.onos.core.matchaction.MatchAction;
import net.onrc.onos.core.matchaction.MatchActionIdGenerator;
@@ -25,9 +29,6 @@
import net.onrc.onos.core.util.PortNumber;
import net.onrc.onos.core.util.SwitchPort;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-
/**
* A {@link Flow} object expressing the multipoints-to-point tree flow for the
* packet layer.
@@ -43,6 +44,17 @@
private final List<Action> egressActions;
/**
+ * Default constructor for Kryo deserialization.
+ */
+ @Deprecated
+ protected SingleDstTreeFlow() {
+ match = null;
+ ingressPorts = null;
+ tree = null;
+ egressActions = null;
+ }
+
+ /**
* Creates new instance using Tree object.
*
* @param id ID for this object
@@ -56,9 +68,9 @@
Collection<SwitchPort> ingressPorts, Tree tree, List<Action> egressActions) {
super(id);
this.match = checkNotNull(match);
- this.ingressPorts = ImmutableSet.copyOf(checkNotNull(ingressPorts));
+ this.ingressPorts = new HashSet<>(checkNotNull(ingressPorts));
this.tree = checkNotNull(tree);
- this.egressActions = ImmutableList.copyOf(checkNotNull(egressActions));
+ this.egressActions = new LinkedList<>(checkNotNull(egressActions));
// TODO: check if the tree is a MP2P tree.
// TODO: check consistency between ingressPorts and tree topology.
@@ -70,7 +82,7 @@
* @return the ingress ports of the tree
*/
public Collection<SwitchPort> getIngressPorts() {
- return ingressPorts;
+ return ImmutableSet.copyOf(ingressPorts);
}
/**
@@ -88,7 +100,7 @@
* @return the list of actions at the egress edge switch
*/
public List<Action> getEgressActions() {
- return egressActions;
+ return ImmutableList.copyOf(egressActions);
}
@Override