UI Flow configuration fix
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / match / Match.java
index a4fc2e9ff714c5d75dc5a5aa2a6e646304871953..736314caedc2cb535a9e8160e3d056789e2d67c5 100644 (file)
@@ -9,6 +9,7 @@
 
 package org.opendaylight.controller.sal.match;
 
+import java.io.Serializable;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
 import java.net.InetAddress;
@@ -38,8 +39,9 @@ import org.opendaylight.controller.sal.utils.NetUtils;
  */
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.NONE)
-public class Match implements Cloneable {
-    private static final Map<MatchType, MatchType> reversableMatches;
+public class Match implements Cloneable, Serializable {
+       private static final long serialVersionUID = 1L;
+       private static final Map<MatchType, MatchType> reversableMatches;
     static {
         Map<MatchType, MatchType> map = new HashMap<MatchType, MatchType>();
         map.put(MatchType.DL_SRC, MatchType.DL_DST);
@@ -130,7 +132,6 @@ public class Match implements Cloneable {
      *
      * @return the 32 bit long mask (Refer to {@code}org.opendaylight.controller.sal.match.MatchElement)
      */
-    @XmlElement
     public int getMatches() {
         return matches;
     }
@@ -144,6 +145,16 @@ public class Match implements Cloneable {
         return new ArrayList<MatchType>(fields.keySet());
     }
 
+    /**
+     * Returns the list of MatchFields the match is set for
+     *
+     * @return List of individual MatchField values. 
+     */
+    @XmlElement(name="matchField")
+    public List<MatchField> getMatchFields() {
+       return new ArrayList<MatchField>(fields.values());
+    }
+    
     /**
      * Returns whether this match is for an IPv6 flow
      */